VirtualBox

Ignore:
Timestamp:
Jun 11, 2019 11:58:28 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131247
Message:

ValKit: New pylint version - cleanup in progress.

Location:
trunk/src/VBox/ValidationKit/testdriver
Files:
11 edited

Legend:

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

    r79067 r79087  
    11# -*- coding: utf-8 -*-
    22# $Id$
    3 # pylint: disable=C0302
     3# pylint: disable=too-many-lines
    44
    55"""
     
    222222        fRc = False;
    223223    else:
    224         fRc = __processSudoKill(uPid, signal.SIGUSR1, fSudo); # pylint: disable=E1101
     224        fRc = __processSudoKill(uPid, signal.SIGUSR1, fSudo); # pylint: disable=no-member
    225225    return fRc;
    226226
     
    246246        fRc = winbase.processKill(uPid);
    247247    else:
    248         fRc = __processSudoKill(uPid, signal.SIGKILL, fSudo); # pylint: disable=E1101
     248        fRc = __processSudoKill(uPid, signal.SIGKILL, fSudo); # pylint: disable=no-member
    249249    return fRc;
    250250
     
    307307
    308308            # ps fails with non-zero exit code if the pid wasn't found.
    309             if iExitCode is not 0:
     309            if iExitCode != 0:
    310310                return False;
    311311            if sCurName is None:
     
    380380    def __del__(self):
    381381        """In case we need it later on."""
    382         pass;
     382        pass;   # pylint: disable=unnecessary-pass
    383383
    384384    def toString(self):
     
    395395    def lockTask(self):
    396396        """ Wrapper around oCv.acquire(). """
    397         if True is True: # change to False for debugging deadlocks.
     397        if True is True: # change to False for debugging deadlocks. # pylint: disable=comparison-with-itself
    398398            self.oCv.acquire();
    399399        else:
     
    600600                    try:
    601601                        (uPid, uStatus) = os.waitpid(self.hWin, 0);
    602                         if uPid == self.hWin or uPid == self.uPid:
     602                        if uPid in (self.hWin, self.uPid,):
    603603                            self.hWin.Detach(); # waitpid closed it, so it's now invalid.
    604604                            self.hWin = None;
     
    613613            else:
    614614                try:
    615                     (uPid, uStatus) = os.waitpid(self.uPid, os.WNOHANG); # pylint: disable=E1101
     615                    (uPid, uStatus) = os.waitpid(self.uPid, os.WNOHANG); # pylint: disable=no-member
    616616                except:
    617617                    reporter.logXcpt();
     
    773773
    774774
    775 class TestDriverBase(object): # pylint: disable=R0902
     775class TestDriverBase(object): # pylint: disable=too-many-instance-attributes
    776776    """
    777777    The base test driver.
     
    16281628
    16291629
    1630     def innerMain(self, asArgs = None): # pylint: disable=R0915
     1630    def innerMain(self, asArgs = None): # pylint: disable=too-many-statements
    16311631        """
    16321632        Exception wrapped main() worker.
     
    17491749
    17501750# The old, deprecated name.
    1751 TestDriver = TestDriverBase; # pylint: disable=C0103
     1751TestDriver = TestDriverBase; # pylint: disable=invalid-name
    17521752
    17531753
     
    17561756#
    17571757
    1758 # pylint: disable=C0111
     1758# pylint: disable=missing-docstring
    17591759class TestDriverBaseTestCase(unittest.TestCase):
    17601760    def setUp(self):
  • trunk/src/VBox/ValidationKit/testdriver/btresolver.py

    r76553 r79087  
    11# -*- coding: utf-8 -*-
    22# $Id$
    3 # pylint: disable=C0302
     3# pylint: disable=too-many-lines
    44
    55"""
     
    548548                self.oResolverOs = BacktraceResolverOsLinux(self.sScratchDbgPath, self.sScratchPath, self.fnLog);
    549549            elif self.sTargetOs == 'darwin':
    550                 self.oResolverOs = BacktraceResolverOsDarwin(self.sScratchDbgPath, self.sScratchPath, self.fnLog); # pylint: disable=R0204
     550                self.oResolverOs = BacktraceResolverOsDarwin(self.sScratchDbgPath, self.sScratchPath, self.fnLog); # pylint: disable=redefined-variable-type
    551551            elif self.sTargetOs == 'solaris':
    552                 self.oResolverOs = BacktraceResolverOsSolaris(self.sScratchDbgPath, self.sScratchPath, self.fnLog); # pylint: disable=R0204
     552                self.oResolverOs = BacktraceResolverOsSolaris(self.sScratchDbgPath, self.sScratchPath, self.fnLog); # pylint: disable=redefined-variable-type
    553553            else:
    554554                self.log('The backtrace resolver is not supported on %s' % (self.sTargetOs,));
  • trunk/src/VBox/ValidationKit/testdriver/reporter.py

    r78973 r79087  
    11# -*- coding: utf-8 -*-
    22# $Id$
    3 # pylint: disable=C0302
     3# pylint: disable=too-many-lines
    44
    55"""
     
    677677        if     sys.version_info[0] >= 3 \
    678678           or (sys.version_info[0] == 2 and sys.version_info[1] >= 6):
    679             if self._oParsedTmUrl.scheme == 'https': # pylint: disable=E1101
     679            if self._oParsedTmUrl.scheme == 'https': # pylint: disable=no-member
    680680                self._fnTmConnect = lambda: httplib.HTTPSConnection(self._oParsedTmUrl.hostname,
    681681                                                                    timeout = self.kcSecTestManagerRequestTimeout);
     
    684684                                                                    timeout = self.kcSecTestManagerRequestTimeout);
    685685        else:
    686             if self._oParsedTmUrl.scheme == 'https': # pylint: disable=E1101
     686            if self._oParsedTmUrl.scheme == 'https': # pylint: disable=no-member
    687687                self._fnTmConnect = lambda: httplib.HTTPSConnection(self._oParsedTmUrl.hostname);
    688688            else:
     
    704704        };
    705705        self._sTmServerPath = '/%s/testboxdisp.py?%s' \
    706                             % ( self._oParsedTmUrl.path.strip('/'), # pylint: disable=E1101
     706                            % ( self._oParsedTmUrl.path.strip('/'), # pylint: disable=no-member
    707707                                self._fnUrlEncode(dParams), );
    708708
     
    16871687
    16881688    cThread = 0;
    1689     for idThread, oStack in sys._current_frames().items(): # >=2.5, a bit ugly - pylint: disable=W0212
     1689    for idThread, oStack in sys._current_frames().items(): # >=2.5, a bit ugly - pylint: disable=protected-access
    16901690        try:
    16911691            if cThread > 0:
  • trunk/src/VBox/ValidationKit/testdriver/tst-txsclient.py

    r76553 r79087  
    6969    return 'FAILED';
    7070
    71 def main(asArgs): # pylint: disable=C0111,R0914,R0915
     71def main(asArgs): # pylint: disable=missing-docstring,too-many-locals,too-many-statements
    7272    cMsTimeout      = long(30*1000);
    7373    sAddress        = 'localhost';
  • trunk/src/VBox/ValidationKit/testdriver/txsclient.py

    r76553 r79087  
    11# -*- coding: utf-8 -*-
    22# $Id$
    3 # pylint: disable=C0302
     3# pylint: disable=too-many-lines
    44
    55"""
     
    719719    #
    720720    # Process task
    721     # pylint: disable=C0111
     721    # pylint: disable=missing-docstring
    722722    #
    723723
    724     def taskExecEx(self, sExecName, fFlags, asArgs, asAddEnv, oStdIn, oStdOut, oStdErr, oTestPipe, sAsUser): # pylint: disable=R0913,R0914,R0915,C0301
     724    def taskExecEx(self, sExecName, fFlags, asArgs, asAddEnv, oStdIn, oStdOut, oStdErr, oTestPipe, sAsUser): # pylint: disable=too-many-arguments,too-many-locals,too-many-statements,line-too-long
    725725        # Construct the payload.
    726726        aoPayload = [long(fFlags), '%s' % (sExecName), long(len(asArgs))];
     
    918918        for o in (oStdIn, oStdOut, oStdErr, oTestPipe):
    919919            if o is not None and not utils.isString(o):
    920                 del o.uTxsClientCrc32;      # pylint: disable=E1103
     920                del o.uTxsClientCrc32;      # pylint: disable=maybe-no-member
    921921                # Make sure all files are closed
    922                 o.close();                  # pylint: disable=E1103
     922                o.close();                  # pylint: disable=maybe-no-member
    923923        reporter.log('taskExecEx: returns %s' % (rc));
    924924        return rc;
     
    10511051    def taskUploadString(self, sContent, sRemoteFile):
    10521052        # Wrap sContent in a file like class.
    1053         class InStringFile(object): # pylint: disable=R0903
     1053        class InStringFile(object): # pylint: disable=too-few-public-methods
    10541054            def __init__(self, sContent):
    10551055                self.sContent = sContent;
     
    11481148    def taskDownloadString(self, sRemoteFile, sEncoding = 'utf-8', fIgnoreEncodingErrors = True):
    11491149        # Wrap sContent in a file like class.
    1150         class OutStringFile(object): # pylint: disable=R0903
     1150        class OutStringFile(object): # pylint: disable=too-few-public-methods
    11511151            def __init__(self):
    11521152                self.asContent = [];
     
    12321232        return rc;
    12331233
    1234     # pylint: enable=C0111
     1234    # pylint: enable=missing-docstring
    12351235
    12361236
     
    13101310    #
    13111311
    1312     def asyncExecEx(self, sExecName, asArgs = (), asAddEnv = (), # pylint: disable=R0913
     1312    def asyncExecEx(self, sExecName, asArgs = (), asAddEnv = (), # pylint: disable=too-many-arguments
    13131313                    oStdIn = None, oStdOut = None, oStdErr = None, oTestPipe = None,
    13141314                    sAsUser = "", cMsTimeout = 3600000, fIgnoreErrors = False):
     
    13391339                               oStdOut, oStdErr, oTestPipe, sAsUser));
    13401340
    1341     def syncExecEx(self, sExecName, asArgs = (), asAddEnv = (), # pylint: disable=R0913
     1341    def syncExecEx(self, sExecName, asArgs = (), asAddEnv = (), # pylint: disable=too-many-arguments
    13421342                   oStdIn = '/dev/null', oStdOut = '/dev/null',
    13431343                   oStdErr = '/dev/null', oTestPipe = '/dev/null',
     
    18951895        oWakeupW = None;
    18961896        if hasattr(socket, 'socketpair'):
    1897             try:    (oWakeupR, oWakeupW) = socket.socketpair();         # pylint: disable=E1101
     1897            try:    (oWakeupR, oWakeupW) = socket.socketpair();         # pylint: disable=no-member
    18981898            except: reporter.logXcpt('socket.socketpair() failed');
    18991899
  • trunk/src/VBox/ValidationKit/testdriver/vbox.py

    r79056 r79087  
    11# -*- coding: utf-8 -*-
    22# $Id$
    3 # pylint: disable=C0302
     3# pylint: disable=too-many-lines
    44
    55"""
     
    6868#
    6969
    70 ComException = None;                                                            # pylint: disable=C0103
    71 __fnComExceptionGetAttr__ = None;                                               # pylint: disable=C0103
     70ComException = None;                                                            # pylint: disable=invalid-name
     71__fnComExceptionGetAttr__ = None;                                               # pylint: disable=invalid-name
    7272
    7373def __MyDefaultGetAttr(oSelf, sName):
     
    110110    exceptions and errors.
    111111    """
    112     global ComException                                                         # pylint: disable=C0103
    113     global __fnComExceptionGetAttr__                                            # pylint: disable=C0103
     112    global ComException                                                         # pylint: disable=invalid-name
     113    global __fnComExceptionGetAttr__                                            # pylint: disable=invalid-name
    114114
    115115    # Hook up our attribute getter for the exception class (ASSUMES new-style).
     
    210210
    211211    # Reverse lookup table.
    212     dDecimalToConst = {}; # pylint: disable=C0103
     212    dDecimalToConst = {}; # pylint: disable=invalid-name
    213213
    214214    def __init__(self):
     
    329329
    330330
    331 class Build(object): # pylint: disable=R0903
     331class Build(object): # pylint: disable=too-few-public-methods
    332332    """
    333333    A VirtualBox build.
     
    372372            sSearch = os.environ.get('VBOX_TD_DEV_TREE', os.path.dirname(__file__)); # Env.var. for older trees or testboxscript.
    373373            sCandidat = None;
    374             for i in range(0, 10):                                          # pylint: disable=W0612
     374            for i in range(0, 10):                                          # pylint: disable=unused-variable
    375375                sBldDir = os.path.join(sSearch, sOut);
    376376                if os.path.isdir(sBldDir):
     
    453453        self.oEventSrc  = dArgs['oEventSrc']; # Console/VirtualBox for < 3.3
    454454        self.oListener  = dArgs['oListener'];
    455         self.fPassive   = self.oListener != None;
     455        self.fPassive   = self.oListener is not None;
    456456        self.sName      = sName
    457457        self.fShutdown  = False;
     
    616616
    617617
    618     # pylint: disable=C0111,R0913,W0613
     618    # pylint: disable=missing-docstring,too-many-arguments,unused-argument
    619619    def onMousePointerShapeChange(self, fVisible, fAlpha, xHot, yHot, cx, cy, abShape):
    620620        reporter.log2('onMousePointerShapeChange/%s' % (self.sName));
     
    657657        reporter.log2('onShowWindow/%s' % (self.sName));
    658658        return None;
    659     # pylint: enable=C0111,R0913,W0613
     659    # pylint: enable=missing-docstring,too-many-arguments,unused-argument
    660660
    661661    def handleEvent(self, oEvt):
     
    698698        EventHandlerBase.__init__(self, dArgs, self.oVBox.fpApiVer, sName);
    699699
    700     # pylint: disable=C0111,W0613
     700    # pylint: disable=missing-docstring,unused-argument
    701701    def onMachineStateChange(self, sMachineId, eState):
    702702        pass;
     
    724724    def onGuestPropertyChange(self, sMachineId, sName, sValue, sFlags):
    725725        pass;
    726     # pylint: enable=C0111,W0613
     726    # pylint: enable=missing-docstring,unused-argument
    727727
    728728    def handleEvent(self, oEvt):
     
    763763        ConsoleEventHandlerBase.__init__(self, dArgs);
    764764
    765     def onMachineStateChange(self, sMachineId, eState):                         # pylint: disable=W0613
     765    def onMachineStateChange(self, sMachineId, eState):                         # pylint: disable=unused-argument
    766766        """ Just interrupt the wait loop here so it can check again. """
    767767        _ = sMachineId; _ = eState;
     
    782782
    783783
    784 class TestDriver(base.TestDriver):                                              # pylint: disable=R0902
     784class TestDriver(base.TestDriver):                                              # pylint: disable=too-many-instance-attributes
    785785    """
    786786    This is the VirtualBox test driver.
     
    846846
    847847        # Try dev build first since that's where I'll be using it first...
    848         if True is True:
     848        if True is True: # pylint: disable=comparison-with-itself
    849849            try:
    850850                self.oBuild = Build(self, None);
     
    10081008        return self.fImportedVBoxApi;
    10091009
    1010     def _startVBoxSVC(self): # pylint: disable=R0915
     1010    def _startVBoxSVC(self): # pylint: disable=too-many-statements
    10111011        """ Starts VBoxSVC. """
    10121012        assert(self.oVBoxSvcProcess is None);
     
    10581058                sWinDbg = 'c:\\Program Files\\Debugging Tools for Windows\\windbg.exe';
    10591059                if not os.path.isfile(sWinDbg): sWinDbg = 'c:\\Program Files\\Debugging Tools for Windows (x64)\\windbg.exe';
    1060                 if not os.path.isfile(sWinDbg): sWinDbg = 'c:\\Programme\\Debugging Tools for Windows\\windbg.exe'; # Localization rulez!  pylint: disable=C0301
     1060                if not os.path.isfile(sWinDbg): sWinDbg = 'c:\\Programme\\Debugging Tools for Windows\\windbg.exe'; # Localization rulez!  pylint: disable=line-too-long
    10611061                if not os.path.isfile(sWinDbg): sWinDbg = 'c:\\Programme\\Debugging Tools for Windows (x64)\\windbg.exe';
    10621062                if not os.path.isfile(sWinDbg): sWinDbg = 'windbg'; # WinDbg must be in the path; better than nothing.
     
    10871087                self.oVBoxSvcProcess = base.Process.spawn(sVBoxSVC, sVBoxSVC, '--auto-shutdown'); # SIGUSR1 requirement.
    10881088                try: # Try make sure we get the SIGINT and not VBoxSVC.
    1089                     os.setpgid(self.oVBoxSvcProcess.getPid(), 0); # pylint: disable=E1101
    1090                     os.setpgid(0, 0);                             # pylint: disable=E1101
     1089                    os.setpgid(self.oVBoxSvcProcess.getPid(), 0); # pylint: disable=no-member
     1090                    os.setpgid(0, 0);                             # pylint: disable=no-member
    10911091                except:
    10921092                    reporter.logXcpt();
     
    11291129        # Fudge and pid file.
    11301130        #
    1131         if self.oVBoxSvcProcess != None and not self.oVBoxSvcProcess.wait(cMsFudge):
     1131        if self.oVBoxSvcProcess is not None and not self.oVBoxSvcProcess.wait(cMsFudge):
    11321132            if fWritePidFile:
    11331133                iPid = self.oVBoxSvcProcess.getPid();
     
    11491149            except: pass;
    11501150
    1151         return self.oVBoxSvcProcess != None;
     1151        return self.oVBoxSvcProcess is not None;
    11521152
    11531153
     
    12611261
    12621262        try:
    1263             from vboxapi import VirtualBoxManager # pylint: disable=import-error
     1263            from vboxapi import VirtualBoxManager; # pylint: disable=import-error
    12641264        except:
    12651265            reporter.logXcpt('Error importing vboxapi');
     
    12701270            # pylint: disable=import-error
    12711271            if self.sHost == 'win':
    1272                 from pythoncom import com_error as NativeComExceptionClass  # pylint: disable=E0611
     1272                from pythoncom import com_error as NativeComExceptionClass  # pylint: disable=no-name-in-module
    12731273                import winerror                 as NativeComErrorClass
    12741274            else:
     
    13921392            if oXcpt is None: oXcpt = sys.exc_info()[1];
    13931393            if sys.platform == 'win32':
    1394                 from pythoncom import com_error as NativeComExceptionClass  # pylint: disable=import-error,E0611
     1394                from pythoncom import com_error as NativeComExceptionClass  # pylint: disable=import-error,no-name-in-module
    13951395            else:
    13961396                from xpcom import Exception     as NativeComExceptionClass  # pylint: disable=import-error
     
    14001400            """ See vboxapi. """
    14011401            hrXcpt = oSelf.xcptGetResult(oXcpt);
    1402             return hrXcpt == hrStatus or hrXcpt == hrStatus - 0x100000000;
     1402            return hrXcpt == hrStatus or hrXcpt == hrStatus - 0x100000000;  # pylint: disable=consider-using-in
    14031403
    14041404        def _xcptToString(oSelf, oXcpt):
     
    14781478                # Also, it keeps a number of internal objects and interfaces around to do its job, so shutting
    14791479                # it down before we go looking for dangling interfaces is more or less required.
    1480                 from xpcom import _xpcom as _xpcom;             # pylint: disable=import-error
     1480                from xpcom import _xpcom as _xpcom;             # pylint: disable=import-error,useless-import-alias
    14811481                hrc   = _xpcom.DeinitCOM();
    1482                 cIfs  = _xpcom._GetInterfaceCount();            # pylint: disable=W0212
    1483                 cObjs = _xpcom._GetGatewayCount();              # pylint: disable=W0212
     1482                cIfs  = _xpcom._GetInterfaceCount();            # pylint: disable=protected-access
     1483                cObjs = _xpcom._GetGatewayCount();              # pylint: disable=protected-access
    14841484
    14851485                if cObjs == 0 and cIfs == 0:
     
    14891489                                 % (cObjs, cIfs, hrc));
    14901490                    if hasattr(_xpcom, '_DumpInterfaces'):
    1491                         try:    _xpcom._DumpInterfaces();       # pylint: disable=W0212
     1491                        try:    _xpcom._DumpInterfaces();       # pylint: disable=protected-access
    14921492                        except: reporter.logXcpt('_teardownVBoxApi: _DumpInterfaces failed');
    14931493
     
    16661666        return rc;
    16671667
    1668     def parseOption(self, asArgs, iArg): # pylint: disable=R0915
     1668    def parseOption(self, asArgs, iArg): # pylint: disable=too-many-statements
    16691669        if asArgs[iArg] == '--vbox-session-type':
    16701670            iArg += 1;
     
    19451945        return None;
    19461946
    1947     def _logVmInfoUnsafe(self, oVM):                                            # pylint: disable=R0915,R0912
     1947    def _logVmInfoUnsafe(self, oVM):                                            # pylint: disable=too-many-statements,too-many-branches
    19481948        """
    19491949        Internal worker for logVmInfo that is wrapped in try/except.
     
    21532153        return True;
    21542154
    2155     def logVmInfo(self, oVM):                                                   # pylint: disable=R0915,R0912
     2155    def logVmInfo(self, oVM):                                                   # pylint: disable=too-many-statements,too-many-branches
    21562156        """
    21572157        Logs VM configuration details.
     
    21942194                    reporter.logXcpt();
    21952195                else:
    2196                     if sIdOrDesc == sId or sIdOrDesc == sDesc:
     2196                    if sIdOrDesc in (sId, sDesc,):
    21972197                        sIdOrDesc = sId;
    21982198                        break;
     
    22392239                    return oVM;
    22402240                except:
     2241                    reporter.logXcpt();
    22412242                    raise;
    22422243            except:
     
    22592260        return None;
    22602261
    2261     # pylint: disable=R0913,R0914,R0915
     2262    # pylint: disable=too-many-arguments,too-many-locals,too-many-statements
    22622263    def createTestVM(self,
    22632264                     sName,
     
    23752376        self.logVmInfo(oVM); # testing...
    23762377        return oVM;
    2377     # pylint: enable=R0913,R0914,R0915
     2378    # pylint: enable=too-many-arguments,too-many-locals,too-many-statements
    23782379
    23792380    def createTestVmWithDefaults(self,                                      # pylint: disable=too-many-arguments
     
    26092610          and sCurName != '' \
    26102611          and base.timestampMilli() - msStart < cMsTimeout \
    2611           and (   eCurState == vboxcon.SessionState_Unlocking \
    2612                or eCurState == vboxcon.SessionState_Spawning \
    2613                or eCurState == vboxcon.SessionState_Locked):
     2612          and eCurState in (vboxcon.SessionState_Unlocking, vboxcon.SessionState_Spawning, vboxcon.SessionState_Locked,):
    26142613            self.processEvents(1000);
    26152614            try:
     
    26622661        return fRc;
    26632662
    2664     def startVmEx(self, oVM, fWait = True, sType = None, sName = None, asEnv = None): # pylint: disable=R0914,R0915
     2663    def startVmEx(self, oVM, fWait = True, sType = None, sName = None, asEnv = None): # pylint: disable=too-many-locals,too-many-statements
    26652664        """
    26662665        Start the VM, returning the VM session and progress object on success.
     
    27582757                    if   self.fpApiVer < 4.3 \
    27592758                      or (self.fpApiVer == 4.3 and not hasattr(self.oVBoxMgr, 'getSessionObject')):
    2760                         oSession = self.oVBoxMgr.mgr.getSessionObject(self.oVBox);  # pylint: disable=E1101
     2759                        oSession = self.oVBoxMgr.mgr.getSessionObject(self.oVBox);  # pylint: disable=no-member
    27612760                    elif self.fpApiVer < 5.2 \
    27622761                      or (self.fpApiVer == 5.2 and hasattr(self.oVBoxMgr, 'vbox')):
    2763                         oSession = self.oVBoxMgr.getSessionObject(self.oVBox);      # pylint: disable=E1101
     2762                        oSession = self.oVBoxMgr.getSessionObject(self.oVBox);      # pylint: disable=no-member
    27642763                    else:
    2765                         oSession = self.oVBoxMgr.getSessionObject();                # pylint: disable=E1101,E1120
     2764                        oSession = self.oVBoxMgr.getSessionObject();           # pylint: disable=no-member,no-value-for-parameter
    27662765                    if self.fpApiVer < 3.3:
    27672766                        oProgress = self.oVBox.openRemoteSession(oSession, sUuid, sType, sEnv);
     
    27752774                    oSession = None;
    27762775                    if i >= 0:
    2777                         reporter.logXcpt('warning: failed to start VM "%s" ("%s") - retrying in %u secs.' % (sUuid, oVM, i));     # pylint: disable=C0301
     2776                        reporter.logXcpt('warning: failed to start VM "%s" ("%s") - retrying in %u secs.' % (sUuid, oVM, i));     # pylint: disable=line-too-long
    27782777                self.waitOnDirectSessionClose(oVM, 5000 + i * 1000);
    27792778        if fWait and oProgress is not None:
     
    28422841        return oSession;
    28432842
    2844     def terminateVmBySession(self, oSession, oProgress = None, fTakeScreenshot = None): # pylint: disable=R0915
     2843    def terminateVmBySession(self, oSession, oProgress = None, fTakeScreenshot = None): # pylint: disable=too-many-statements
    28452844        """
    28462845        Terminates the VM specified by oSession and adds the release logs to
     
    32913290        fRemoveTxs = self.addTask(oTxsSession);
    32923291
    3293         rc = fnAsync(*aArgs); # pylint: disable=W0142
     3292        rc = fnAsync(*aArgs); # pylint: disable=star-args
    32943293        if rc is True:
    32953294            rc = False;
     
    33253324        return rc;
    33263325
    3327     # pylint: disable=C0111
     3326    # pylint: disable=missing-docstring
    33283327
    33293328    def txsDisconnect(self, oSession, oTxsSession, cMsTimeout = 30000, fIgnoreErrors = False):
     
    34243423                              (sRemoteFile, sRemoteDir, self.adjustTimeoutMs(cMsTimeout), fIgnoreErrors));
    34253424
    3426     # pylint: enable=C0111
     3425    # pylint: enable=missing-docstring
    34273426
    34283427    def txsCdWait(self,
     
    36523651        return (fRc, oTxsSession);
    36533652
    3654     # pylint: disable=R0914,R0913
     3653    # pylint: disable=too-many-locals,too-many-arguments
    36553654
    36563655    def txsRunTest(self, oTxsSession, sTestName, cMsTimeout, sExecName, asArgs = (), asAddEnv = (), sAsUser = ""):
     
    38103809        return fRc;
    38113810
    3812     # pylint: enable=R0914,R0913
     3811    # pylint: enable=too-many-locals,too-many-arguments
    38133812
    38143813
  • trunk/src/VBox/ValidationKit/testdriver/vboxcon.py

    r76553 r79087  
    3636
    3737
    38 class VBoxConstantWrappingHack(object):                                         # pylint: disable=R0903
     38class VBoxConstantWrappingHack(object):                                         # pylint: disable=too-few-public-methods
    3939    """
    4040    This is a hack to avoid the self.oVBoxMgr.constants.MachineState_Running
     
    8080
    8181
    82 goHackModuleClass = VBoxConstantWrappingHack(sys.modules[__name__]);                         # pylint: disable=C0103
     82goHackModuleClass = VBoxConstantWrappingHack(sys.modules[__name__]);                         # pylint: disable=invalid-name
    8383sys.modules[__name__] = goHackModuleClass;
    8484
  • trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py

    r78385 r79087  
    837837        """
    838838
    839         import win32com.client; # pylint: disable=F0401
     839        import win32com.client; # pylint: disable=import-error
    840840        win32com.client.gencache.EnsureModule('{000C1092-0000-0000-C000-000000000046}', 1033, 1, 0);
    841841        oInstaller = win32com.client.Dispatch('WindowsInstaller.Installer',
  • trunk/src/VBox/ValidationKit/testdriver/vboxtestvms.py

    r79071 r79087  
    7171## @name Flags.
    7272## @{
    73 g_k32           = 32;                   # pylint: disable=C0103
    74 g_k64           = 64;                   # pylint: disable=C0103
    75 g_k32_64        = 96;                   # pylint: disable=C0103
     73g_k32           = 32;                   # pylint: disable=invalid-name
     74g_k64           = 64;                   # pylint: disable=invalid-name
     75g_k32_64        = 96;                   # pylint: disable=invalid-name
    7676g_kiArchMask    = 96;
    7777g_kiNoRaw       = 128;                  ##< No raw mode.
     
    8787
    8888# Table translating from VM name core to a more detailed guest info.
    89 # pylint: disable=C0301
     89# pylint: disable=line-too-long
    9090## @todo what's the difference between the first two columns again?
    9191g_aaNameToDetails = \
     
    179179
    180180
    181 # pylint: enable=C0301
     181# pylint: enable=line-too-long
    182182
    183183def _intersects(asSet1, asSet2):
     
    199199    """
    200200
    201     def __init__(self, # pylint: disable=R0913
     201    def __init__(self, # pylint: disable=too-many-arguments
    202202                 sVmName,                                   # type: str
    203203                 fGrouping = 0,                             # type: int
     
    904904    """
    905905
    906     def __init__(self, # pylint: disable=R0913
     906    def __init__(self, # pylint: disable=too-many-arguments
    907907                 sVmName,                                   # type: str
    908908                 fGrouping = 0,                             # type: int
     
    13951395
    13961396
    1397     def __init__(self, # pylint: disable=R0913
     1397    def __init__(self, # pylint: disable=too-many-arguments
    13981398                 sVmName,                                   # type: str
    13991399                 fGrouping = g_kfGrpAncient | g_kfGrpNoTxs, # type: int
     
    17031703        return True;
    17041704
    1705     def actionExecute(self, oTestDrv, fnCallback): # pylint: disable=R0914
     1705    def actionExecute(self, oTestDrv, fnCallback): # pylint: disable=too-many-locals
    17061706        """
    17071707        For base.TestDriver.actionExecute.  Calls the callback function for
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r79068 r79087  
    11# -*- coding: utf-8 -*-
    22# $Id$
    3 # pylint: disable=C0302
     3# pylint: disable=too-many-lines
    44
    55"""
     
    102102
    103103
    104 class VirtualBoxWrapper(object): # pylint: disable=R0903
     104class VirtualBoxWrapper(object): # pylint: disable=too-few-public-methods
    105105    """
    106106    Wrapper around the IVirtualBox object that adds some (hopefully) useful
     
    509509        they don't throw errors.
    510510        """
    511         if True is True:
     511        if True is True: # pylint: disable=comparison-with-itself
    512512            try:
    513513                iPct        = self.o.operationPercent;
     
    12801280        Helper that translate the adapter type into a driver name.
    12811281        """
    1282         if    eNicType == vboxcon.NetworkAdapterType_Am79C970A \
    1283            or eNicType == vboxcon.NetworkAdapterType_Am79C973:
     1282        if eNicType in (vboxcon.NetworkAdapterType_Am79C970A, vboxcon.NetworkAdapterType_Am79C973):
    12841283            sName = 'pcnet';
    1285         elif    eNicType == vboxcon.NetworkAdapterType_I82540EM \
    1286              or eNicType == vboxcon.NetworkAdapterType_I82543GC \
    1287              or eNicType == vboxcon.NetworkAdapterType_I82545EM:
     1284        elif eNicType in (vboxcon.NetworkAdapterType_I82540EM,
     1285                          vboxcon.NetworkAdapterType_I82543GC,
     1286                          vboxcon.NetworkAdapterType_I82545EM):
    12881287            sName = 'e1000';
    12891288        elif eNicType == vboxcon.NetworkAdapterType_Virtio:
     
    15621561        # Resolve missing MAC address prefix by feeding in the host IP address bytes.
    15631562        cchMacAddr = len(sMacAddr);
    1564         if cchMacAddr > 0 and cchMacAddr < 12:
     1563        if 0 < cchMacAddr < 12:
    15651564            sHostIP = netutils.getPrimaryHostIp();
    15661565            abHostIP = socket.inet_aton(sHostIP);
     
    19251924        return oHd;
    19261925
    1927     def createAndAttachHd(self, sHd, sFmt = "VDI", sController = "IDE Controller", cb = 10*1024*1024*1024, # pylint: disable=R0913
     1926    def createAndAttachHd(self, sHd, sFmt = "VDI", sController = "IDE Controller", cb = 10*1024*1024*1024, # pylint: disable=too-many-arguments
    19281927                          iPort = 0, iDevice = 0, fImmutable = True, cMsTimeout = 60000, tMediumVariant = None):
    19291928        """
     
    21152114        return True;
    21162115
    2117     def setupPreferredConfig(self):                                             # pylint: disable=R0914
     2116    def setupPreferredConfig(self):                                             # pylint: disable=too-many-locals
    21182117        """
    21192118        Configures the VM according to the preferences of the guest type.
     
    21802179            if not self.enableUsbHid(fUsbHid):          fRc = False;
    21812180            if not self.enableHpet(fHpet):              fRc = False;
    2182         if  eStorCtlType == vboxcon.StorageControllerType_PIIX3 \
    2183          or eStorCtlType == vboxcon.StorageControllerType_PIIX4 \
    2184          or eStorCtlType == vboxcon.StorageControllerType_ICH6:
     2181        if eStorCtlType in (vboxcon.StorageControllerType_PIIX3,
     2182                            vboxcon.StorageControllerType_PIIX4,
     2183                            vboxcon.StorageControllerType_ICH6,):
    21852184            if not self.setStorageControllerType(eStorCtlType, "IDE Controller"):
    21862185                fRc = False;
     
    21902189        return fRc;
    21912190
    2192     def addUsbDeviceFilter(self, sName, sVendorId = None, sProductId = None, sRevision = None, # pylint: disable=R0913
     2191    def addUsbDeviceFilter(self, sName, sVendorId = None, sProductId = None, sRevision = None, # pylint: disable=too-many-arguments
    21932192                           sManufacturer = None, sProduct = None, sSerialNumber = None,
    21942193                           sPort = None, sRemote = None):
     
    30333032        """ Class for looking for IPv4 address changes on interface 0."""
    30343033        def __init__(self, dArgs):
    3035             vbox.VirtualBoxEventHandlerBase.__init__(self, dArgs);              # pylint: disable=W0233
     3034            vbox.VirtualBoxEventHandlerBase.__init__(self, dArgs);
    30363035            self.oParentTask = dArgs['oParentTask'];
    30373036            self.sMachineId  = dArgs['sMachineId'];
     
    30443043                oParentTask = self.oParentTask;
    30453044                if oParentTask:
    3046                     oParentTask._setIp(sValue);                                # pylint: disable=W0212
     3045                    oParentTask._setIp(sValue);                                # pylint: disable=protected-access
    30473046
    30483047
  • trunk/src/VBox/ValidationKit/testdriver/winbase.py

    r76553 r79087  
    143143    if fRc is True:
    144144        try:
    145             from win32com.client import GetObject; # pylint: disable=F0401
     145            from win32com.client import GetObject; # pylint: disable=import-error
    146146            oWmi = GetObject('winmgmts:');
    147147            aoProcesses = oWmi.InstancesOf('Win32_Process');
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette