VirtualBox

Ignore:
Timestamp:
Sep 6, 2021 9:35:26 AM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Separated the audio testing and the actual audio verification into two steps to have a more fine-grained result in the test manager. Also, now using more meaningful test tags which contain a timestamp and the VM name for easier retrieval / identification. ​bugref:10008

File:
1 edited

Legend:

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

    r91118 r91119  
    3434
    3535# Standard Python imports.
     36from datetime import datetime
    3637import os
    3738import sys
    3839import signal
    3940import subprocess
    40 import uuid
    4141
    4242# Only the main script needs to modify the path.
     
    397397        return iRc;
    398398
    399     def startVkatOnGuest(self, oTestVm, oSession, oTxsSession):
     399    def startVkatOnGuest(self, oTestVm, oSession, oTxsSession, sTag):
    400400        """
    401401        Starts VKAT on the guest (running in background).
     
    407407        reporter.log('Guest audio test temp path is \"%s\"' % (sPathAudioOut));
    408408        reporter.log('Guest audio test output path is \"%s\"' % (sPathAudioTemp));
     409        reporter.log('Guest audio test tag is \"%s\"' % (sTag));
    409410
    410411        fRc, sVkatExe = self.locateGstVkat(oSession, oTxsSession);
     
    415416
    416417            asArgsVkat = [ sVkatExe, 'test', '--mode', 'guest', '--probe-backends', \
    417                            '--tempdir', sPathAudioTemp, '--outdir', sPathAudioOut ];
     418                           '--tempdir', sPathAudioTemp, '--outdir', sPathAudioOut, \
     419                           '--tag', sTag ];
    418420
    419421            asArgs.extend(asArgsVkat);
     
    467469        return fRc;
    468470
    469     def runTests(self, oTestVm, oSession, oTxsSession, sDesc, asTests):
     471    def runTests(self, oTestVm, oSession, oTxsSession, sDesc, sTag, asTests):
    470472        """
    471473        Runs one or more tests using VKAT on the host, which in turn will
     
    474476        """
    475477        _              = oSession, oTxsSession;
    476         sTag           = uuid.uuid4();
    477478
    478479        sPathTemp      = self.sScratchPath;
     
    492493        # Build the base command line, exclude all tests by default.
    493494        asArgs = [ sVkatExe, 'test', '--mode', 'host', '--probe-backends', \
    494                              '--tempdir', sPathAudioTemp, '--outdir', sPathAudioOut, '-a' ];
     495                             '--tempdir', sPathAudioTemp, '--outdir', sPathAudioOut, '-a', \
     496                             '--tag', sTag, \
     497                             '--no-verify' ]; # We do the verification separately in the step below.
    495498
    496499        for _ in range(1, reporter.getVerbosity()): # Verbosity always is initialized at 1.
     
    507510        reporter.testDone();
    508511
     512        if fRc:
     513            #
     514            # When running the test(s) above were successful, do the verification step next.
     515            # This gives us a bit more fine-grained test results in the test manager.
     516            #
     517            reporter.testStart('Verifying audio data');
     518
     519            sNameSetHst = '%s-host.tar.gz' % (sTag);
     520            sPathSetHst = oTestVm.pathJoin(sPathAudioOut, sNameSetHst);
     521            sNameSetGst = '%s-guest.tar.gz' % (sTag);
     522            sPathSetGst = oTestVm.pathJoin(sPathAudioOut, sNameSetGst);
     523
     524            asArgs = [ sVkatExe, 'verify', sPathSetHst, sPathSetGst ];
     525
     526            for _ in range(1, reporter.getVerbosity()): # Verbosity always is initialized at 1.
     527                asArgs.extend([ '-v' ]);
     528
     529            fRc = self.executeHst("VKAT Host Verify", asArgs);
     530            if fRc:
     531                reporter.error("Verification audio data successful");
     532            else:
     533                #
     534                # Add the test sets to the test manager for later (manual) diagnosis.
     535                #
     536                reporter.addLogFile(sPathSetGst, 'misc/other', 'Guest audio test set');
     537                reporter.addLogFile(sPathSetHst, 'misc/other', 'Host audio test set');
     538
     539                reporter.error("Verification of audio data failed");
     540
     541            reporter.testDone();
     542
    509543        return fRc;
    510544
     
    527561        reporter.log("Active tests: %s" % (self.asTests,));
    528562
    529         fRc = self.startVkatOnGuest(oTestVm, oSession, oTxsSession);
     563        # Define a tag for the whole run.
     564        sTag = oTestVm.sVmName + "_" + datetime.now().strftime("%Y%m%d_%H%M%S");
     565
     566        fRc = self.startVkatOnGuest(oTestVm, oSession, oTxsSession, sTag);
    530567        if fRc:
    531568            #
     
    533570            #
    534571            if "guest_tone_playback" in self.asTests:
    535                 fRc = self.runTests(oTestVm, oSession, oTxsSession, 'Guest audio playback', asTests = [ '-i0' ]);
     572                fRc = self.runTests(oTestVm, oSession, oTxsSession, \
     573                                    'Guest audio playback', sTag + "_test_playback", \
     574                                    asTests = [ '-i0' ]);
    536575            if "guest_tone_recording" in self.asTests:
    537                 fRc = fRc and self.runTests(oTestVm, oSession, oTxsSession, 'Guest audio recording', asTests = [ '-i1' ]);
     576                fRc = fRc and self.runTests(oTestVm, oSession, oTxsSession, \
     577                                            'Guest audio recording', sTag + "_test_recording", \
     578                                            asTests = [ '-i1' ]);
    538579
    539580            # Cancel guest VKAT execution task summoned by startVkatOnGuest().
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