VirtualBox

Ignore:
Timestamp:
Oct 5, 2021 8:46:57 AM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Implemented ability to run the test driver with a specific audio controller via "--audio-controller-type <HDA|AC97|SB16>". ​bugref:10008

File:
1 edited

Legend:

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

    r91558 r91560  
    5151from testdriver import base
    5252from testdriver import vbox
     53from testdriver import vboxcon;
    5354from testdriver import vboxtestvms
    5455from common     import utils;
     
    103104        self.sRunningVmName   = None;
    104105
     106        # Audio controller type to use.
     107        # If set to None, the OS' recommended controller type will be used (defined by Main).
     108        self.enmAudioControllerType = None;
     109
    105110    def showUsage(self):
    106111        """
     
    113118        reporter.log('  --audio-tests   <s1[:s2[:]]>');
    114119        reporter.log('      Default: %s  (all)' % (':'.join(self.asTestsDef)));
     120        reporter.log('  --audio-controller-type <HDA|AC97|SB16>');
     121        reporter.log('      Default: recommended controller');
    115122        reporter.log('  --audio-test-count <number>');
    116123        reporter.log('      Default: 0 (means random)');
     
    145152                        raise base.InvalidOption('The "--audio-tests" value "%s" is not valid; valid values are: %s'
    146153                                                    % (s, ' '.join(self.asTestsDef)));
     154        elif asArgs[iArg] == '--audio-controller-type':
     155            iArg += 1;
     156            if not self.importVBoxApi(): # So we can use the constant below.
     157                return iArg + 1; # Just skip stuff.
     158            if   asArgs[iArg] == 'HDA':
     159                self.enmAudioControllerType = vboxcon.AudioControllerType_HDA;
     160            elif asArgs[iArg] == 'AC97':
     161                self.enmAudioControllerType = vboxcon.AudioControllerType_AC97;
     162            elif asArgs[iArg] == 'SB16':
     163                self.enmAudioControllerType = vboxcon.AudioControllerType_SB16;
     164            else:
     165                raise base.InvalidOption('The "--audio-controller-type" value "%s" is not valid' % (asArgs[iArg]));
    147166        elif    asArgs[iArg] == '--audio-test-count' \
    148167             or asArgs[iArg] == '--audio-test-tone-duration':
     
    698717            # Make sure that the VM's audio adapter is configured the way we need it to.
    699718            if self.fpApiVer >= 4.0:
    700                 oOsType = oSession.getOsType();
    701                 ## @ŧdoo Make this configurable via driver opts (to use as a variant)?
    702                 oSession.setupAudio(oOsType.recommendedAudioController,
    703                                     fEnable = True, fEnableIn = True, fEnableOut = True);
     719                if self.enmAudioControllerType:
     720                    reporter.log('Setting user-defined audio controller type to %d' % (self.enmAudioControllerType));
     721                    oSession.setupAudio(self.enmAudioControllerType,
     722                                        fEnable = True, fEnableIn = True, fEnableOut = True);
     723                else:
     724                    oOsType = oSession.getOsType();
     725                    oSession.setupAudio(oOsType.recommendedAudioController,
     726                                        fEnable = True, fEnableIn = True, fEnableOut = True);
    704727
    705728            # Save the settings.
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