Changeset 97673 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Nov 24, 2022 11:46:15 AM (2 years ago)
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py
r96412 r97673 650 650 else: 651 651 try: 652 oOut = open(sOutFile, 'w'); # pylint: disable=consider-using-with 652 oOut = open(sOutFile, 'w'); # pylint: disable=consider-using-with,unspecified-encoding 653 653 except Exception as oXcpt: 654 654 print('error! Failed open "%s" for writing: %s' % (sOutFile, oXcpt,)); -
trunk/src/VBox/ValidationKit/common/utils.py
r97672 r97673 224 224 try: 225 225 # try /etc/lsb-release first to distinguish between Debian and Ubuntu 226 with open('/etc/lsb-release') as oFile: 226 with open('/etc/lsb-release') as oFile: # pylint: disable=unspecified-encoding 227 227 for sLine in oFile: 228 228 oMatch = re.search(r'(?:DISTRIB_DESCRIPTION\s*=)\s*"*(.*)"', sLine); … … 245 245 if os.path.isfile(sFile): 246 246 try: 247 with open(sFile) as oFile: 247 with open(sFile) as oFile: # pylint: disable=unspecified-encoding 248 248 sLine = oFile.readline(); 249 249 except: … … 258 258 if os.path.isfile('/etc/release'): 259 259 try: 260 with open('/etc/release') as oFile: 260 with open('/etc/release') as oFile: # pylint: disable=unspecified-encoding 261 261 sLast = oFile.readlines()[-1]; 262 262 sLast = sLast.strip(); … … 387 387 uPythonVer = (sys.version_info[0] << 16) | (sys.version_info[1] & 0xffff); 388 388 if uPythonVer >= ((3 << 16) | 4): 389 oFile = open(sFile, sMode); # pylint: disable=consider-using-with 389 oFile = open(sFile, sMode); # pylint: disable=consider-using-with,unspecified-encoding 390 390 else: 391 391 try: … … 397 397 offComma = sMode.find(','); 398 398 if offComma < 0: 399 return open(sFile, sMode + 'N'); # pylint: disable=consider-using-with 400 return open(sFile, # pylint: disable=consider-using-with, bad-open-mode399 return open(sFile, sMode + 'N'); # pylint: disable=consider-using-with,unspecified-encoding 400 return open(sFile, # pylint: disable=consider-using-with,unspecified-encoding,bad-open-mode 401 401 sMode[:offComma] + 'N' + sMode[offComma:]); 402 402 403 403 # Just in case. 404 return open(sFile, sMode); # pylint: disable=consider-using-with 405 406 oFile = open(sFile, sMode); # pylint: disable=consider-using-with 404 return open(sFile, sMode); # pylint: disable=consider-using-with,unspecified-encoding 405 406 oFile = open(sFile, sMode); # pylint: disable=consider-using-with,unspecified-encoding 407 407 #try: 408 408 fcntl(oFile, F_SETFD, fcntl(oFile, F_GETFD) | FD_CLOEXEC); … … 464 464 oFile = os.fdopen(fdFile, sMode); 465 465 else: 466 oFile = open(sFile, sMode); # pylint: disable=consider-using-with 466 oFile = open(sFile, sMode); # pylint: disable=consider-using-with,unspecified-encoding 467 467 468 468 # Python 3.4 and later automatically creates non-inherit handles. See PEP-0446. … … 493 493 Reads the entire file. 494 494 """ 495 with open(sFile, sMode) as oFile: 495 with open(sFile, sMode) as oFile: # pylint: disable=unspecified-encoding 496 496 sRet = oFile.read(); 497 497 return sRet; … … 1020 1020 if oXcpt.winerror == winerror.ERROR_ACCESS_DENIED: 1021 1021 fRc = True; 1022 except Exception as oXcpt:1022 except: 1023 1023 pass; 1024 1024 else: … … 1381 1381 sFull = os.path.join(sDir, sEntry); 1382 1382 try: 1383 with open(sFull, 'r') as oFile: 1383 with open(sFull, 'r') as oFile: # pylint: disable=unspecified-encoding 1384 1384 sFirstLine = oFile.readline(); 1385 1385 except: … … 2487 2487 2488 2488 uCrc32 = 0; 2489 with open(sFile, 'rb') as oFile: 2489 with open(sFile, 'rb') as oFile: # pylint: disable=unspecified-encoding 2490 2490 while True: 2491 2491 oBuf = oFile.read(1024 * 1024); -
trunk/src/VBox/ValidationKit/common/webutils.py
r96407 r97673 173 173 oOpener = urllib_build_opener(); 174 174 else: 175 oOpener = urllib_build_opener(urllib_ProxyHandler(proxies = dict()));175 oOpener = urllib_build_opener(urllib_ProxyHandler(proxies = {} )); 176 176 oSrc = oOpener.open(sUrlFile); 177 177 oDst = utils.openNoInherit(sDstFile, 'wb'); -
trunk/src/VBox/ValidationKit/testboxscript/testboxcommand.py
r96407 r97673 286 286 try: 287 287 sCmdName = oResponse.getStringChecked(constants.tbresp.ALL_PARAM_RESULT); 288 except Exception as oXcpt:288 except: 289 289 oConnection.close(); 290 290 return False; -
trunk/src/VBox/ValidationKit/testboxscript/testboxconnection.py
r96407 r97673 93 93 else: 94 94 # Special case, dummy response object. 95 self._dResponse = dict();95 self._dResponse = {}; 96 96 # Done. 97 97 … … 230 230 """ 231 231 if dParams is None: 232 dParams = dict();232 dParams = {}; 233 233 dParams[constants.tbreq.ALL_PARAM_TESTBOX_ID] = self._sTestBoxId; 234 234 dParams[constants.tbreq.ALL_PARAM_TESTBOX_UUID] = self._sTestBoxUuid; -
trunk/src/VBox/ValidationKit/testboxscript/testboxtasks.py
r96407 r97673 100 100 self._lock(); 101 101 self._fRunning = False; 102 self._oCv.notifyAll(); 102 self._oCv.notifyAll(); # pylint: disable=deprecated-method 103 103 self._unlock(); 104 104 -
trunk/src/VBox/ValidationKit/testdriver/base.py
r97672 r97673 82 82 Returns the executable suffix. 83 83 """ 84 if os.name == 'nt' or os.name == 'os2':84 if os.name in ('nt', 'os2'): 85 85 return '.exe'; 86 86 return ''; … … 484 484 reporter.log2('signalTaskLocked(%s)' % (self,)); 485 485 self.fSignalled = True; 486 self.oCv.notifyAll() 486 self.oCv.notifyAll(); # pylint: disable=deprecated-method 487 487 if self.oOwner is not None: 488 488 self.oOwner.notifyAboutReadyTask(self); … … 1431 1431 self.asActions.append(asArgs[iArg]) 1432 1432 elif asArgs[iArg] in self.asSpecialActions: 1433 if self.asActions != []:1433 if self.asActions: 1434 1434 raise InvalidOption('selected special action "%s" already' % (self.asActions[0], )); 1435 1435 self.asActions = [ asArgs[iArg] ]; … … 1705 1705 raise InvalidOption('unknown option: %s' % (asArgs[iArg])) 1706 1706 iArg = iNext; 1707 except QuietInvalidOption as oXcpt:1707 except QuietInvalidOption: 1708 1708 return rtexitcode.RTEXITCODE_SYNTAX; 1709 1709 except InvalidOption as oXcpt: … … 1718 1718 return rtexitcode.RTEXITCODE_SYNTAX; 1719 1719 1720 if self.asActions == []:1720 if not self.asActions: 1721 1721 reporter.error('no action was specified'); 1722 1722 reporter.error('valid actions: %s' % (self.asNormalActions + self.asSpecialActions + ['all'])); … … 1790 1790 self.pidFileRemove(os.getpid()); 1791 1791 1792 if asActions != []and fRc is True:1792 if asActions and fRc is True: 1793 1793 reporter.error('unhandled actions: %s' % (asActions,)); 1794 1794 fRc = False; -
trunk/src/VBox/ValidationKit/testdriver/txsclient.py
r96407 r97673 485 485 self.aTaskArgs = aArgs; 486 486 self.oThread = threading.Thread(target=self.taskThread, args=(), name=('TXS-%s' % (sStatus))); 487 self.oThread.setDaemon(True); 487 self.oThread.setDaemon(True); # pylint: disable=deprecated-method 488 488 self.msStart = base.timestampMilli(); 489 489 -
trunk/src/VBox/ValidationKit/testdriver/vbox.py
r97545 r97673 558 558 self.oThread = threading.Thread(target = self.threadForPassiveMode, \ 559 559 args=(), name=('PAS-%s' % (self.sName,))); 560 self.oThread.setDaemon(True) 560 self.oThread.setDaemon(True); # pylint: disable=deprecated-method 561 561 self.oThread.start(); 562 562 return None; … … 1981 1981 """ 1982 1982 sAdpName = ''; 1983 if oNic.adapterType == vboxcon.NetworkAdapterType_Am79C970A\1984 or oNic.adapterType == vboxcon.NetworkAdapterType_Am79C973\1985 or oNic.adapterType == vboxcon.NetworkAdapterType_Am79C960:1983 if oNic.adapterType in (vboxcon.NetworkAdapterType_Am79C970A, \ 1984 vboxcon.NetworkAdapterType_Am79C973, \ 1985 vboxcon.NetworkAdapterType_Am79C960): 1986 1986 sAdpName = 'pcnet'; 1987 elif oNic.adapterType == vboxcon.NetworkAdapterType_I82540EM\1988 or oNic.adapterType == vboxcon.NetworkAdapterType_I82543GC\1989 or oNic.adapterType == vboxcon.NetworkAdapterType_I82545EM:1987 elif oNic.adapterType in (vboxcon.NetworkAdapterType_I82540EM, \ 1988 vboxcon.NetworkAdapterType_I82543GC, \ 1989 vboxcon.NetworkAdapterType_I82545EM): 1990 1990 sAdpName = 'e1000'; 1991 1991 elif oNic.adapterType == vboxcon.NetworkAdapterType_Virtio: -
trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py
r96431 r97673 266 266 sFull = self.__persistentVarCalcName(sVar); 267 267 try: 268 with open(sFull, 'w') as oFile: 268 with open(sFull, 'w') as oFile: # pylint: disable=unspecified-encoding 269 269 if sValue: 270 270 oFile.write(sValue.encode('utf-8')); … … 318 318 return None; 319 319 try: 320 with open(sFull, 'r') as oFile: 320 with open(sFull, 'r') as oFile: # pylint: disable=unspecified-encoding 321 321 sValue = oFile.read().decode('utf-8'); 322 322 except: -
trunk/src/VBox/ValidationKit/testdriver/vboxtestvms.py
r96407 r97673 1554 1554 1555 1555 for oTestVm in self.aoTestVms: 1556 if oTestVm.sVmName == sVmName or oTestVm.sVmName == sAltName:1556 if oTestVm.sVmName in (sVmName, sAltName): 1557 1557 return oTestVm; 1558 1558 return None; -
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r96407 r97673 155 155 The new instance is returned on success. None is returned on error. 156 156 """ 157 dArgsCopy = dArgs.copy() if dArgs is not None else dict();157 dArgsCopy = dArgs.copy() if dArgs is not None else {}; 158 158 dArgsCopy['oVBox'] = self; 159 159 return oSubClass.registerDerivedEventHandler(self.oVBoxMgr, self.fpApiVer, oSubClass, dArgsCopy, … … 2868 2868 return False 2869 2869 2870 with open(sFilename, 'wb') as oFile: 2870 with open(sFilename, 'wb') as oFile: # pylint: disable=unspecified-encoding 2871 2871 oFile.write(aPngData) 2872 2872 … … 3103 3103 3104 3104 # Add the base class arguments. 3105 dArgsCopy = dArgs.copy() if dArgs is not None else dict();3105 dArgsCopy = dArgs.copy() if dArgs is not None else {}; 3106 3106 dArgsCopy['oSession'] = self; 3107 3107 dArgsCopy['oConsole'] = oConsole; -
trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py
r97668 r97673 350 350 351 351 if self.oConfig.sLogFile: 352 self.oLogFile = open(self.oConfig.sLogFile, "a"); # pylint: disable=consider-using-with 352 self.oLogFile = open(self.oConfig.sLogFile, "a"); # pylint: disable=consider-using-with,unspecified-encoding 353 353 self.oLogFile.write('VirtualTestSheriff: $Revision$ \n'); 354 354 -
trunk/src/VBox/ValidationKit/testmanager/config.py
r96407 r97673 53 53 # @{ 54 54 g_ksDatabaseName = 'testmanager'; 55 g_ksDatabaseAddress = None;56 g_ksDatabasePort = None;55 g_ksDatabaseAddress = 'localhost'; 56 g_ksDatabasePort = 5432; 57 57 g_ksDatabaseUser = 'postgres'; 58 g_ksDatabasePassword = ' ';58 g_ksDatabasePassword = 'password'; 59 59 ## @} 60 60 … … 85 85 g_ksTmDownloadBaseUrlRel = 'htdocs/downloads'; 86 86 ## The root of the file area (referred to as TM_FILE_DIR in database docs). 87 g_ksFileAreaRootDir = '/ var/tmp/testmanager'87 g_ksFileAreaRootDir = '/tmp/testmanager' 88 88 ## The root of the file area with the zip files (best put on a big storage server). 89 g_ksZipFileAreaRootDir = '/ var/tmp/testmanager2'89 g_ksZipFileAreaRootDir = '/tmp/testmanager2' 90 90 ## URL prefix for trac log viewer. 91 91 g_ksTracLogUrlPrefix = 'https://linserv.de.oracle.com/vbox/log/' … … 259 259 g_ksTestBoxDispXpctLog = '/tmp/testmanager-testboxdisp-xcpt.log' 260 260 ## @} 261 -
trunk/src/VBox/ValidationKit/testmanager/core/base.py
r96407 r97673 367 367 Worker for implementing validateAndConvert(). 368 368 """ 369 dErrors = dict();369 dErrors = {}; 370 370 for sAttr in self.getDataAttributes(): 371 371 oValue = getattr(self, sAttr); … … 413 413 kasValidValues_enmAttr, and kasAllowNullAttributes. 414 414 """ 415 return self._validateAndConvertWorker(getattr(self, 'kasAllowNullAttributes', list()), oDb,415 return self._validateAndConvertWorker(getattr(self, 'kasAllowNullAttributes', []), oDb, 416 416 enmValidateFor = enmValidateFor); 417 417 … … 433 433 sPrefix = self.getHungarianPrefix(sAttr); 434 434 asValidValues = getattr(self, 'kasValidValues_' + sAttr, None); 435 fAllowNull = sAttr in getattr(self, 'kasAllowNullAttributes', list());435 fAllowNull = sAttr in getattr(self, 'kasAllowNullAttributes', []); 436 436 if fStrict: 437 437 if sPrefix == 'f': … … 1416 1416 1417 1417 # Collect the parameter names. 1418 dWanted = dict();1418 dWanted = {}; 1419 1419 for oCrit in self.aCriteria: 1420 1420 dWanted[oCrit.sVarNm] = 1; … … 1428 1428 1429 1429 # To the straining. 1430 dRet = dict();1430 dRet = {}; 1431 1431 for sKey in dParams: 1432 1432 if sKey in dWanted: -
trunk/src/VBox/ValidationKit/testmanager/core/buildblacklist.py
r96407 r97673 227 227 228 228 (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps(); 229 if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:229 if oData.tsEffective not in (tsCur, tsCurMinusOne): 230 230 self._historizeEntry(idBlacklisting, tsCurMinusOne); 231 231 self._readdEntry(uidAuthor, oData, tsCurMinusOne); -
trunk/src/VBox/ValidationKit/testmanager/core/db.py
r96407 r97673 269 269 270 270 # Object caches (used by database logic classes). 271 self.ddCaches = dict();271 self.ddCaches = {}; 272 272 273 273 def isAutoCommitting(self): … … 374 374 sBound = oCursor.mogrify(unicode(sOperation), aoArgs); 375 375 elif sOperation.find('%') < 0: 376 sBound = oCursor.mogrify(unicode(sOperation), list());376 sBound = oCursor.mogrify(unicode(sOperation), []); 377 377 else: 378 378 sBound = unicode(sOperation); … … 426 426 """ 427 427 if aoArgs is None: 428 aoArgs = list();428 aoArgs = []; 429 429 430 430 nsStart = utils.timestampNano(); … … 588 588 dRet = self.ddCaches.get(sType, None); 589 589 if dRet is None: 590 dRet = dict();590 dRet = {}; 591 591 self.ddCaches[sType] = dRet; 592 592 return dRet; -
trunk/src/VBox/ValidationKit/testmanager/core/dbobjcache.py
r96407 r97673 78 78 79 79 self._adCache = ( 80 dict(), dict(), dict(), dict(),81 dict(), dict(), dict(), dict(),82 dict(),80 {}, {}, {}, {}, 81 {}, {}, {}, {}, 82 {}, 83 83 ); 84 84 assert(len(self._adCache) == self.ksObjType_End); … … 158 158 dRepo = self._adCache[self.ksObjType_VcsRevision_sRepository_iRevision].get(sRepository); 159 159 if dRepo is None: 160 dRepo = dict();160 dRepo = {}; 161 161 self._adCache[self.ksObjType_VcsRevision_sRepository_iRevision][sRepository] = dRepo; 162 162 aiFiltered = aiRevisions; … … 187 187 oRet = dRepo.get(iRevision); 188 188 else: 189 dRepo = dict();189 dRepo = {}; 190 190 self._adCache[self.ksObjType_VcsRevision_sRepository_iRevision][sRepository] = dRepo; 191 191 oRet = None; -
trunk/src/VBox/ValidationKit/testmanager/core/failurecategory.py
r96407 r97673 311 311 oData = FailureCategoryData().initFromDbWithId(self._oDb, idFailureCategory); 312 312 (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps(); 313 if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:313 if oData.tsEffective not in (tsCur, tsCurMinusOne): 314 314 self._historizeEntry(idFailureCategory, tsCurMinusOne); 315 315 self._readdEntry(uidAuthor, oData, tsCurMinusOne); -
trunk/src/VBox/ValidationKit/testmanager/core/failurereason.py
r96407 r97673 431 431 assert oData.idFailureReason == idFailureReason; 432 432 (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps(); 433 if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:433 if oData.tsEffective not in (tsCur, tsCurMinusOne): 434 434 self._historizeEntry(idFailureReason, tsCurMinusOne); 435 435 self._readdEntry(uidAuthor, oData, tsCurMinusOne); -
trunk/src/VBox/ValidationKit/testmanager/core/schedgroup.py
r96407 r97673 909 909 # 910 910 (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps(); 911 if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:911 if oData.tsEffective not in (tsCur, tsCurMinusOne): 912 912 self._historizeEntry(idSchedGroup, tsCurMinusOne); 913 913 self._readdEntry(uidAuthor, oData, tsCurMinusOne); … … 1260 1260 # Try record who removed it by adding an dummy entry that expires immediately. 1261 1261 (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps(); 1262 if oMember.tsEffective != tsCur and oMember.tsEffective != tsCurMinusOne:1262 if oMember.tsEffective not in (tsCur, tsCurMinusOne): 1263 1263 self._historizeSchedGroupMember(oMember, tsCurMinusOne); 1264 1264 self._addSchedGroupMember(uidAuthor, oMember, tsCurMinusOne); # lazy bird. … … 1310 1310 # Try record who removed it by adding an dummy entry that expires immediately. 1311 1311 (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps(); 1312 if oBoxInGroup.tsEffective != tsCur and oBoxInGroup.tsEffective != tsCurMinusOne:1312 if oBoxInGroup.tsEffective not in (tsCur, tsCurMinusOne): 1313 1313 self._historizeSchedGroupTestBox(oBoxInGroup, tsCurMinusOne); 1314 1314 self._addSchedGroupTestBox(uidAuthor, oBoxInGroup, tsCurMinusOne); # lazy bird. -
trunk/src/VBox/ValidationKit/testmanager/core/schedulerbase.py
r96407 r97673 108 108 # Generate a testcase lookup dictionary for use when working on 109 109 # argument variations. 110 self.dTestCases = dict();110 self.dTestCases = {}; 111 111 for oTestCase in self.aoTestCases: 112 112 self.dTestCases[oTestCase.idTestCase] = oTestCase; … … 114 114 115 115 # Generate a testgroup lookup dictionary. 116 self.dTestGroups = dict();116 self.dTestGroups = {}; 117 117 for oTestGroup in self.aoTestGroups: 118 118 self.dTestGroups[oTestGroup.idTestGroup] = oTestGroup; … … 125 125 # Prep the test groups. 126 126 for oTestGroup in self.aoTestGroups: 127 oTestGroup.aoTestCases = list();128 oTestGroup.dTestCases = dict();127 oTestGroup.aoTestCases = []; 128 oTestGroup.dTestCases = {}; 129 129 130 130 # Link testcases to their group, both directions. Prep testcases for … … 139 139 oTestGroup.aoTestCases.append(oTestCase); 140 140 oTestCase.oTestGroup = oTestGroup; 141 oTestCase.aoArgsVariations = list();141 oTestCase.aoArgsVariations = []; 142 142 143 143 # Associate testcase argument variations with their testcases (group) … … 177 177 Returns array of errors (see SchedulderBase.recreateQueue()). 178 178 """ 179 aoErrors = list();179 aoErrors = []; 180 180 for oTestGroup in self.aoTestGroups: 181 181 idPreReq = oTestGroup.idTestGroupPreReq; 182 182 if idPreReq is None: 183 oTestGroup.aidTestGroupPreReqs = list();183 oTestGroup.aidTestGroupPreReqs = []; 184 184 continue; 185 185 … … 214 214 Returns array of errors (see SchedulderBase.recreateQueue()). 215 215 """ 216 aoErrors = list();216 aoErrors = []; 217 217 for oTestGroup in self.aoTestGroups: 218 218 for oTestCase in oTestGroup.aoTestCases: … … 461 461 self._fBlacklisted = None if fMaybeBlacklisted is True else False; 462 462 self.fRemoved = False; 463 self._dPreReqDecisions = dict();463 self._dPreReqDecisions = {}; 464 464 465 465 def remove(self): … … 531 531 self._tsSecStart = tsSecStart if tsSecStart is not None else utils.timestampSecond(); 532 532 self.oBuildCache = self.BuildCache(); 533 self.dTestGroupMembers = dict();533 self.dTestGroupMembers = {}; 534 534 535 535 @staticmethod … … 634 634 # little for gang gathering). 635 635 # 636 aoItems = list();636 aoItems = []; 637 637 if not oData.oSchedGroup.fEnabled: 638 638 self.msgInfo('Disabled.'); -
trunk/src/VBox/ValidationKit/testmanager/core/schedulerbeci.py
r96407 r97673 87 87 cMaxItems = min(cMaxItems, 1048576); 88 88 89 aoItems = list();89 aoItems = []; 90 90 cNotAtEnd = len(oData.aoTestCases); 91 91 while len(aoItems) < cMaxItems: -
trunk/src/VBox/ValidationKit/testmanager/core/testcase.py
r96407 r97673 265 265 The dictionary keys are ksParam_*. 266 266 """ 267 dErrors = dict()267 dErrors = {} 268 268 269 269 self.idTestCase = self._validateInt( dErrors, self.ksParam_idTestCase, self.idTestCase); -
trunk/src/VBox/ValidationKit/testmanager/core/testresultfailures.py
r96407 r97673 455 455 oData = self.getById(idTestResult) 456 456 (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps(); 457 if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:457 if oData.tsEffective not in (tsCur, tsCurMinusOne): 458 458 self._historizeEntry(idTestResult, tsCurMinusOne); 459 459 self._readdEntry(uidAuthor, oData, tsCurMinusOne); -
trunk/src/VBox/ValidationKit/testmanager/core/testset.py
r97130 r97673 204 204 sFile1 = os.path.join(config.g_ksFileAreaRootDir, self.sBaseFilename + '-' + sFilename); 205 205 try: 206 oFile = open(sFile1, sMode); # pylint: disable=consider-using-with 206 oFile = open(sFile1, sMode); # pylint: disable=consider-using-with,unspecified-encoding 207 207 return (oFile, os.fstat(oFile.fileno()).st_size, False); 208 208 except Exception as oXcpt1: … … 240 240 if not os.path.exists(os.path.dirname(sFile1)): 241 241 os.makedirs(os.path.dirname(sFile1), 0o755); 242 oFile = open(sFile1, sMode); # pylint: disable=consider-using-with 242 oFile = open(sFile1, sMode); # pylint: disable=consider-using-with,unspecified-encoding 243 243 except Exception as oXcpt1: 244 244 return str(oXcpt1); -
trunk/src/VBox/ValidationKit/testmanager/core/webservergluebase.py
r96407 r97673 148 148 self._oDbgFile = sys.stderr; 149 149 if config.g_ksSrvGlueDebugLogDst is not None and config.g_kfSrvGlueDebug is True: 150 self._oDbgFile = open(config.g_ksSrvGlueDebugLogDst, 'a'); # pylint: disable=consider-using-with 150 self._oDbgFile = open(config.g_ksSrvGlueDebugLogDst, 'a'); # pylint: disable=consider-using-with,unspecified-encoding 151 151 if config.g_kfSrvGlueCgiDumpArgs: 152 152 self._oDbgFile.write('Arguments: %s\nEnvironment:\n' % (sys.argv,)); … … 166 166 # Body. 167 167 self._sBodyType = None; 168 self._dParams = dict();168 self._dParams = {}; 169 169 self._sHtmlBody = ''; 170 170 self._cchCached = 0; … … 192 192 existing dictionary entry. 193 193 """ 194 return dict();194 return {}; 195 195 196 196 def getClientAddr(self): … … 433 433 self._writeWorker(sBody); 434 434 435 self._dParams = dict();435 self._dParams = {}; 436 436 self._cchBodyWrittenOut += self._cchCached; 437 437 … … 472 472 473 473 try: 474 with open(sLogFile, 'w') as oFile: 474 with open(sLogFile, 'w') as oFile: # pylint: disable=unspecified-encoding 475 475 oFile.write(sError + '\n\n'); 476 476 if aXcptInfo[0] is not None: -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadminglobalrsrc.py
r96407 r97673 77 77 oForm = WuiHlpForm('globalresourceform', 78 78 sFormActionUrl, 79 dErrors if dErrors is not None else dict())79 dErrors if dErrors is not None else {}) 80 80 81 81 if sAction == WuiAdmin.ksActionGlobalRsrcAdd: -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestbox.py
r96407 r97673 393 393 sVer1 = sOsVersion; 394 394 sVer2 = None; 395 if oEntry.sOs == 'linux' or oEntry.sOs == 'darwin':395 if oEntry.sOs in ('linux', 'darwin'): 396 396 iSep = sOsVersion.find(' / '); 397 397 if iSep > 0: -
trunk/src/VBox/ValidationKit/testmanager/webui/wuibase.py
r96407 r97673 145 145 self._fDbgSqlTrace = False; 146 146 self._fDbgSqlExplain = False; 147 self._dDbgParams = dict();147 self._dDbgParams = {}; 148 148 for sKey, sValue in oSrvGlue.getParameters().items(): 149 149 if sKey in self.kasDbgParams: … … 322 322 # Load the template. 323 323 # 324 with open(os.path.join(self._oSrvGlue.pathTmWebUI(), self._sTemplate)) as oFile: 324 with open(os.path.join(self._oSrvGlue.pathTmWebUI(), self._sTemplate)) as oFile: # pylint: disable=unspecified-encoding 325 325 sTmpl = oFile.read(); 326 326 … … 592 592 aoListOfTestCases.append(oListEntryTestCase) 593 593 594 if aoListOfTestCases == []:594 if not aoListOfTestCases: 595 595 if asDefaults is None: 596 596 raise WuiException('%s is missing parameters: "%s"' % (self._sAction, sName)) -
trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py
r96407 r97673 190 190 from testmanager.webui.wuiadmin import WuiAdmin; 191 191 if not dParams: 192 dParams = dict();192 dParams = {}; 193 193 else: 194 194 dParams = dict(dParams); … … 205 205 def __init__(self, sName, sAction, dParams = None, sConfirm = None, sTitle = None, sFragmentId = None, fBracketed = True): 206 206 if not dParams: 207 dParams = dict();207 dParams = {}; 208 208 else: 209 209 dParams = dict(dParams); … … 757 757 oForm = WuiHlpForm(self._sId, 758 758 '?' + webutils.encodeUrlParams({WuiDispatcherBase.ksParamAction: self._sSubmitAction}), 759 dErrors if dErrors is not None else dict(),759 dErrors if dErrors is not None else {}, 760 760 fReadOnly = self._sMode == self.ksMode_Show); 761 761 -
trunk/src/VBox/ValidationKit/testmanager/webui/wuigraphwiz.py
r96407 r97673 220 220 221 221 # Split on unit. 222 dUnitSeries = dict();222 dUnitSeries = {}; 223 223 for oSeries in aoSeries: 224 224 if oSeries.iUnit not in dUnitSeries: -
trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpform.py
r96407 r97673 69 69 self._fFinalized = False; 70 70 self._fReadOnly = fReadOnly; 71 self._dErrors = dErrors if dErrors is not None else dict();71 self._dErrors = dErrors if dErrors is not None else {}; 72 72 73 73 if sOnSubmit == self.ksOnSubmit_AddReturnToFieldWithCurrentUrl: -
trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpgraphmatplotlib.py
r96407 r97673 127 127 # Extract/structure the required data. 128 128 # 129 aoSeries = list();129 aoSeries = []; 130 130 for j in range(len(aoTable[1].aoValues)): 131 aoSeries.append( list());132 asNames = list();131 aoSeries.append([]); 132 asNames = []; 133 133 oXRange = numpy_arange(self._oData.getGroupCount()); 134 134 fpMin = self.fpMin; … … 156 156 oSubPlot = oFigure.add_subplot(1, 1, 1); 157 157 158 aoBars = list();158 aoBars = []; 159 159 for i, _ in enumerate(aoSeries): 160 160 sColor = self.calcSeriesColor(i); -
trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py
r96407 r97673 88 88 # Additional URL parameters for reports: 89 89 from testmanager.webui.wuimain import WuiMain; 90 self._dExtraParams = ReportFilter().strainParameters( dict()if oDisp is None else oDisp.getParameters(),90 self._dExtraParams = ReportFilter().strainParameters({} if oDisp is None else oDisp.getParameters(), 91 91 (WuiMain.ksParamReportPeriods, 92 92 WuiMain.ksParamReportPeriodInHours, -
trunk/src/VBox/ValidationKit/testmanager/webui/wuitestresult.py
r96407 r97673 77 77 def __init__(self, sGroupedBy, idGroupMember, sName = WuiContentBase.ksShortTestResultsLink, 78 78 dExtraParams = None, fBracketed = False): 79 dParams = dict(dExtraParams) if dExtraParams else dict();79 dParams = dict(dExtraParams) if dExtraParams else {}; 80 80 dParams[WuiMain.ksParamAction] = sGroupedBy; 81 81 dParams[WuiMain.ksParamGroupMemberId] = idGroupMember; -
trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py
r97593 r97673 152 152 % (uuid.uuid4(), self.sVBoxValidationKitIso, sGaIso); 153 153 reporter.log2('Using VISO combining ValKit and GAs "%s": %s' % (sVisoContent, sGaViso)); 154 with open(sGaViso, 'w') as oGaViso: 154 with open(sGaViso, 'w') as oGaViso: # pylint: disable=unspecified-encoding 155 155 oGaViso.write(sVisoContent); 156 156 sGaIso = sGaViso; -
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r97604 r97673 3353 3353 args = (oGuestProcess,), 3354 3354 name = ('threadForTestGuestCtrlSessionReboot')); 3355 oThreadReboot.setDaemon(True); 3355 oThreadReboot.setDaemon(True); # pylint: disable=deprecated-method 3356 3356 oThreadReboot.start(); 3357 3357 … … 4312 4312 oFile.setSize(64); 4313 4313 fUseFallback = False; 4314 except Exception as oXcpt:4314 except: 4315 4315 reporter.logXcpt(); 4316 4316 … … 4323 4323 try: 4324 4324 oFile.setSize(cbBigFile); 4325 except Exception as oXcpt:4325 except Exception: 4326 4326 reporter.logXcpt('cbBigFile=%s' % (sBigPath,)); 4327 4327 try: -
trunk/src/VBox/ValidationKit/tests/api/tdPython1.py
r96407 r97673 176 176 try: 177 177 oThread = threading.Thread(target=self.interruptWaitEventsThreadProc); 178 oThread.setDaemon(False); 178 oThread.setDaemon(False); # pylint: disable=deprecated-method 179 179 except: 180 180 reporter.errorXcpt(); -
trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py
r96407 r97673 1318 1318 oSet.aoTestVms.extend([oTestVm for oTestVm in self.asTestVmClasses.values() if oTestVm is not None]); 1319 1319 sOs = self.getBuildOs(); 1320 if sOs in self.asTestVmClasses .keys():1320 if sOs in self.asTestVmClasses: 1321 1321 for oTestVM in oSet.aoTestVms: 1322 1322 if oTestVM is not None: -
trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsInstOs2.py
r96407 r97673 206 206 207 207 # Set extra data 208 if self.asExtraData != []:208 if self.asExtraData: 209 209 for sExtraData in self.asExtraData: 210 210 try: -
trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsUnattendedInst1.py
r96407 r97673 269 269 eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnlyNetwork; 270 270 271 return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage); 271 return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage); # pylint: disable=protected-access 272 272 273 273 … … 322 322 return True; 323 323 324 return vboxtestvms.BaseTestVm._skipVmTest(self, oTestDrv, oVM); 324 return vboxtestvms.BaseTestVm._skipVmTest(self, oTestDrv, oVM); # pylint: disable=protected-access 325 325 326 326 327 def getReconfiguredVm(self, oTestDrv, cCpus, sVirtMode, sParavirtMode = None): -
trunk/src/VBox/ValidationKit/tests/storage/tdStorageRawDrive1.py
r96407 r97673 1086 1086 sKey = oMatch.group(1).strip(); 1087 1087 sValue = oMatch.group(2).strip(); 1088 if sKey not in asHeader .keys():1088 if sKey not in asHeader: 1089 1089 return reporter.error("VMDK descriptor has invalid format"); 1090 1090 sDictValue = asHeader[sKey]; … … 1122 1122 sKey = oMatch.group(1).strip(); 1123 1123 sValue = oMatch.group(2).strip(); 1124 if sKey not in asDatabase .keys():1124 if sKey not in asDatabase: 1125 1125 return reporter.error("VMDK descriptor has invalid format"); 1126 1126 sDictValue = asDatabase[sKey]; … … 1190 1190 reporter.error('Download vmdktest.vmdk from guest to host failed'); 1191 1191 else: 1192 with open(sDstFile) as oFile: 1192 with open(sDstFile) as oFile: # pylint: disable=unspecified-encoding 1193 1193 asDescriptor = [row.strip() for row in oFile]; 1194 1194 if not asDescriptor: … … 1579 1579 oSet.aoTestVms.extend([oTestVm for oTestVm in self.asTestVmClasses.values() if oTestVm is not None]); 1580 1580 sOs = self.getBuildOs(); 1581 if sOs in self.asTestVmClasses .keys():1581 if sOs in self.asTestVmClasses: 1582 1582 for oTestVM in oSet.aoTestVms: 1583 1583 if oTestVM is not None: -
trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py
r97488 r97673 1157 1157 # Open /dev/null for use as stdin further down. 1158 1158 try: 1159 oDevNull = open(os.path.devnull, 'w+'); # pylint: disable=consider-using-with 1159 oDevNull = open(os.path.devnull, 'w+'); # pylint: disable=consider-using-with,unspecified-encoding 1160 1160 except: 1161 1161 oDevNull = None; -
trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py
r96407 r97673 563 563 self.aTaskArgs = aArgs; 564 564 self.oThread = threading.Thread(target=self.taskThread, args=(), name=('UTS-%s' % (sStatus))); 565 self.oThread.setDaemon(True); 565 self.oThread.setDaemon(True); # pylint: disable=deprecated-method 566 566 self.msStart = base.timestampMilli(); 567 567
Note:
See TracChangeset
for help on using the changeset viewer.