VirtualBox

Ignore:
Timestamp:
Mar 1, 2016 11:27:30 AM (9 years ago)
Author:
vboxsync
Message:

ValidationKit/usb: Add a new gadget type using the dummy_hcd module to use gadgets on the machine executing the test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/usb/tdUsb1.py

    r59813 r59884  
    99__copyright__ = \
    1010"""
    11 Copyright (C) 2014-2015 Oracle Corporation
     11Copyright (C) 2014-2016 Oracle Corporation
    1212
    1313This file is part of VirtualBox Open Source Edition (OSE), as
     
    105105        self.cUsbReattachCycles    = self.cUsbReattachCyclesDef;
    106106        self.sHostname             = socket.gethostname().lower();
     107        self.fUseTxs               = True;
    107108
    108109    #
     
    112113        rc = vbox.TestDriver.showUsage(self);
    113114        reporter.log('');
    114         reporter.log('tdStorageBenchmark1 Options:');
     115        reporter.log('tdUsb1 Options:');
    115116        reporter.log('  --virt-modes    <m1[:m2[:]]');
    116117        reporter.log('      Default: %s' % (':'.join(self.asVirtModesDef)));
     
    131132        reporter.log('  --usb-reattach-cycles <cycles>');
    132133        reporter.log('      Default: %s' % (self.cUsbReattachCyclesDef));
     134        reporter.log('  --local');
     135        reporter.log('      Don\'t use TXS for communication with the gadget but do everything');
     136        reporter.log('      on this host');
    133137        return rc;
    134138
     
    196200                raise base.InvalidOption('The "--usb-reattach-cycles" value "%s" is zero or negative.' \
    197201                    % (self.cUsbReattachCycles,));
     202        elif asArgs[iArg] == '--local':
     203            self.fUseTxs = False;
    198204        else:
    199205            return vbox.TestDriver.parseOption(self, asArgs, iArg);
     
    288294        """
    289295        # Get configured USB test devices from hostname we are running on
    290         sGadgetHost, sGadgetType = self.getGadgetParams(self.sHostname, sSpeed);
     296        if self.fUseTxs is True:
     297            sGadgetHost, sGadgetType = self.getGadgetParams(self.sHostname, sSpeed);
     298        else:
     299            sGadgetHost = 'dummy';
     300            sGadgetType = usbgadget.g_ksGadgetTypeDummyHcd;
    291301
    292302        # Create device filter
     
    295305            oUsbGadget = usbgadget.UsbGadget();
    296306            reporter.log('Connecting to gadget: ' + sGadgetType);
    297             fRc = oUsbGadget.connectTo(30 * 1000, sGadgetType, sGadgetHost);
     307            fRc = oUsbGadget.connectTo(30 * 1000, sGadgetType, self.fUseTxs, sGadgetHost);
    298308            if fRc is True:
    299309                reporter.log('Connect succeeded');
     
    330340        """
    331341        # Get configured USB test devices from hostname we are running on
    332         sGadgetHost, sGadgetType = self.getGadgetParams(self.sHostname, sSpeed);
     342        if self.fUseTxs is True:
     343            sGadgetHost, sGadgetType = self.getGadgetParams(self.sHostname, sSpeed);
     344        else:
     345            sGadgetHost = 'dummy';
     346            sGadgetType = usbgadget.g_ksGadgetTypeDummyHcd;
    333347
    334348        # Create device filter
     
    337351            oUsbGadget = usbgadget.UsbGadget();
    338352            reporter.log('Connecting to gadget: ' + sGadgetType);
    339             fRc = oUsbGadget.connectTo(30 * 1000, sGadgetType, sGadgetHost);
     353            fRc = oUsbGadget.connectTo(30 * 1000, sGadgetType, self.fUseTxs, sGadgetHost);
    340354            if fRc is True:
    341355                reporter.log('Connect succeeded');
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