Changeset 92281 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Nov 9, 2021 9:45:38 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py
r92174 r92281 289 289 asEnvTmp[sKey] = sValue; 290 290 291 if fAsAdmin \ 292 and utils.getHostOs() != 'win': 293 oProcess = utils.sudoProcessPopen(asArgs, 294 env = asEnvTmp, 295 stdout = sys.stdout, stderr = sys.stdout, 296 close_fds = False); 297 else: 298 oProcess = utils.processPopenSafe(asArgs, 299 env = asEnvTmp, 300 stdout = sys.stdout, stderr = sys.stdout); 301 if oProcess: 302 self.pidFileAdd(oProcess.pid, sWhat, fSudo = fAsAdmin); 303 iRc = oProcess.wait(); 304 self.pidFileRemove(oProcess.pid); 305 306 if iRc == 0: 307 reporter.log('*** %s: exit code %d' % (sWhat, iRc)); 308 fRc = True; 291 try: 292 if fAsAdmin \ 293 and utils.getHostOs() != 'win': 294 sStdOut = utils.sudoProcessOutputChecked(asArgs, env = asEnvTmp); 295 if sStdOut: 296 sStdOut = sStdOut.strip(); 297 reporter.log("stdout:\n" + sStdOut); 309 298 else: 310 reporter.log('!*! %s: exit code %d' % (sWhat, iRc)); 311 312 return fRc; 313 314 def executeHst(self, sWhat, asArgs, asEnv = None, fAsync = False, fAsAdmin = False): 299 (iExit, sStdOut, sStdErr) = utils.processOutputUnchecked(asArgs, env = asEnvTmp); 300 301 if sStdOut: 302 sStdOut = sStdOut.strip(); 303 reporter.log("stdout:\n" + sStdOut); 304 305 if sStdErr: 306 sStdErr = sStdErr.strip(); 307 reporter.log("stderr:\n" + sStdErr); 308 309 if iExit == 0: 310 reporter.log('*** %s: exit code %d' % (sWhat, iExit)); 311 fRc = True; 312 else: 313 reporter.log('!*! %s: exit code %d' % (sWhat, iExit)); 314 315 except: 316 reporter.logXcpt('Executing "%s" failed!' % (sWhat)); 317 318 return fRc; 319 320 def executeHst(self, sWhat, asArgs, asEnv = None, fAsAdmin = False): 315 321 """ 316 322 Runs a binary (image) with optional admin (root) rights on the host and … … 321 327 Returns success status (exit code is 0). 322 328 """ 323 reporter.log('Executing \"%s\" on host (as admin = %s, async = %s)' % (sWhat, fAsAdmin, fAsync)); 324 325 reporter.testStart(sWhat); 329 reporter.log('Executing \"%s\" on host (as admin = %s)' % (sWhat, fAsAdmin)); 326 330 327 331 try: sys.stdout.flush(); … … 330 334 except: pass; 331 335 332 fRc = self.executeHstLoop(sWhat, asArgs, asEnv );336 fRc = self.executeHstLoop(sWhat, asArgs, asEnv, fAsAdmin); 333 337 if fRc: 334 338 reporter.log('Executing \"%s\" on host done' % (sWhat,)); 335 339 else: 336 340 reporter.log('Executing \"%s\" on host failed' % (sWhat,)); 337 338 reporter.testDone();339 341 340 342 return fRc;
Note:
See TracChangeset
for help on using the changeset viewer.