VirtualBox

Changeset 60549 in vbox for trunk


Ignore:
Timestamp:
Apr 18, 2016 5:35:25 PM (9 years ago)
Author:
vboxsync
Message:

ValidationKit/usb: Fixes for the USB testcase and enhance addUsbDeviceFilter

Location:
trunk/src/VBox/ValidationKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r60533 r60549  
    20102010        return fRc;
    20112011
    2012     def addUsbDeviceFilter(self, sName, sVendorId, sProductId):
     2012    def addUsbDeviceFilter(self, sName, sVendorId = None, sProductId = None, sRevision = None, \
     2013                           sManufacturer = None, sProduct = None, sSerialNumber = None, \
     2014                           sPort = None, sRemote = None):
    20132015        """
    20142016        Creates a USB device filter and inserts it into the VM.
     
    20192021
    20202022        try:
    2021             usbDevFilter = self.o.machine.USBDeviceFilters.createDeviceFilter(sName);
    2022             usbDevFilter.active = True;
    2023             usbDevFilter.vendorId = sVendorId;
    2024             usbDevFilter.productId = sProductId;
    2025             try:
    2026                 self.o.machine.USBDeviceFilters.insertDeviceFilter(0, usbDevFilter);
     2023            oUsbDevFilter = self.o.machine.USBDeviceFilters.createDeviceFilter(sName);
     2024            oUsbDevFilter.active = True;
     2025            if sVendorId is not None:
     2026                oUsbDevFilter.vendorId = sVendorId;
     2027            if sProductId is not None:
     2028                oUsbDevFilter.productId = sProductId;
     2029            if sRevision is not None:
     2030                oUsbDevFilter.revision = sRevision;
     2031            if sManufacturer is not None:
     2032                oUsbDevFilter.manufacturer = sManufacturer;
     2033            if sProduct is not None:
     2034                oUsbDevFilter.product = sProduct;
     2035            if sSerialNumber is not None:
     2036                oUsbDevFilter.serialnumber = sSerialNumber;
     2037            if sPort is not None:
     2038                oUsbDevFilter.port = sPort;
     2039            if sRemote is not None:
     2040                oUsbDevFilter.remote = sRemote;
     2041            try:
     2042                self.o.machine.USBDeviceFilters.insertDeviceFilter(0, oUsbDevFilter);
    20272043            except:
    20282044                reporter.errorXcpt('insertDeviceFilter(%s) failed on "%s"' \
  • trunk/src/VBox/ValidationKit/tests/usb/tdUsb1.py

    r60522 r60549  
    315315            self.oVBox.host.addUSBDeviceSource('USBIP', sGadgetHost, sGadgetHost + (':%s' % oUsbGadget.getUsbIpPort()), [], []);
    316316
    317             # Create device filter
    318             fRc = oSession.addUsbDeviceFilter('Compliance device', '0525', 'a4a0');
     317            # Create test device gadget and a filter to attach the device automatically.
     318            fRc = oUsbGadget.impersonate(usbgadget2.g_ksGadgetImpersonationTest);
    319319            if fRc is True:
    320                 fRc = oUsbGadget.impersonate(usbgadget2.g_ksGadgetImpersonationTest);
     320                iBusId, _ = oUsbGadget.getGadgetBusAndDevId();
     321                fRc = oSession.addUsbDeviceFilter('Compliance device', sVendorId = '0525', sProductId = 'a4a0', sPort = str(iBusId));
    321322                if fRc is True:
    322323
    323324                    # Wait a moment to let the USB device appear
    324                     self.sleep(10);
     325                    self.sleep(3);
    325326
    326327                    tupCmdLine = ('UsbTest', );
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