VirtualBox

Changeset 103499 in vbox


Ignore:
Timestamp:
Feb 21, 2024 2:44:17 PM (9 months ago)
Author:
vboxsync
Message:

Validation Kit/tdAudioTest: Added new option "--audio-debug-img <path/to/vkat>" to upload own VKAT guest builds for quicker debugging.

File:
1 edited

Legend:

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

    r103494 r103499  
    6666
    6767# pylint: disable=unnecessary-semicolon
     68
     69class tdDebugSettings(object):
     70    """
     71    Contains local test debug settings.
     72    """
     73    def __init__(self, sVkatExeHst = None):
     74        # Absolute path of VKAT on the host side which gets uploaded from the host.
     75        self.sVkatExeHst = sVkatExeHst;
     76        # Absolute path of VKAT on the guest side (which got uploaded from the host).
     77        self.sVkatExeGst = None;
    6878
    6979class tdAudioTest(vbox.TestDriver):
     
    96106        ];
    97107        self.asTests          = self.asTestsDef;
     108        self.oDebug           = tdDebugSettings();
    98109
    99110        # Optional arguments passing to VKAT when doing the actual audio tests.
     
    134145        reporter.log('  --audio-controller-type <HDA|AC97|SB16>');
    135146        reporter.log('      Default: recommended controller');
     147        reporter.log('  --audio-debug-img <path/to/vkat>');
    136148        reporter.log('  --audio-test-count <number>');
    137149        reporter.log('      Default: 0 (means random)');
     
    178190            else:
    179191                raise base.InvalidOption('The "--audio-controller-type" value "%s" is not valid' % (asArgs[iArg]));
     192        elif asArgs[iArg] == '--audio-debug-img':
     193            iArg += 1;
     194            if iArg >= len(asArgs):
     195                raise base.InvalidOption('Option "%s" needs a value' % (asArgs[iArg - 1]));
     196            self.oDebug.sVkatExeHst = asArgs[iArg];
    180197        elif    asArgs[iArg] == '--audio-test-count' \
    181198             or asArgs[iArg] == '--audio-test-tone-duration' \
     
    210227        return iArg + 1;
    211228
     229    def prepareGuestForDebugging(self, oSession, oTxsSession, oTestVm): # pylint: disable=unused-argument
     230        """
     231        Prepares a guest for (manual) debugging.
     232
     233        This involves copying over and invoking a the locally built VKAT binary.
     234        """
     235
     236        if self.oDebug.sVkatExeHst is None: # If no debugging enabled, bail out.
     237            reporter.log('Skipping debugging');
     238            return True;
     239
     240        self.oDebug.sVkatExeGst = oTestVm.pathJoin(self.getGuestTempDir(oTestVm), 'vkat${EXESUFF}');
     241
     242        reporter.log('Preparing for debugging ...');
     243
     244        try:
     245            reporter.log('Uploading "%s" to "%s" ...' % (self.oDebug.sVkatExeHst, self.oDebug.sVkatExeGst));
     246            oTxsSession.syncUploadFile(self.oDebug.sVkatExeHst, self.oDebug.sVkatExeGst);
     247
     248            if oTestVm.isLinux():
     249                oTxsSession.syncChMod(self.oDebug.sVkatExeGst, 0o755);
     250        except:
     251            return reporter.errorXcpt('Unable to prepare for debugging');
     252
     253        return True;
     254
    212255    def actionVerify(self):
    213256        """
     
    525568        reporter.log('Guest audio test tag is \"%s\"' % (sTag));
    526569
    527         fRc, sVkatExe = self.locateGstBinary(oSession, oTxsSession, self.asGstVkatPaths);
     570        if self.oDebug.sVkatExeGst is None:
     571            fRc, sVkatExe = self.locateGstBinary(oSession, oTxsSession, self.asGstVkatPaths);
     572        else:
     573            sVkatExe = self.oDebug.sVkatExeGst;
     574            fRc      = True;
    528575        if fRc:
    529576            reporter.log('Using VKAT on guest at \"%s\"' % (sVkatExe));
     
    825872        reporter.testDone();
    826873
    827         reporter.log('Waiting for any OS startup sounds getting played (to skip those) ...');
    828         time.sleep(5);
    829 
    830         if  oSession is not None:
     874        if oSession is not None:
     875
     876            self.prepareGuestForDebugging(oSession, oTxsSession, oTestVm);
     877
     878            reporter.log('Waiting for any OS startup sounds getting played (to skip those) ...');
     879            time.sleep(5);
     880
    831881            self.addTask(oTxsSession);
    832882
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