VirtualBox

Changeset 60567 in vbox for trunk


Ignore:
Timestamp:
Apr 19, 2016 11:15:23 AM (9 years ago)
Author:
vboxsync
Message:

ValidationKit/usb: Move usbgadget2 to usbgadget and rmeove the old version, smaller fixes for pylint

Location:
trunk/src/VBox/ValidationKit/tests/usb
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/usb/Makefile.kmk

    r60489 r60567  
    3434ValidationKitTestsUsb_EXEC_SOURCES := \
    3535        $(PATH_SUB_CURRENT)/tdUsb1.py \
    36         $(PATH_SUB_CURRENT)/usbgadget.py
     36        $(PATH_SUB_CURRENT)/usbgadget.py \
     37        $(PATH_SUB_CURRENT)/tst-utsgadget.py
    3738
    3839VBOX_VALIDATIONKIT_PYTHON_SOURCES += $(ValidationKitTestsUsb_EXEC_SOURCES)
  • trunk/src/VBox/ValidationKit/tests/usb/tdUsb1.py

    r60562 r60567  
    4949
    5050# USB gadget control import
    51 import usbgadget2;
     51import usbgadget;
    5252
    5353class tdUsbBenchmark(vbox.TestDriver):                                      # pylint: disable=R0902
     
    308308        sGadgetHost, uGadgetPort = self.getGadgetParams(self.sHostname, sSpeed);
    309309
    310         oUsbGadget = usbgadget2.UsbGadget();
     310        oUsbGadget = usbgadget.UsbGadget();
    311311        reporter.log('Connecting to UTS: ' + sGadgetHost);
    312312        fRc = oUsbGadget.connectTo(30 * 1000, sGadgetHost, uPort = uGadgetPort);
     
    316316
    317317            # Create test device gadget and a filter to attach the device automatically.
    318             fRc = oUsbGadget.impersonate(usbgadget2.g_ksGadgetImpersonationTest);
     318            fRc = oUsbGadget.impersonate(usbgadget.g_ksGadgetImpersonationTest);
    319319            if fRc is True:
    320320                iBusId, _ = oUsbGadget.getGadgetBusAndDevId();
     
    356356        sGadgetHost, uGadgetPort = self.getGadgetParams(self.sHostname, sSpeed);
    357357
    358         oUsbGadget = usbgadget2.UsbGadget();
     358        oUsbGadget = usbgadget.UsbGadget();
    359359        reporter.log('Connecting to UTS: ' + sGadgetHost);
    360360        fRc = oUsbGadget.connectTo(30 * 1000, sGadgetHost,  uPort = uGadgetPort);
     
    363363
    364364            # Create test device gadget and a filter to attach the device automatically.
    365             fRc = oUsbGadget.impersonate(usbgadget2.g_ksGadgetImpersonationTest);
     365            fRc = oUsbGadget.impersonate(usbgadget.g_ksGadgetImpersonationTest);
    366366            if fRc is True:
    367367                iBusId, _ = oUsbGadget.getGadgetBusAndDevId();
  • trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py

    r60566 r60567  
    166166                         (u16 / 256) % 256) );
    167167
    168 def u8ToByteArray(u8):
     168def u8ToByteArray(uint8):
    169169    """Encodes the u8 value as a little endian byte (B) array."""
    170     return array.array('B', (u8 % 256));
     170    return array.array('B', (uint8 % 256));
    171171
    172172def zeroByteArray(cb):
     
    174174    abArray = array.array('B', (0, ));
    175175    cb = cb - 1;
    176     for i in range(cb):
     176    for i in range(cb): # pylint: disable=W0612
    177177        abArray.append(0);
    178178    return abArray;
     
    609609        so the client can inspect it later on.
    610610        """
    611         if cMsTimeout == None:
     611        if cMsTimeout is None:
    612612            cMsTimeout = self.getMsLeft(500);
    613613        cbMsg, sOpcode, abPayload = self.oTransport.recvMsg(cMsTimeout, fNoDataOk);
     
    664664        if sOpcode == "FALSE":
    665665            return False;
    666         reporter.maybeErr(self.fErr, 'recvAckLogged: %s response was %s: %s' % (sCommand, sOpcode, getSZ(abPayload, 16, sOpcode)));
     666        reporter.maybeErr(self.fErr, 'recvAckLogged: %s response was %s: %s' % \
     667                                     (sCommand, sOpcode, getSZ(abPayload, 16, sOpcode)));
    667668        return None;
    668669
     
    671672        Wrapper for TransportBase.sendMsg that inserts the correct timeout.
    672673        """
    673         if cMsTimeout == None:
     674        if cMsTimeout is None:
    674675            cMsTimeout = self.getMsLeft(500);
    675676        return self.oTransport.sendMsg(sOpcode, cMsTimeout, aoPayload);
     
    10371038                    reporter.fatalXcpt('socket.select() on connect failed');
    10381039
     1040            # pylint: disable=R0916
    10391041            if rc is True:
    10401042                pass;
     
    10501052                    reporter.fatalXcpt('socket.connect((%s,%s)) failed; iRc=%s' % (self.sHostname, self.uPort, iRc));
    10511053            reporter.log2('TransportTcp::connect: rc=%s iRc=%s' % (rc, iRc));
     1054            # pylint: enable=R0916
    10521055        except:
    10531056            reporter.fatalXcpt('socket.connect((%s,%s)) failed' % (self.sHostname, self.uPort));
     
    13721375        fRc = True;
    13731376
     1377        # @todo
     1378        if fUsbIpSupport is False:
     1379            return False;
     1380
    13741381        reporter.log2('openTcpSession(%s, %s, %s, %s)' % \
    13751382                      (cMsTimeout, sHostname, uPort, cMsIdleFudge));
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