Changeset 99128 in vbox for trunk/src/VBox/ValidationKit/tests/additions
- Timestamp:
- Mar 23, 2023 8:24:15 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r99102 r99128 381 381 Has a default timeout of 5 minutes (for safety). 382 382 """ 383 def __init__(self, sCmd = "", asArgs = None, aEnv = None, afFlags = None, # pylint: disable=too-many-arguments383 def __init__(self, sCmd = "", sCwd = "", asArgs = None, aEnv = None, afFlags = None, # pylint: disable=too-many-arguments 384 384 timeoutMS = 5 * 60 * 1000, oCreds = None, fWaitForExit = True): 385 385 tdTestGuestCtrlBase.__init__(self, oCreds = oCreds); 386 386 self.sCmd = sCmd; 387 self.sCwd = sCwd; 387 388 self.asArgs = asArgs if asArgs is not None else [sCmd,]; 388 389 self.aEnv = aEnv; … … 2164 2165 if fUseDirList: 2165 2166 fRc = reporter.errorXcpt('Error listing directory "%s" (cEntriesToRead=%d):' % \ 2166 (oDir.sPath, cEntriesToRead));2167 (oDir.sPath, cEntriesToRead)); 2167 2168 else: 2168 2169 fRc = reporter.errorXcpt('Error reading directory "%s":' % (oDir.sPath)); … … 2214 2215 if oFsObj.sName != sName: 2215 2216 fRc = reporter.error('%s: expected name "%s", got "%s" instead!' % \ 2216 (oFsObj.sPath, oFsObj.sName, sName,));2217 (oFsObj.sPath, oFsObj.sName, sName,)); 2217 2218 2218 2219 # Check the size if a file. 2219 2220 if isinstance(oFsObj, testfileset.TestFile) and cbFile != oFsObj.cbContent: 2220 2221 fRc = reporter.error('%s: expected size %s, got %s instead!' % \ 2221 (oFsObj.sPath, oFsObj.cbContent, cbFile,));2222 (oFsObj.sPath, oFsObj.cbContent, cbFile,)); 2222 2223 2223 2224 ## @todo check timestamps and attributes. … … 2318 2319 % (oTest.sCmd, oTest.afFlags, oTest.timeoutMS, limitString(oTest.asArgs), limitString(oTest.aEnv),)); 2319 2320 try: 2320 oProcess = oGuestSession.processCreate(oTest.sCmd, 2321 oTest.asArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.asArgs[1:], 2322 oTest.aEnv, oTest.afFlags, oTest.timeoutMS); 2321 if self.oTstDrv.fpApiVer >= 7.1: 2322 oProcess = oGuestSession.processCreate(oTest.sCmd, oTest.sCwd, 2323 oTest.asArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.asArgs[1:], 2324 oTest.aEnv, oTest.afFlags, oTest.timeoutMS); 2325 else: 2326 oProcess = oGuestSession.processCreate(oTest.sCmd, 2327 oTest.asArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.asArgs[1:], 2328 oTest.aEnv, oTest.afFlags, oTest.timeoutMS); 2323 2329 except: 2324 2330 reporter.maybeErrXcpt(fIsError, 'type=%s, asArgs=%s' % (type(oTest.asArgs), oTest.asArgs,)); … … 2881 2887 try: 2882 2888 reporter.log2('Starting stale process #%d...' % (i)); 2883 oGuestSession.processCreate(sShell, 2884 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], [], 2885 [ vboxcon.ProcessCreateFlag_WaitForStdOut ], 30 * 1000); 2889 if self.oTstDrv.fpApiVer >= 7.1: 2890 oGuestSession.processCreate(sShell, "", 2891 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], [], 2892 [ vboxcon.ProcessCreateFlag_WaitForStdOut ], 30 * 1000); 2893 else: 2894 oGuestSession.processCreate(sShell, 2895 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], [], 2896 [ vboxcon.ProcessCreateFlag_WaitForStdOut ], 30 * 1000); 2886 2897 # Note: Not keeping a process reference from the created process above is intentional and part of the test! 2887 2898 … … 2915 2926 try: 2916 2927 reporter.log2('Starting non-stale process #%d...' % (i)); 2917 oCurProc = oGuestSession.processCreate(sShell, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], 2918 [], [], 0); # Infinite timeout. 2928 if self.oTstDrv.fpApiVer >= 7.1: 2929 oCurProc = oGuestSession.processCreate(sShell, "", asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], 2930 [], [], 0); # Infinite timeout. 2931 else: 2932 oCurProc = oGuestSession.processCreate(sShell, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], 2933 [], [], 0); # Infinite timeout. 2919 2934 aoProcs.append(oCurProc); 2920 2935 except: … … 2968 2983 try: 2969 2984 reporter.log2('Starting blocking process #%d...' % (i)); 2970 oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], 2971 [], [], 30 * 1000); 2985 if self.oTstDrv.fpApiVer >= 7.1: 2986 oCurProc = oGuestSession.processCreate(sCmd, "", asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], 2987 [], [], 30 * 1000); 2988 else: 2989 oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], 2990 [], [], 30 * 1000); 2972 2991 # Note: Use a timeout in the call above for not letting the stale processes 2973 2992 # hanging around forever. This can happen if the installed Guest Additions … … 3042 3061 sShellOpt = '/C' if oTestVm.isWindows() or oTestVm.isOS2() else '-c'; 3043 3062 sSystemDir = self.oTstDrv.getGuestSystemDir(oTestVm); 3063 sTempDir = self oTstDrv.getGuestTempDir(oTestVm); 3044 3064 sFileForReading = self.oTstDrv.getGuestSystemFileForReading(oTestVm); 3045 3065 if oTestVm.isWindows() or oTestVm.isOS2(): … … 3101 3121 [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '/C', 'dir', '/S', 'stdouterr-non-existing' ]), 3102 3122 tdTestResultExec(fRc = True, iExitCode = 1) ], 3123 # Current working directory set (VBox >= 7.1). 3124 [ tdTestExec(sCmd = sImageOut, sCwd = sTempDir, asArgs = [ sImageOut, '/C', 'dir', '/S', sSystemDir ]), 3125 tdTestResultExec(fRc = True) ], 3103 3126 ]; 3104 3127 # atExec.extend([ … … 3150 3173 [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, 'stdouterr-non-existing' ]), 3151 3174 tdTestResultExec(fRc = True, iExitCode = 2) ], 3175 # Current working directory set (VBox >= 7.1). 3176 [ tdTestExec(sCmd = sImageOut, sCwd = sTempDir, asArgs = [ sImageOut, '-R', sSystemDir ]), 3177 tdTestResultExec(fRc = True) ], 3152 3178 ]; 3153 3179 # atExec.extend([ … … 3392 3418 afFlags = []; 3393 3419 try: 3394 oGuestProcess = oGuestSession.processCreate(sImage, 3395 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], aEnv, afFlags, 3396 30 * 1000); 3420 if self.oTstDrv.fpApiVer >= 7.1: 3421 oGuestProcess = oGuestSession.processCreate(sImage, "", 3422 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], aEnv, afFlags, 3423 30 * 1000); 3424 else: 3425 oGuestProcess = oGuestSession.processCreate(sImage, 3426 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], aEnv, afFlags, 3427 30 * 1000); 3397 3428 except: 3398 3429 fRc = reporter.error('Failed to start shell process (%s)' % (sImage,)); … … 3508 3539 fRc = True; 3509 3540 try: 3510 oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], 3511 [], [], 30 * 1000); 3541 if self.oTstDrv.fpApiVer >= 7.1: 3542 oCurProcess = oGuestSession.processCreate(sShell, "", [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], 3543 [], [], 30 * 1000); 3544 else: 3545 oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], 3546 [], [], 30 * 1000); 3512 3547 except: 3513 3548 fRc = reporter.errorXcpt(); … … 3546 3581 # 3547 3582 try: 3548 oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], 3583 if self.oTstDrv.fpApiVer >= 7.1: 3584 oCurProcess = oGuestSession.processCreate(sShell, "", [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], 3549 3585 [], [], 3 * 1000); 3586 else: 3587 oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], 3588 [], [], 3 * 1000); 3550 3589 except: 3551 3590 fRc = reporter.errorXcpt(); … … 5538 5577 5539 5578 for _ in xrange(100): 5540 oProc = oGuestSession.processCreate(sCmd, asArgs if self.fpApiVer >= 5.0 else asArgs[1:],5579 oProc = oGuestSession.processCreate(sCmd, "", asArgs if self.fpApiVer >= 5.0 else asArgs[1:], 5541 5580 aEnv, afFlags, 30 * 1000); 5542 5581
Note:
See TracChangeset
for help on using the changeset viewer.