Changeset 103348 in vbox for trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py
- Timestamp:
- Feb 14, 2024 10:03:01 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py
r103340 r103348 329 329 iRc = 0; 330 330 331 # For Python 3.x we provide "real-time" output.332 331 if sys.version_info[0] >= 3: 333 332 while oProcess.stdout.readable(): # pylint: disable=no-member … … 335 334 if sStdOut: 336 335 sStdOut = sStdOut.strip(); 337 reporter.log('%s: %s' % (sWhat, sStdOut)); 336 reporter.log('%s: %s' % (sWhat, sStdOut.rstrip('\n'))); 337 self.processEvents(0); 338 338 iRc = oProcess.poll(); 339 339 if iRc is not None: 340 340 break; 341 else: 342 # For Python 2.x it's too much hassle to set the file descriptor options (O_NONBLOCK) and stuff, 343 # so just use communicate() here and dump everythiong all at once when finished. 344 sStdOut = oProcess.communicate(); 345 if sStdOut: 346 reporter.log('%s: %s' % (sWhat, sStdOut)); 347 iRc = oProcess.poll(); 341 else: # Python 2.x cruft. 342 while True: 343 sStdOut = oProcess.stdout.readline(); 344 if sStdOut == '' \ 345 and oProcess.poll() is not None: 346 break; 347 self.processEvents(0); 348 reporter.log('%s [stdout]: %s' % (sWhat, sStdOut.rstrip('\n'),)); 348 349 349 350 if iRc == 0: … … 370 371 return self.executeHstLoop(sWhat, asArgs, asEnv, fAsAdmin); 371 372 372 def executeHst(self, sWhat, asArgs, asEnv = None, fAsAdmin = False, fBlocking = False):373 def executeHst(self, sWhat, asArgs, asEnv = None, fAsAdmin = False, fBlocking = True): 373 374 """ 374 375 Runs a binary (image) with optional admin (root) rights on the host and … … 389 390 except: pass; 390 391 391 if notfBlocking: # Run in same thread (blocking).392 if fBlocking: # Run in same thread (blocking). 392 393 fRc = self.executeHstLoop(sWhat, asArgs, asEnv, fAsAdmin); 393 394 else: # Run in separate thread (asynchronous). … … 596 597 reporter.log('Using VKAT on host at: \"%s\"' % (sVkatExe)); 597 598 598 # Run the VKAT self test.599 # Doesn't take long and gives us some more clue if it flies on the testboxes.600 reporter.testStart('VKAT Selftest');601 fRc = self.executeHst("VKAT Host Selftest", [ sVkatExe, 'selftest' ], fBlocking = True);602 reporter.testDone();603 if not fRc:604 return fRc;605 606 599 reporter.testStart(sDesc); 607 600 … … 738 731 if not fSkip \ 739 732 and self.fpApiVer < 7.0: 740 reporter.log('Audio testing for non-trunk builds skipped.');733 reporter.log('Audio testing not available for this branch, skipping.'); 741 734 fSkip = True; 742 743 reporter.log('Verbosity level is: %d' % (reporter.getVerbosity(),));744 745 if not fSkip:746 sVkatExe = self.getBinTool('vkat');747 asArgs = [ sVkatExe, 'enum', '--probe-backends' ];748 for _ in range(1, reporter.getVerbosity()): # Verbosity always is initialized at 1.749 asArgs.extend([ '-v' ]);750 fRc = self.executeHst("VKAT Host Audio Probing", asArgs);751 if not fRc:752 # Not fatal, as VBox then should fall back to the NULL audio backend (also worth having as a test case).753 reporter.log('Warning: Backend probing on host failed, no audio available (pure server installation?)');754 735 755 736 if fSkip: 756 737 reporter.testDone(fSkipped = True); 757 738 return True; 739 740 reporter.log('Verbosity level is: %d' % (reporter.getVerbosity(),)); 741 742 sVkatExe = self.getBinTool('vkat'); 743 744 # Run the VKAT self test. 745 # Doesn't take long and gives us some more clue if it flies on the testboxes. 746 reporter.testStart('VKAT Selftest'); 747 fRc = self.executeHst("VKAT Host Selftest", [ sVkatExe, 'selftest' ]); 748 reporter.testDone(); 749 if not fRc: 750 return fRc; 751 752 # Now probe the backends. 753 asArgs = [ sVkatExe, 'enum', '--probe-backends' ]; 754 for _ in range(1, reporter.getVerbosity()): # Verbosity always is initialized at 1. 755 asArgs.extend([ '-v' ]); 756 fRc = self.executeHst("VKAT Host Audio Probing", asArgs); 757 if not fRc: 758 # Not fatal, as VBox then should fall back to the NULL audio backend (also worth having as a test case). 759 reporter.log('Warning: Backend probing on host failed, no audio available (pure server installation?)'); 758 760 759 761 # Reconfigure the VM.
Note:
See TracChangeset
for help on using the changeset viewer.