- Timestamp:
- Mar 8, 2022 2:18:58 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150375
- Location:
- trunk/src/VBox/ValidationKit/testdriver
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/ValidationKit/testdriver/btresolver.py ¶
r93115 r94126 599 599 asArgs.append(sLoadAddr); 600 600 601 oRTLdrFltProc = subprocess.Popen(asArgs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, bufsize=0); 601 oRTLdrFltProc = subprocess.Popen(asArgs, stdin=subprocess.PIPE, # pylint: disable=consider-using-with 602 stdout=subprocess.PIPE, bufsize=0); 602 603 if oRTLdrFltProc is not None: 603 604 sReportAn, _ = oRTLdrFltProc.communicate(sReport); -
TabularUnified trunk/src/VBox/ValidationKit/testdriver/reporter.py ¶
r93115 r94126 71 71 72 72 # Take the lock. 73 if not self.oLock.acquire(): 73 if not self.oLock.acquire(): # pylint: disable=consider-using-with 74 74 return False; 75 75 -
TabularUnified trunk/src/VBox/ValidationKit/testdriver/testfileset.py ¶
r93115 r94126 517 517 # has been changed to tarfile.PAX_FORMAT, which our extraction code (vts_tar) currently can't handle. 518 518 ## @todo Remove tarfile.GNU_FORMAT and use tarfile.PAX_FORMAT as soon as we have PAX support. 519 oTarFile = tarfile.open(sTarFileHst, 'w:gz', format = tarfile.GNU_FORMAT); 519 oTarFile = tarfile.open(sTarFileHst, 'w:gz', format = tarfile.GNU_FORMAT); # pylint: disable=consider-using-with 520 520 except: 521 521 return reporter.errorXcpt('Failed to open new tar file: %s' % (sTarFileHst,)); … … 592 592 593 593 try: 594 oOutFile = open(sPath, 'wb'); 594 oOutFile = open(sPath, 'wb'); # pylint: disable=consider-using-with 595 595 except: 596 596 return reporter.errorXcpt('open(%s, "wb") failed' % (sPath,)); -
TabularUnified trunk/src/VBox/ValidationKit/testdriver/tst-txsclient.py ¶
r93115 r94126 38 38 sys.path.insert(0, '.'); 39 39 sys.path.insert(0, '..'); 40 import testdriver.txsclient as txsclient 41 import testdriver.reporter as reporter 42 from common import utils;40 from common import utils; 41 from testdriver import txsclient; 42 from testdriver import reporter; 43 43 44 44 # Python 3 hacks: -
TabularUnified trunk/src/VBox/ValidationKit/testdriver/vbox.py ¶
r93895 r94126 3795 3795 # resubmit the task. 3796 3796 cMsTimeout2 = msStart + cMsTimeout - base.timestampMilli(); 3797 if cMsTimeout2 < 500: 3798 cMsTimeout2 = 500; 3797 cMsTimeout2 = max(cMsTimeout2, 500); 3799 3798 fRc = oTxsSession.asyncIsFile('${CDROM}/%s' % (sFile,), cMsTimeout2); 3800 3799 if fRc is not True: -
TabularUnified trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py ¶
r93665 r94126 239 239 sFull = self.__persistentVarCalcName(sVar); 240 240 try: 241 oFile = open(sFull, 'w'); 242 if sValue: 243 oFile.write(sValue.encode('utf-8')); 244 oFile.close(); 241 with open(sFull, 'w') as oFile: 242 if sValue: 243 oFile.write(sValue.encode('utf-8')); 245 244 except: 246 245 reporter.errorXcpt('Error creating "%s"' % (sFull,)); … … 292 291 return None; 293 292 try: 294 oFile = open(sFull, 'r'); 295 sValue = oFile.read().decode('utf-8'); 296 oFile.close(); 293 with open(sFull, 'r') as oFile: 294 sValue = oFile.read().decode('utf-8'); 297 295 except: 298 296 reporter.errorXcpt('Error creating "%s"' % (sFull,)); … … 492 490 # Download the build files. 493 491 # 494 for i in range(len(self._asBuildUrls)): 495 if webutils.downloadFile(self._asBuildUrls[i], self._asBuildFiles[i], 496 self.sBuildPath, reporter.log, reporter.log) is not True: 492 for i, sBuildUrl in enumerate(self._asBuildUrls): 493 if webutils.downloadFile(sBuildUrl, self._asBuildFiles[i], self.sBuildPath, reporter.log, reporter.log) is not True: 497 494 reporter.testDone(fSkipped = True); 498 495 return None; # Failed to get binaries, probably deleted. Skip the test run. -
TabularUnified trunk/src/VBox/ValidationKit/testdriver/vboxtestvms.py ¶
r93150 r94126 39 39 40 40 # Validation Kit imports. 41 from common import pathutils; 42 from common import utils; 41 43 from testdriver import base; 42 44 from testdriver import reporter; 43 45 from testdriver import vboxcon; 44 from common import pathutils;45 from common import utils;46 46 47 47 -
TabularUnified trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py ¶
r93115 r94126 237 237 break; 238 238 cMsToWait = cMsTimeout - cMsElapsed; 239 if cMsToWait > 500: 240 cMsToWait = 500; 239 cMsToWait = min(cMsToWait, 500); 241 240 try: 242 241 self.o.waitForCompletion(cMsToWait); … … 699 698 break; 700 699 cMsSleep = cMsTimeout - cMsElapsed; 701 if cMsSleep > 10000: 702 cMsSleep = 10000; 700 cMsSleep = min(cMsSleep, 10000); 703 701 try: self.oVBoxMgr.waitForEvents(cMsSleep); 704 702 except KeyboardInterrupt: raise; … … 2856 2854 return False 2857 2855 2858 oFile = open(sFilename, 'wb') 2859 oFile.write(aPngData) 2860 oFile.close() 2856 with open(sFilename, 'wb') as oFile: 2857 oFile.write(aPngData) 2861 2858 2862 2859 return True
Note:
See TracChangeset
for help on using the changeset viewer.