- Timestamp:
- Jan 10, 2018 3:49:10 PM (7 years ago)
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/base.py
r70517 r70521 58 58 except: __file__ = sys.argv[0]; 59 59 g_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))); 60 61 # Python 3 hacks: 62 if sys.version_info[0] >= 3: 63 long = int; # pylint: disable=redefined-builtin,invalid-name 60 64 61 65 -
trunk/src/VBox/ValidationKit/testdriver/reporter.py
r70517 r70521 393 393 sLogDir = os.path.abspath(os.environ.get('TESTBOX_REPORTER_LOG_DIR', self.sDefLogDir)); 394 394 if not os.path.isdir(sLogDir): 395 os.makedirs(sLogDir, 0 x1e8); # 0750 = 0x1e8395 os.makedirs(sLogDir, 0o750); 396 396 except: 397 397 sLogDir = self.sDefLogDir; 398 398 if not os.path.isdir(sLogDir): 399 os.makedirs(sLogDir, 0 x1e8); # 0750 = 0x1e8399 os.makedirs(sLogDir, 0o750); 400 400 401 401 # … … 405 405 self.sLogDir = sLogDir = os.path.join(sLogDir, '%s-%s' % (sTs, self.sName)); 406 406 try: 407 os.makedirs(self.sLogDir, 0 x1e8); # 0750 = 0x1e8407 os.makedirs(self.sLogDir, 0o750); 408 408 except: 409 409 self.sLogDir = '%s-%s' % (self.sLogDir, os.getpid()); 410 os.makedirs(self.sLogDir, 0 x1e8); # 0750 = 0x1e8410 os.makedirs(self.sLogDir, 0o750); 411 411 412 412 # -
trunk/src/VBox/ValidationKit/testdriver/tst-txsclient.py
r70517 r70521 42 42 import testdriver.reporter as reporter 43 43 from common import utils; 44 45 # Python 3 hacks: 46 if sys.version_info[0] >= 3: 47 long = int; # pylint: disable=redefined-builtin,invalid-name 44 48 45 49 g_cTests = 0; … … 60 64 global g_cTests, g_cFailures; 61 65 g_cTests = g_cTests + 1; 62 if isinstance(rc, basestring):66 if utils.isString(rc): 63 67 if rc == sExpect: 64 68 return 'PASSED'; -
trunk/src/VBox/ValidationKit/testdriver/txsclient.py
r70508 r70521 30 30 31 31 # Standard Python imports. 32 import array 33 import errno 34 import os 35 import select 36 import socket 37 import threading 38 import time 39 import types 40 import zlib 41 import uuid 32 import array; 33 import errno; 34 import os; 35 import select; 36 import socket; 37 import sys; 38 import threading; 39 import time; 40 import types; 41 import zlib; 42 import uuid; 42 43 43 44 # Validation Kit imports. 44 from common import utils;45 from testdriver import base;46 from testdriver import reporter;45 from common import utils; 46 from testdriver import base; 47 from testdriver import reporter; 47 48 from testdriver.base import TdTaskBase; 49 50 # Python 3 hacks: 51 if sys.version_info[0] >= 3: 52 long = int; # pylint: disable=redefined-builtin,invalid-name 48 53 49 54 # … … 118 123 """Encodes the u32 value as a little endian byte (B) array.""" 119 124 return array.array('B', \ 120 ( u32 % 256, \121 (u32 / 256) % 256, \122 (u32 / 65536) % 256, \123 (u32 / 16777216) % 256) );125 ( u32 % 256, \ 126 (u32 // 256) % 256, \ 127 (u32 // 65536) % 256, \ 128 (u32 // 16777216) % 256) ); 124 129 125 130 … … 352 357 for o in aoPayload: 353 358 try: 354 if isinstance(o, basestring): 355 # the primitive approach... 356 sUtf8 = o.encode('utf_8'); 357 for i in range(0, len(sUtf8)): 358 abPayload.append(ord(sUtf8[i])) 359 if utils.isString(o): 360 if sys.version_info[0] >= 3: 361 abPayload.extend(o.encode('utf_8')); 362 else: 363 # the primitive approach... 364 sUtf8 = o.encode('utf_8'); 365 for i in range(0, len(sUtf8)): 366 abPayload.append(ord(sUtf8[i])) 359 367 abPayload.append(0); 360 368 elif isinstance(o, types.LongType): … … 724 732 aoPayload.append('%s' % (sPutEnv)); 725 733 for o in (oStdIn, oStdOut, oStdErr, oTestPipe): 726 if isinstance(o, basestring):734 if utils.isString(o): 727 735 aoPayload.append(o); 728 736 elif o is not None: … … 748 756 if msPendingInputReply is None \ 749 757 and oStdIn is not None \ 750 and not isinstance(oStdIn, basestring):758 and not utils.isString(oStdIn): 751 759 try: 752 760 sInput = oStdIn.read(65536); … … 910 918 # Cleanup. 911 919 for o in (oStdIn, oStdOut, oStdErr, oTestPipe): 912 if o is not None and not isinstance(o, basestring):920 if o is not None and not utils.isString(o): 913 921 del o.uTxsClientCrc32; # pylint: disable=E1103 914 922 # Make sure all files are closed … … 1084 1092 # Convert to array - this is silly! 1085 1093 abBuf = array.array('B'); 1086 for i, _ in enumerate(sRaw): 1087 abBuf.append(ord(sRaw[i])); 1094 if utils.isString(sRaw): 1095 for i, _ in enumerate(sRaw): 1096 abBuf.append(ord(sRaw[i])); 1097 else: 1098 abBuf.extend(sRaw); 1088 1099 sRaw = None; 1089 1100 … … 1406 1417 # 1407 1418 1408 def asyncMkDir(self, sRemoteDir, fMode = 0 700, cMsTimeout = 30000, fIgnoreErrors = False):1419 def asyncMkDir(self, sRemoteDir, fMode = 0o700, cMsTimeout = 30000, fIgnoreErrors = False): 1409 1420 """ 1410 1421 Initiates a mkdir task. … … 1416 1427 return self.startTask(cMsTimeout, fIgnoreErrors, "mkDir", self.taskMkDir, (sRemoteDir, long(fMode))); 1417 1428 1418 def syncMkDir(self, sRemoteDir, fMode = 0 700, cMsTimeout = 30000, fIgnoreErrors = False):1429 def syncMkDir(self, sRemoteDir, fMode = 0o700, cMsTimeout = 30000, fIgnoreErrors = False): 1419 1430 """Synchronous version.""" 1420 1431 return self.asyncToSync(self.asyncMkDir, sRemoteDir, long(fMode), cMsTimeout, fIgnoreErrors); 1421 1432 1422 def asyncMkDirPath(self, sRemoteDir, fMode = 0 700, cMsTimeout = 30000, fIgnoreErrors = False):1433 def asyncMkDirPath(self, sRemoteDir, fMode = 0o700, cMsTimeout = 30000, fIgnoreErrors = False): 1423 1434 """ 1424 1435 Initiates a mkdir -p task. … … 1430 1441 return self.startTask(cMsTimeout, fIgnoreErrors, "mkDirPath", self.taskMkDirPath, (sRemoteDir, long(fMode))); 1431 1442 1432 def syncMkDirPath(self, sRemoteDir, fMode = 0 700, cMsTimeout = 30000, fIgnoreErrors = False):1443 def syncMkDirPath(self, sRemoteDir, fMode = 0o700, cMsTimeout = 30000, fIgnoreErrors = False): 1433 1444 """Synchronous version.""" 1434 1445 return self.asyncToSync(self.asyncMkDirPath, sRemoteDir, long(fMode), cMsTimeout, fIgnoreErrors); … … 1659 1670 def __isInProgressXcpt(self, oXcpt): 1660 1671 """ In progress exception? """ 1672 reporter.log("oXcpt=%s" % (oXcpt)) ## TMP TMP 1673 reporter.log("dir(oXcpt)=%s" % (dir(oXcpt))) ## TMP TMP 1661 1674 try: 1662 1675 if isinstance(oXcpt, socket.error): 1663 1676 try: 1664 if oXcpt [0]== errno.EINPROGRESS:1677 if oXcpt.errno == errno.EINPROGRESS: 1665 1678 return True; 1666 1679 except: pass; 1667 1680 # Windows? 1668 1681 try: 1669 if oXcpt [0]== errno.EWOULDBLOCK:1682 if oXcpt.errno == errno.EWOULDBLOCK: 1670 1683 return True; 1671 1684 except: pass; … … 1679 1692 if isinstance(oXcpt, socket.error): 1680 1693 try: 1681 if oXcpt [0]== errno.EWOULDBLOCK:1694 if oXcpt.errno == errno.EWOULDBLOCK: 1682 1695 return True; 1683 1696 except: pass; 1684 1697 try: 1685 if oXcpt [0]== errno.EAGAIN:1698 if oXcpt.errno == errno.EAGAIN: 1686 1699 return True; 1687 1700 except: pass; … … 1695 1708 if isinstance(oXcpt, socket.error): 1696 1709 try: 1697 if oXcpt [0]== errno.ECONNRESET:1710 if oXcpt.errno == errno.ECONNRESET: 1698 1711 return True; 1699 1712 except: pass; 1700 1713 try: 1701 if oXcpt [0]== errno.ENETRESET:1714 if oXcpt.errno == errno.ENETRESET: 1702 1715 return True; 1703 1716 except: pass; -
trunk/src/VBox/ValidationKit/testdriver/vbox.py
r70517 r70521 55 55 from testdriver import vboxtestvms; 56 56 57 # Python 3 hacks: 58 if sys.version_info[0] >= 3: 59 xrange = range; # pylint: disable=redefined-builtin,invalid-name 60 long = int; # pylint: disable=redefined-builtin,invalid-name 57 61 58 62 # … … 2396 2400 tsNow = datetime.datetime.now() 2397 2401 tsDelta = tsNow - tsStart 2398 if ((tsDelta.microseconds + tsDelta.seconds * 1000000) / 1000) > cMsTimeout:2402 if ((tsDelta.microseconds + tsDelta.seconds * 1000000) // 1000) > cMsTimeout: 2399 2403 if fErrorOnTimeout: 2400 2404 reporter.errorTimeout('Timeout while waiting for progress.') -
trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py
r69111 r70521 562 562 if not os.path.exists(sMountPath): 563 563 try: 564 os.mkdir(sMountPath, 0 755);564 os.mkdir(sMountPath, 0o755); 565 565 except: 566 566 reporter.logXcpt(); -
trunk/src/VBox/ValidationKit/testdriver/vboxtestvms.py
r70491 r70521 870 870 oSet.aoTestVms.append(oTestVm); 871 871 872 # #NT 3.x873 #oTestVm = TestVm(oSet, 'tst-nt310', sHd = '5.2/great-old-ones/t-nt310/t-nt310.vdi',874 #sKind = 'WindowsNT3x', acCpusSup = [1],875 #sHddControllerType = 'BusLogic SCSI Controller', sDvdControllerType = 'BusLogic SCSI Controller' );876 #oSet.aoTestVms.append(oTestVm); ## @todo COM872 # NT 3.x 873 oTestVm = TestVm(oSet, 'tst-nt310', sHd = '5.2/great-old-ones/t-nt310/t-nt310.vdi', 874 sKind = 'WindowsNT3x', acCpusSup = [1], 875 sHddControllerType = 'BusLogic SCSI Controller', sDvdControllerType = 'BusLogic SCSI Controller' ); 876 oSet.aoTestVms.append(oTestVm); ## @todo COM 877 877 878 878 # NT 4 … … 986 986 #oSet.aoTestVms.append(oTestVm); 987 987 988 # #NT 3.x989 #oTestVm = TestVm(oSet, 'tst-nt310', sHd = '5.2/great-old-ones/t-nt310/t-nt310.vdi',990 #sKind = 'WindowsNT3x', acCpusSup = [1],991 #sHddControllerType = 'BusLogic SCSI Controller', sDvdControllerType = 'BusLogic SCSI Controller' );992 #oSet.aoTestVms.append(oTestVm); ## @todo COM988 # NT 3.x 989 oTestVm = TestVm(oSet, 'tst-nt310', sHd = '5.2/great-old-ones/t-nt310/t-nt310.vdi', 990 sKind = 'WindowsNT3x', acCpusSup = [1], 991 sHddControllerType = 'BusLogic SCSI Controller', sDvdControllerType = 'BusLogic SCSI Controller' ); 992 oSet.aoTestVms.append(oTestVm); ## @todo COM 993 993 994 994 # NT 4 -
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r70508 r70521 32 32 33 33 # Standard Python imports. 34 import os 35 import socket 34 import os; 35 import socket; 36 import sys; 36 37 37 38 # Validation Kit imports. … … 480 481 if fErrorOnTimeout: 481 482 if fIgnoreErrors: 482 reporter.log('Timing out after waiting for % us on "%s" operation %d' \483 reporter.log('Timing out after waiting for %s s on "%s" operation %d' \ 483 484 % (cMsTimeout / 1000, self.sName, iOperation)) 484 485 else: 485 reporter.error('Timing out after waiting for % us on "%s" operation %d' \486 reporter.error('Timing out after waiting for %s s on "%s" operation %d' \ 486 487 % (cMsTimeout / 1000, self.sName, iOperation)) 487 488 return -1; … … 1544 1545 sHostIP = socket.gethostbyname(sHostName) 1545 1546 abHostIP = socket.inet_aton(sHostIP) 1546 if ord(abHostIP[0]) == 127 \ 1547 or (ord(abHostIP[0]) == 169 and ord(abHostIP[1]) == 254) \ 1548 or (ord(abHostIP[0]) == 192 and ord(abHostIP[1]) == 168 and ord(abHostIP[2]) == 56): 1547 if sys.version_info[0] < 3: 1548 abHostIP = (ord(abHostIP[0]), ord(abHostIP[1]), ord(abHostIP[2]), ord(abHostIP[3])); 1549 if abHostIP[0] == 127 \ 1550 or (abHostIP[0] == 169 and abHostIP[1] == 254) \ 1551 or (abHostIP[0] == 192 and abHostIP[1] == 168 and abHostIP[2] == 56): 1549 1552 reporter.log('warning: host IP for "%s" is %s, most likely not unique.' % (sHostName, sHostIP)) 1550 1553 except: … … 1552 1555 return False 1553 1556 sDefaultMac = '%02X%02X%02X%02X%02X%02X' \ 1554 % (0x02, ord(abHostIP[0]), ord(abHostIP[1]), ord(abHostIP[2]), ord(abHostIP[3]), iNic)1557 % (0x02, abHostIP[0], abHostIP[1], abHostIP[2], abHostIP[3], iNic) 1555 1558 sMacAddr = sDefaultMac[0:(12 - cchMacAddr)] + sMacAddr 1556 1559 … … 2833 2836 2834 2837 oTxsSession = txsclient.tryOpenTcpSession(cMsTimeout, sHostname, fReversedSetup = fReversed, 2835 cMsIdleFudge = cMsTimeout / 2);2838 cMsIdleFudge = cMsTimeout // 2); 2836 2839 if oTxsSession is None: 2837 2840 return False; -
trunk/src/VBox/ValidationKit/testdriver/winbase.py
r69578 r70521 32 32 33 33 # Standard Python imports. 34 import ctypes; 34 35 import os; 35 import ctypes;36 import sys; 36 37 37 38 # Windows specific imports. … … 47 48 from testdriver import reporter; 48 49 50 # Python 3 hacks: 51 if sys.version_info[0] >= 3: 52 long = int; # pylint: disable=redefined-builtin,invalid-name 49 53 50 54 … … 215 219 except: 216 220 reporter.logXcpt(); 217 reporter.log2('processCreate -> %#x, hProcess=% #x' % (uPid, hProcess,));221 reporter.log2('processCreate -> %#x, hProcess=%s %#x' % (uPid, hProcess, hProcess.handle,)); 218 222 return (uPid, hProcess, uTid); 219 223 … … 225 229 dwWait = win32event.WaitForSingleObject(hProcess, 0); # pylint: disable=no-member 226 230 except: 227 reporter.logXcpt('hProcess=%s %#x' % (hProcess, hProcess ,));231 reporter.logXcpt('hProcess=%s %#x' % (hProcess, hProcess.handle,)); 228 232 return True; 229 233 return dwWait != win32con.WAIT_TIMEOUT; #0x102; # … … 237 241 win32api.TerminateProcess(hProcess, 0x40010004); # DBG_TERMINATE_PROCESS # pylint: disable=no-member 238 242 except: 239 reporter.logXcpt('hProcess=%s %#x' % (hProcess, hProcess ,));243 reporter.logXcpt('hProcess=%s %#x' % (hProcess, hProcess.handle,)); 240 244 return False; 241 245 return True; -
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r70509 r70521 2589 2589 tdTestResult(fRc = False) ], 2590 2590 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'xXx', 2591 sDirectory = 'C:\\Windows', fMode = 0 700),2591 sDirectory = 'C:\\Windows', fMode = 0o700), 2592 2592 tdTestResult(fRc = False) ], 2593 2593 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'xxx', 2594 sDirectory = 'C:\\Windows', fMode = 0 700),2594 sDirectory = 'C:\\Windows', fMode = 0o700), 2595 2595 tdTestResult(fRc = False) ], 2596 2596 # More unusual stuff. … … 2630 2630 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX', 2631 2631 # sDirectory = sScratch, 2632 # fMode = 0 700),2632 # fMode = 0o700), 2633 2633 # tdTestResult(fRc = True) ], 2634 2634 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX', 2635 2635 # sDirectory = sScratch, 2636 # fMode = 0 700),2636 # fMode = 0o700), 2637 2637 # tdTestResult(fRc = True) ], 2638 2638 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX', 2639 2639 # sDirectory = sScratch, 2640 # fMode = 0 755),2640 # fMode = 0o755), 2641 2641 # tdTestResult(fRc = True) ], 2642 2642 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX', 2643 2643 # sDirectory = sScratch, 2644 # fMode = 0 755),2644 # fMode = 0o755), 2645 2645 # tdTestResult(fRc = True) ], 2646 2646 # Secure variants. … … 2659 2659 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX', 2660 2660 # sDirectory = sScratch, 2661 # fSecure = True, fMode = 0 700),2661 # fSecure = True, fMode = 0o700), 2662 2662 # tdTestResult(fRc = True) ], 2663 2663 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX', 2664 2664 # sDirectory = sScratch, 2665 # fSecure = True, fMode = 0 700),2665 # fSecure = True, fMode = 0o700), 2666 2666 # tdTestResult(fRc = True) ], 2667 2667 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX', 2668 2668 # sDirectory = sScratch, 2669 # fSecure = True, fMode = 0 755),2669 # fSecure = True, fMode = 0o755), 2670 2670 # tdTestResult(fRc = True) ], 2671 2671 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX', 2672 2672 # sDirectory = sScratch, 2673 # fSecure = True, fMode = 0 755),2673 # fSecure = True, fMode = 0o755), 2674 2674 # tdTestResult(fRc = True) ], 2675 2675 # Random stuff. … … 2677 2677 # sTemplate = "XXX-".join(random.choice(string.ascii_lowercase) for i in range(32)), 2678 2678 # sDirectory = sScratch, 2679 # fSecure = True, fMode = 0 755),2679 # fSecure = True, fMode = 0o755), 2680 2680 # tdTestResult(fRc = True) ], 2681 2681 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = "".join('X' for i in range(32)), 2682 2682 # sDirectory = sScratch, 2683 # fSecure = True, fMode = 0 755),2683 # fSecure = True, fMode = 0o755), 2684 2684 # tdTestResult(fRc = True) ], 2685 2685 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = "".join('X' for i in range(128)), 2686 2686 # sDirectory = sScratch, 2687 # fSecure = True, fMode = 0 755),2687 # fSecure = True, fMode = 0o755), 2688 2688 # tdTestResult(fRc = True) ] 2689 2689 # ]); -
trunk/src/VBox/ValidationKit/tests/api/tdAppliance1.py
r69445 r70521 175 175 # 176 176 try: 177 os.mkdir(sTmpDir, 0 x1ed); # 0755 = 0x1ed177 os.mkdir(sTmpDir, 0o755); 178 178 oTarFile = tarfile.open(sOva, 'r:*'); 179 179 oTarFile.extractall(sTmpDir); -
trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium.py
r69111 r70521 136 136 sNewLoc = os.path.join(sOrigLoc, 'newLocation/') 137 137 138 os.makedirs(sNewLoc, 0 775);138 os.makedirs(sNewLoc, 0o775); 139 139 140 140 aListOfAttach = oVM.getMediumAttachmentsOfController(sController) -
trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py
r69111 r70521 246 246 return sFileId; 247 247 248 def mkDir(self, sDir, fMode = 0 700, cMsTimeout = 30000):248 def mkDir(self, sDir, fMode = 0o700, cMsTimeout = 30000): 249 249 """ 250 250 Creates a new directory at the given location. -
trunk/src/VBox/ValidationKit/tests/storage/storagecfg.py
r66580 r70521 319 319 sFdiskScript = ';\n'; # Single partition filling everything 320 320 if cbVol is not None: 321 sFdiskScript = ',' + str(cbVol / 512) + '\n'; # Get number of sectors321 sFdiskScript = ',' + str(cbVol // 512) + '\n'; # Get number of sectors 322 322 fRc = oExec.execBinaryNoStdOut('sfdisk', ('--no-reread', '--wipe', 'always', '-q', '-f', sDiskPath), \ 323 323 sFdiskScript); … … 430 430 if fRc: 431 431 self.oStorOs = oStorOs; 432 if isinstance(oDiskCfg, basestring):432 if utils.isString(oDiskCfg): 433 433 self.lstDisks = oStorOs.getDisksMatchingRegExp(oDiskCfg); 434 434 else: … … 591 591 return fRc; 592 592 593 def mkDirOnVolume(self, sMountPoint, sDir, fMode = 0 700):593 def mkDirOnVolume(self, sMountPoint, sDir, fMode = 0o700): 594 594 """ 595 595 Creates a new directory on the volume pointed to by the given mount point. -
trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py
r68710 r70521 1068 1068 if sMountPoint is not None: 1069 1069 # Create a directory where every normal user can write to. 1070 self.oStorCfg.mkDirOnVolume(sMountPoint, 'test', 0 777);1070 self.oStorCfg.mkDirOnVolume(sMountPoint, 'test', 0o777); 1071 1071 sDiskPath = sMountPoint + '/test'; 1072 1072 else: … … 1312 1312 reporter.testFailure('Failed to prepare host storage'); 1313 1313 fRc = False; 1314 self.oStorCfg.mkDirOnVolume(sMountPoint, 'test', 0 777);1314 self.oStorCfg.mkDirOnVolume(sMountPoint, 'test', 0o777); 1315 1315 sMountPoint = sMountPoint + '/test'; 1316 1316 reporter.testDone(); -
trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py
r69606 r70521 507 507 reporter.log('_hardenedMkDir: %s' % (sPath,)); 508 508 if utils.getHostOs() in [ 'win', 'os2' ]: 509 os.makedirs(sPath, 0 755);509 os.makedirs(sPath, 0o755); 510 510 else: 511 511 fRc = self._sudoExecuteSync(['/bin/mkdir', '-p', '-m', '0755', sPath]); … … 584 584 585 585 sDst = os.path.join(sDstDir, os.path.basename(sFullPath)); 586 self._hardenedCopyFile(sFullPath, sDst, 0 755);586 self._hardenedCopyFile(sFullPath, sDst, 0o755); 587 587 asFilesToRemove.append(sDst); 588 588 … … 592 592 if os.path.exists(sSrc): 593 593 sDst = os.path.join(sDstDir, os.path.basename(sSrc)); 594 self._hardenedCopyFile(sSrc, sDst, 0 644);594 self._hardenedCopyFile(sSrc, sDst, 0o644); 595 595 asFilesToRemove.append(sDst); 596 596 … … 602 602 if os.path.exists(sSrc): 603 603 sDst = os.path.join(sDstDir, os.path.basename(sSrc)); 604 self._hardenedCopyFile(sSrc, sDst, 0 644);604 self._hardenedCopyFile(sSrc, sDst, 0o644); 605 605 asFilesToRemove.append(sDst); 606 606 -
trunk/src/VBox/ValidationKit/tests/usb/tdUsb1.py
r69111 r70521 50 50 # USB gadget control import 51 51 import usbgadget; 52 53 # Python 3 hacks: 54 if sys.version_info[0] >= 3: 55 xrange = range; # pylint: disable=redefined-builtin,invalid-name 56 52 57 53 58 class tdUsbBenchmark(vbox.TestDriver): # pylint: disable=R0902 -
trunk/src/VBox/ValidationKit/tests/usb/tst-utsgadget.py
r69111 r70521 40 40 import testdriver.reporter as reporter 41 41 42 # Python 3 hacks: 43 if sys.version_info[0] >= 3: 44 long = int; # pylint: disable=redefined-builtin,invalid-name 45 46 42 47 g_cTests = 0; 43 48 g_cFailures = 0 … … 57 62 global g_cTests, g_cFailures; 58 63 g_cTests = g_cTests + 1; 59 if isinstance(rc, basestring):64 if utils.isString(rc): 60 65 if rc == sExpect: 61 66 return 'PASSED'; -
trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py
r70509 r70521 169 169 """Encodes the u32 value as a little endian byte (B) array.""" 170 170 return array.array('B', \ 171 ( u32 % 256, \172 (u32 / 256) % 256, \173 (u32 / 65536) % 256, \174 (u32 / 16777216) % 256) );171 ( u32 % 256, \ 172 (u32 // 256) % 256, \ 173 (u32 // 65536) % 256, \ 174 (u32 // 16777216) % 256) ); 175 175 176 176 def u16ToByteArray(u16): 177 177 """Encodes the u16 value as a little endian byte (B) array.""" 178 178 return array.array('B', \ 179 ( u16 % 256, \180 (u16 / 256) % 256) );179 ( u16 % 256, \ 180 (u16 // 256) % 256) ); 181 181 182 182 def u8ToByteArray(uint8): … … 444 444 for o in aoPayload: 445 445 try: 446 if isinstance(o, basestring):446 if utils.isString(o): 447 447 # the primitive approach... 448 448 sUtf8 = o.encode('utf_8');
Note:
See TracChangeset
for help on using the changeset viewer.