VirtualBox

Changeset 103340 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 13, 2024 5:58:46 PM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161649
Message:

Validation Kit/tdAudioTest: Added running the VKAT selftest before everything else, to see if there are any (more obvious) problems before we start testing the real thing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py

    r98651 r103340  
    361361            reporter.logXcpt('Executing "%s" failed!' % (sWhat));
    362362
     363        reporter.log('Executing \"%s\" on host %s' % (sWhat, 'done' if fRc else 'failed',));
    363364        return fRc;
    364365
     
    367368        Thread execution helper to run a process on the host.
    368369        """
    369         fRc = self.executeHstLoop(sWhat, asArgs, asEnv, fAsAdmin);
    370         if fRc:
    371             reporter.log('Executing \"%s\" on host done' % (sWhat,));
    372         else:
    373             reporter.log('Executing \"%s\" on host failed' % (sWhat,));
    374 
    375     def executeHst(self, sWhat, asArgs, asEnv = None, fAsAdmin = False):
     370        return self.executeHstLoop(sWhat, asArgs, asEnv, fAsAdmin);
     371
     372    def executeHst(self, sWhat, asArgs, asEnv = None, fAsAdmin = False, fBlocking = False):
    376373        """
    377374        Runs a binary (image) with optional admin (root) rights on the host and
     
    382379        Returns success status (exit code is 0).
    383380        """
    384         reporter.log('Executing \"%s\" on host (as admin = %s)' % (sWhat, fAsAdmin));
     381        reporter.log('Executing \"%s\" on host (as admin = %s, blocking = %s)' % (sWhat, fAsAdmin, fBlocking));
     382        reporter.log2('Arguments: %s' % (asArgs,));
     383        if asEnv:
     384            reporter.log2('Environment: %s' % (asEnv,));
    385385
    386386        try:    sys.stdout.flush();
     
    389389        except: pass;
    390390
    391         # Initialize thread rc.
    392         self.iThreadHstProcRc = -42;
    393 
    394         try:
    395             oThread = threading.Thread(target = self.executeHstThread, args = [ sWhat, asArgs, asEnv, fAsAdmin ]);
    396             oThread.start();
    397             while oThread.join(0.1):
    398                 if not oThread.is_alive():
    399                     break;
    400                 self.processEvents(0);
    401             reporter.log2('Thread returned exit code for "%s": %d' % (sWhat, self.iThreadHstProcRc));
    402         except:
    403             reporter.logXcpt('Starting thread for "%s" failed' % (sWhat,));
    404 
    405         return self.iThreadHstProcRc == 0;
     391        if not fBlocking: # Run in same thread (blocking).
     392            fRc = self.executeHstLoop(sWhat, asArgs, asEnv, fAsAdmin);
     393        else: # Run in separate thread (asynchronous).
     394            self.iThreadHstProcRc = -42; # Initialize thread rc.
     395            try:
     396                oThread = threading.Thread(target = self.executeHstThread, args = [ sWhat, asArgs, asEnv, fAsAdmin ]);
     397                oThread.start();
     398                while oThread.join(0.1):
     399                    if not oThread.is_alive():
     400                        break;
     401                    self.processEvents(0);
     402                reporter.log2('Thread returned exit code for "%s": %d' % (sWhat, self.iThreadHstProcRc));
     403            except:
     404                reporter.logXcpt('Starting thread for "%s" failed' % (sWhat,));
     405            fRc = self.iThreadHstProcRc == 0;
     406
     407        return fRc;
    406408
    407409    def getWinFirewallArgsDisable(self, sOsType):
     
    590592        reporter.log('Host audio test tag is \"%s\"' % (sTag));
    591593
     594        sVkatExe = self.getBinTool('vkat');
     595
     596        reporter.log('Using VKAT on host at: \"%s\"' % (sVkatExe));
     597
     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
    592606        reporter.testStart(sDesc);
    593 
    594         sVkatExe = self.getBinTool('vkat');
    595 
    596         reporter.log('Using VKAT on host at: \"%s\"' % (sVkatExe));
    597607
    598608        # Build the base command line, exclude all tests by default.
     
    607617
    608618        if self.asVkatTestArgs:
    609             asArgs += self.asVkatTestArgs;
     619            asArgs.extend(self.asVkatTestArgs);
    610620
    611621        # ... and extend it with wanted tests.
     
    730740            reporter.log('Audio testing for non-trunk builds skipped.');
    731741            fSkip = True;
     742
     743        reporter.log('Verbosity level is: %d' % (reporter.getVerbosity(),));
    732744
    733745        if not fSkip:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette