VirtualBox

Ignore:
Timestamp:
Mar 7, 2017 10:30:26 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113789
Message:

ValidationKit/tests: pylint 2.0.0 fixes.

Location:
trunk/src/VBox/ValidationKit/tests/storage
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py

    r65747 r65963  
    101101        if self.oTxsSession is not None:
    102102            return self.oTxsSession.syncIsFile(sFile);
    103         else:
    104             return os.path.isfile(sFile);
     103        return os.path.isfile(sFile);
    105104
    106105    def _getBinaryPath(self, sBinary):
  • trunk/src/VBox/ValidationKit/tests/storage/storagecfg.py

    r65746 r65963  
    291291            fRc = oExec.execBinaryNoStdOut('sfdisk', ('--no-reread', '--wipe', 'always', '-q', '-f', sDiskPath), sFdiskScript);
    292292            if fRc:
    293                 if sDiskPath.find('nvme') is not -1:
     293                if sDiskPath.find('nvme') != -1:
    294294                    sBlkDev = sDiskPath + 'p1';
    295295                else:
  • trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py

    r65731 r65963  
    228228                        # Extract the value
    229229                        idxValue = sLine.rfind('=');
    230                         if idxValue is -1:
     230                        if idxValue == -1:
    231231                            raise Exception('IozoneTest: Invalid state');
    232232
     
    243243
    244244                        for sNeedle, sTestVal in self.lstTests:
    245                             if sLine.rfind(sNeedle) is not -1:
     245                            if sLine.rfind(sNeedle) != -1:
    246246                                reporter.testValue(sTestVal, sLine[idxValue:idxValueEnd],
    247247                                                   constants.valueunit.g_asNames[constants.valueunit.KILOBYTES_PER_SEC]);
     
    281281        # Get the first non blacklisted test.
    282282        asTestCfg = self.getCurrentTestCfg();
    283         while len(asTestCfg) > 0 and self.isTestCfgBlacklisted(asTestCfg):
     283        while asTestCfg and self.isTestCfgBlacklisted(asTestCfg):
    284284            asTestCfg = self.advanceTestCfg();
    285285
     
    305305        if fnTestFmt is not None:
    306306            return fnTestFmt(oCfg);
    307         else:
    308             return oCfg;
     307        return oCfg;
    309308
    310309    def isTestCfgBlacklisted(self, asTestCfg):
     
    375374
    376375        asTestCfg = self.advanceTestCfg();
    377         while len(asTestCfg) > 0 and self.isTestCfgBlacklisted(asTestCfg):
     376        while asTestCfg and self.isTestCfgBlacklisted(asTestCfg):
    378377            asTestCfg = self.advanceTestCfg();
    379378
     
    381380        # categories.
    382381        reporter.testDone(fSkippedLast);
    383         if len(asTestCfg) > 0:
     382        if asTestCfg:
    384383            idxSame = 0;
    385384            while asTestCfgCur[idxSame] == asTestCfg[idxSame]:
     
    832831            if fHardDisk:
    833832                return ('ahci', False);
    834             else:
    835                 return ('ahci', True);
    836         elif eStorageCtrl == vboxcon.StorageControllerType_PIIX4:
     833            return ('ahci', True);
     834        if eStorageCtrl == vboxcon.StorageControllerType_PIIX4:
    837835            return ('piix3ide', False);
    838         elif eStorageCtrl == vboxcon.StorageControllerType_LsiLogicSas:
     836        if eStorageCtrl == vboxcon.StorageControllerType_LsiLogicSas:
    839837            return ('lsilogicsas', True);
    840         elif eStorageCtrl == vboxcon.StorageControllerType_LsiLogic:
     838        if eStorageCtrl == vboxcon.StorageControllerType_LsiLogic:
    841839            return ('lsilogicscsi', True);
    842         elif eStorageCtrl == vboxcon.StorageControllerType_BusLogic:
     840        if eStorageCtrl == vboxcon.StorageControllerType_BusLogic:
    843841            return ('buslogic', True);
    844         elif eStorageCtrl == vboxcon.StorageControllerType_NVMe:
     842        if eStorageCtrl == vboxcon.StorageControllerType_NVMe:
    845843            return ('nvme', False);
    846844
     
    854852        # Check whether the disk variant is supported by the selected format.
    855853        asVariants = self.getDiskFormatVariantsForTesting(asTestCfg[self.kiDiskFmt], [ asTestCfg[self.kiDiskVar] ]);
    856         if len(asVariants) == 0:
     854        if not asVariants:
    857855            return False;
    858856
    859857        # For iSCSI check whether we have targets configured.
    860         if asTestCfg[self.kiDiskFmt] == 'iSCSI' and len(self.asIscsiTargets) == 0:
     858        if asTestCfg[self.kiDiskFmt] == 'iSCSI' and not self.asIscsiTargets:
    861859            return False;
    862860
     
    879877        if cCpus == 1:
    880878            return '1 cpu';
    881         else:
    882             return '%u cpus' % (cCpus);
     879        return '%u cpus' % (cCpus);
    883880
    884881    def fnFormatVirtMode(self, sVirtMode):
     
    11721169        fRc = True;
    11731170        asTestCfg = oTstCfgMgr.getCurrentTestCfg();
    1174         while len(asTestCfg) > 0:
     1171        while asTestCfg:
    11751172            fRc = self.testOneCfg(asTestCfg[self.kiVmName], self.getStorageCtrlFromName(asTestCfg[self.kiStorageCtrl]), \
    11761173                                  asTestCfg[self.kiHostIoCache], asTestCfg[self.kiDiskFmt], asTestCfg[self.kiDiskVar],
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