Changeset 60493 in vbox for trunk/src/VBox/ValidationKit/tests/usb
- Timestamp:
- Apr 14, 2016 1:45:31 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/tests/usb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/usb/tdUsb1.py
r60488 r60493 295 295 if fRc is True: 296 296 reporter.log('Connect succeeded'); 297 self.oVBox.host.addUSBDeviceSource('USBIP', sGadgetHost, sGadgetHost , [], []);297 self.oVBox.host.addUSBDeviceSource('USBIP', sGadgetHost, sGadgetHost + (':%s' % oUsbGadget.getUsbIpPort()), [], []); 298 298 299 299 # Create device filter … … 341 341 if fRc is True: 342 342 reporter.log('Connect succeeded'); 343 self.oVBox.host.addUSBDeviceSource('USBIP', sGadgetHost, sGadgetHost , [], []);343 self.oVBox.host.addUSBDeviceSource('USBIP', sGadgetHost, sGadgetHost + ':' + oUsbGadget.getUsbIpPort(), [], []); 344 344 345 345 # Create device filter -
trunk/src/VBox/ValidationKit/tests/usb/usbgadget2.py
r60489 r60493 416 416 return None; 417 417 abPayload.extend(u32ToByteArray(o)); 418 elif isinstance(o, types.IntType): 419 if o < 0 or o > 0xffffffff: 420 reporter.fatal('sendMsg: uint32_t payload is out of range: %s' % (hex(o))); 421 return None; 422 abPayload.extend(u32ToByteArray(o)); 418 423 elif isinstance(o, array.array): 419 424 abPayload.extend(o); … … 627 632 if sOpcode == "ACK": 628 633 return True; 629 return (sOpcode, getSZ(abPayload, 0, sOpcode));634 return (sOpcode, getSZ(abPayload, 16, sOpcode)); 630 635 631 636 def recvAckLogged(self, sCommand, fNoDataOk = False): … … 659 664 if sOpcode == "FALSE": 660 665 return False; 661 reporter.maybeErr(self.fErr, 'recvAckLogged: %s response was %s: %s' % (sCommand, sOpcode, getSZ(abPayload, 0, sOpcode)));666 reporter.maybeErr(self.fErr, 'recvAckLogged: %s response was %s: %s' % (sCommand, sOpcode, getSZ(abPayload, 16, sOpcode))); 662 667 return None; 663 668 … … 721 726 sHostname = socket.gethostname().lower(); 722 727 cbFill = 68 - len(sHostname) - 1; 723 rc = self.sendMsg("HOWDY", ( long((1 << 16) | 0), long(0x1), long(len(sHostname)), sHostname, zeroByteArray(cbFill)));728 rc = self.sendMsg("HOWDY", ((1 << 16) | 0, 0x1, len(sHostname), sHostname, zeroByteArray(cbFill))); 724 729 if rc is True: 725 730 rc = self.recvAckLogged("HOWDY", self.fTryConnect); … … 746 751 def taskGadgetCreate(self, iGadgetType, iGadgetAccess): 747 752 """Creates a new gadget on UTS""" 748 fRc = self.sendMsg("GDGTCRT", (iGadgetType, iGadgetAccess, 0 ));753 fRc = self.sendMsg("GDGTCRT", (iGadgetType, iGadgetAccess, 0, 0)); 749 754 if fRc is True: 750 755 fRc = self.recvAckLogged("GDGTCRT"); … … 842 847 """ 843 848 return self.startTask(cMsTimeout, fIgnoreErrors, "GadgetCreate", self.taskGadgetCreate, \ 844 ( long(iGadgetType), long(iGadgetAccess)));849 (iGadgetType, iGadgetAccess)); 845 850 846 851 def syncGadgetCreate(self, iGadgetType, iGadgetAccess, cMsTimeout = 30000, fIgnoreErrors = False): … … 857 862 """ 858 863 return self.startTask(cMsTimeout, fIgnoreErrors, "GadgetDestroy", self.taskGadgetDestroy, \ 859 ( long(iGadgetId), ));864 (iGadgetId, )); 860 865 861 866 def syncGadgetDestroy(self, iGadgetId, cMsTimeout = 30000, fIgnoreErrors = False): … … 1327 1332 fRc = False; 1328 1333 if sImpersonation == g_ksGadgetImpersonationTest: 1329 fRc = self.oUtsSession.syncGadgetCreate(g_kiGadgetTypeTest );1334 fRc = self.oUtsSession.syncGadgetCreate(g_kiGadgetTypeTest, g_kiGadgetAccessUsbIp); 1330 1335 else: 1331 1336 reporter.log('Invalid or unsupported impersonation'); … … 1358 1363 print 'connect: waitForTask -> %s, result %s' % (fDone, self.oUtsSession.getResult()); 1359 1364 if fDone is True and self.oUtsSession.isSuccess(): 1360 fRc = True; 1365 # Parse the reply. 1366 _, _, abPayload = self.oUtsSession.getLastReply(); 1367 1368 if getU32(abPayload, 20) is g_kiGadgetAccessUsbIp: 1369 fRc = True; 1370 self.iUsbIpPort = getU32(abPayload, 24); 1371 else: 1372 reporter.log('Gadget doesn\'t support access over USB/IP despite being requested'); 1373 fRc = False; 1361 1374 else: 1362 1375 fRc = False; … … 1376 1389 1377 1390 self._clearImpersonation(); 1378 self._cleanupGadget();1379 1391 if self.oUtsSession is not None: 1380 1392 fRc = self.oUtsSession.syncDisconnect();
Note:
See TracChangeset
for help on using the changeset viewer.