VirtualBox

Ignore:
Timestamp:
Apr 14, 2016 10:33:11 AM (9 years ago)
Author:
vboxsync
Message:

ValidationKit/usb: Fixes

File:
1 edited

Legend:

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

    r59884 r60488  
    3030__version__ = "$Revision$"
    3131
     32import time;
    3233
    3334# Validation Kit imports.
     
    150151        sPath = '/sys/class/udc/' + sUdcFile + '/soft_connect';
    151152
    152         return self._execLocallyOrThroughTxs('/usr/bin/sh', ('-c', 'echo' + sAction + ' > ' + sPath));
     153        return self._execLocallyOrThroughTxs('/usr/bin/sh', ('-c', 'echo ' + sAction + ' > ' + sPath));
    153154
    154155    def _prepareGadget(self):
     
    192193        self.sImpersonation = sImpersonation;
    193194
    194         if sImpersonation == g_ksGadgetImpersonationInvalid:
    195             return False;
    196         elif sImpersonation == g_ksGadgetImpersonationTest:
    197             return self._loadModule('g_zero');
     195        fRc = False;
     196        if sImpersonation == g_ksGadgetImpersonationTest:
     197            fRc = self._loadModule('g_zero');
    198198        elif sImpersonation == g_ksGadgetImpersonationMsd:
    199199            # @todo: Not complete
    200             return self._loadModule('g_mass_storage');
     200            fRc = self._loadModule('g_mass_storage');
    201201        elif sImpersonation == g_ksGadgetImpersonationWebcam:
    202202            # @todo: Not complete
    203             return self._loadModule('g_webcam');
     203            fRc = self._loadModule('g_webcam');
    204204        elif sImpersonation == g_ksGadgetImpersonationEther:
    205             return self._loadModule('g_ether');
     205            fRc = self._loadModule('g_ether');
    206206        else:
    207207            reporter.log('Invalid impersonation');
    208208
    209         return False;
     209        if fRc and self.sGadgetType is g_ksGadgetTypeDummyHcd and self.oTxsSession is not None:
     210            time.sleep(2); # Fudge
     211            # For the dummy HCD over USB/IP case we have to bind the device to the USB/IP server
     212            self._execLocallyOrThroughTxs('/usr/bin/sh', ('-c', '/usr/bin/usbip bind -b 3-1'));
     213
     214        return fRc;
    210215
    211216    def connectTo(self, cMsTimeout, sGadgetType, fUseTxs, sHostname, uPort = None):
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