- Timestamp:
- Apr 18, 2016 5:35:25 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r60533 r60549 2010 2010 return fRc; 2011 2011 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): 2013 2015 """ 2014 2016 Creates a USB device filter and inserts it into the VM. … … 2019 2021 2020 2022 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); 2027 2043 except: 2028 2044 reporter.errorXcpt('insertDeviceFilter(%s) failed on "%s"' \ -
trunk/src/VBox/ValidationKit/tests/usb/tdUsb1.py
r60522 r60549 315 315 self.oVBox.host.addUSBDeviceSource('USBIP', sGadgetHost, sGadgetHost + (':%s' % oUsbGadget.getUsbIpPort()), [], []); 316 316 317 # Create device filter318 fRc = o Session.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); 319 319 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)); 321 322 if fRc is True: 322 323 323 324 # Wait a moment to let the USB device appear 324 self.sleep( 10);325 self.sleep(3); 325 326 326 327 tupCmdLine = ('UsbTest', );
Note:
See TracChangeset
for help on using the changeset viewer.