Changeset 79333 in vbox
- Timestamp:
- Jun 25, 2019 3:15:01 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r79332 r79333 224 224 Test for copying files from the guest to the host. 225 225 """ 226 def __init__(self, sSrc = "", sDst = "", oCreds = None, fFlags = None, oSrc = None):226 def __init__(self, sSrc = "", sDst = "", oCreds = None, afFlags = None, oSrc = None): 227 227 tdTestGuestCtrlBase.__init__(self, oCreds = oCreds); 228 228 self.sSrc = sSrc; 229 229 self.sDst = sDst; 230 self. fFlags =fFlags;230 self.afFlags = afFlags; 231 231 self.oSrc = oSrc # type: testfileset.TestFsObj 232 232 if oSrc and not sSrc: … … 235 235 class tdTestCopyFromDir(tdTestCopyFrom): 236 236 237 def __init__(self, sSrc = "", sDst = "", oCreds = None, fFlags = None, oSrc = None, fIntoDst = False):238 tdTestCopyFrom.__init__(self, sSrc, sDst, oCreds, fFlags, oSrc);237 def __init__(self, sSrc = "", sDst = "", oCreds = None, afFlags = None, oSrc = None, fIntoDst = False): 238 tdTestCopyFrom.__init__(self, sSrc, sDst, oCreds, afFlags, oSrc); 239 239 self.fIntoDst = fIntoDst; # hint to the verification code that sDst == oSrc, rather than sDst+oSrc.sNAme == oSrc. 240 240 … … 266 266 Test for copying files from the host to the guest. 267 267 """ 268 def __init__(self, sSrc = "", sDst = "", oCreds = None, fFlags = None):268 def __init__(self, sSrc = "", sDst = "", oCreds = None, afFlags = None): 269 269 tdTestGuestCtrlBase.__init__(self, oCreds = oCreds); 270 270 self.sSrc = sSrc; 271 271 self.sDst = sDst; 272 self. fFlags =fFlags;272 self.afFlags = afFlags; 273 273 274 274 class tdTestCopyToFile(tdTestCopyTo): … … 282 282 Test for directoryCreate call. 283 283 """ 284 def __init__(self, sDirectory = "", oCreds = None, fMode = 0, fFlags = None):284 def __init__(self, sDirectory = "", oCreds = None, fMode = 0, afFlags = None): 285 285 tdTestGuestCtrlBase.__init__(self, oCreds = oCreds); 286 286 self.sDirectory = sDirectory; 287 287 self.fMode = fMode; 288 self. fFlags =fFlags;288 self.afFlags = afFlags; 289 289 290 290 class tdTestDirCreateTemp(tdTestGuestCtrlBase): … … 303 303 Test for the directoryOpen call. 304 304 """ 305 def __init__(self, sDirectory = "", oCreds = None, sFilter = "", fFlags = None):305 def __init__(self, sDirectory = "", oCreds = None, sFilter = "", afFlags = None): 306 306 tdTestGuestCtrlBase.__init__(self, oCreds = oCreds); 307 307 self.sDirectory = sDirectory; 308 308 self.sFilter = sFilter; 309 self. fFlags =fFlags or [];309 self.afFlags = afFlags or []; 310 310 311 311 class tdTestDirRead(tdTestDirOpen): … … 313 313 Test for the opening, reading and closing a certain directory. 314 314 """ 315 def __init__(self, sDirectory = "", oCreds = None, sFilter = "", fFlags = None):316 tdTestDirOpen.__init__(self, sDirectory, oCreds, sFilter, fFlags);315 def __init__(self, sDirectory = "", oCreds = None, sFilter = "", afFlags = None): 316 tdTestDirOpen.__init__(self, sDirectory, oCreds, sFilter, afFlags); 317 317 318 318 class tdTestExec(tdTestGuestCtrlBase): … … 321 321 Has a default timeout of 5 minutes (for safety). 322 322 """ 323 def __init__(self, sCmd = "", asArgs = None, aEnv = None, fFlags = None, # pylint: disable=too-many-arguments323 def __init__(self, sCmd = "", asArgs = None, aEnv = None, afFlags = None, # pylint: disable=too-many-arguments 324 324 timeoutMS = 5 * 60 * 1000, oCreds = None, fWaitForExit = True): 325 325 tdTestGuestCtrlBase.__init__(self, oCreds = oCreds); … … 327 327 self.asArgs = asArgs if asArgs is not None else [sCmd,]; 328 328 self.aEnv = aEnv; 329 self. fFlags =fFlags or [];329 self.afFlags = afFlags or []; 330 330 self.timeoutMS = timeoutMS; 331 331 self.fWaitForExit = fWaitForExit; … … 1290 1290 """ 1291 1291 Holds a guest process execution test result, 1292 including the exit code, status + fFlags.1292 including the exit code, status + afFlags. 1293 1293 """ 1294 1294 def __init__(self, fRc = False, uExitStatus = 500, iExitCode = 0, sBuf = None, cbBuf = 0, cbStdOut = None, cbStdErr = None): … … 1555 1555 try: 1556 1556 if self.oTstDrv.fpApiVer >= 5.0: 1557 oCurProgress = oGuestSession.fileCopyFromGuest(oTest.sSrc, oTest.sDst, oTest. fFlags);1557 oCurProgress = oGuestSession.fileCopyFromGuest(oTest.sSrc, oTest.sDst, oTest.afFlags); 1558 1558 else: 1559 oCurProgress = oGuestSession.copyFrom(oTest.sSrc, oTest.sDst, oTest. fFlags);1559 oCurProgress = oGuestSession.copyFrom(oTest.sSrc, oTest.sDst, oTest.afFlags); 1560 1560 except: 1561 1561 reporter.maybeErrXcpt(fExpected, 'Copy from exception for sSrc="%s", sDst="%s":' % (oTest.sSrc, oTest.sDst,)); … … 1650 1650 reporter.log2('Copying guest dir "%s" to host "%s"' % (oTest.sSrc, oTest.sDst)); 1651 1651 try: 1652 oCurProgress = oGuestSession.directoryCopyFromGuest(oTest.sSrc, oTest.sDst, oTest. fFlags);1652 oCurProgress = oGuestSession.directoryCopyFromGuest(oTest.sSrc, oTest.sDst, oTest.afFlags); 1653 1653 except: 1654 1654 reporter.maybeErrXcpt(fExpected, 'Copy dir from exception for sSrc="%s", sDst="%s":' % (oTest.sSrc, oTest.sDst,)); … … 1677 1677 return True; 1678 1678 1679 def gctrlCopyFileTo(self, oGuestSession, sSrc, sDst, fFlags, fIsError):1679 def gctrlCopyFileTo(self, oGuestSession, sSrc, sDst, afFlags, fIsError): 1680 1680 """ 1681 1681 Helper function to copy a single file from the host to the guest. 1682 1682 """ 1683 reporter.log2('Copying host file "%s" to guest "%s" (flags %s)' % (sSrc, sDst, fFlags));1683 reporter.log2('Copying host file "%s" to guest "%s" (flags %s)' % (sSrc, sDst, afFlags)); 1684 1684 try: 1685 1685 if self.oTstDrv.fpApiVer >= 5.0: 1686 oCurProgress = oGuestSession.fileCopyToGuest(sSrc, sDst, fFlags);1686 oCurProgress = oGuestSession.fileCopyToGuest(sSrc, sDst, afFlags); 1687 1687 else: 1688 oCurProgress = oGuestSession.copyTo(sSrc, sDst, fFlags);1688 oCurProgress = oGuestSession.copyTo(sSrc, sDst, afFlags); 1689 1689 except: 1690 1690 reporter.maybeErrXcpt(fIsError, 'sSrc=%s sDst=%s' % (sSrc, sDst,)); … … 1705 1705 return True; 1706 1706 1707 def gctrlCopyDirTo(self, oGuestSession, sSrc, sDst, fFlags, fIsError):1707 def gctrlCopyDirTo(self, oGuestSession, sSrc, sDst, afFlags, fIsError): 1708 1708 """ 1709 1709 Helper function to copy a directory tree from the host to the guest. 1710 1710 """ 1711 reporter.log2('Copying host directory "%s" to guest "%s" (flags %s)' % (sSrc, sDst, fFlags));1711 reporter.log2('Copying host directory "%s" to guest "%s" (flags %s)' % (sSrc, sDst, afFlags)); 1712 1712 try: 1713 oCurProgress = oGuestSession.directoryCopyToGuest(sSrc, sDst, fFlags);1713 oCurProgress = oGuestSession.directoryCopyToGuest(sSrc, sDst, afFlags); 1714 1714 except: 1715 1715 reporter.maybeErrXcpt(fIsError, 'sSrc=%s sDst=%s' % (sSrc, sDst,)); … … 1736 1736 reporter.log2('Creating directory "%s"' % (oTest.sDirectory,)); 1737 1737 try: 1738 oGuestSession.directoryCreate(oTest.sDirectory, oTest.fMode, oTest. fFlags);1738 oGuestSession.directoryCreate(oTest.sDirectory, oTest.fMode, oTest.afFlags); 1739 1739 except: 1740 reporter.maybeErrXcpt(oRes.fRc, 'Failed to create "%s" fMode=%o fFlags=%s'1741 % (oTest.sDirectory, oTest.fMode, oTest. fFlags,));1740 reporter.maybeErrXcpt(oRes.fRc, 'Failed to create "%s" fMode=%o afFlags=%s' 1741 % (oTest.sDirectory, oTest.fMode, oTest.afFlags,)); 1742 1742 return not oRes.fRc; 1743 1743 if oRes.fRc is not True: … … 1763 1763 sDir = oTest.sDirectory; 1764 1764 sFilter = oTest.sFilter; 1765 fFlags = oTest.fFlags;1765 afFlags = oTest.afFlags; 1766 1766 oTestVm = oTest.oCreds.oTestVm; 1767 1767 sCurDir = oTestVm.pathJoin(sDir, sSubDir) if sSubDir else sDir; … … 1779 1779 1780 1780 # Open the directory: 1781 #reporter.log2('Directory="%s", filter="%s", fFlags="%s"' % (sCurDir, sFilter,fFlags));1781 #reporter.log2('Directory="%s", filter="%s", afFlags="%s"' % (sCurDir, sFilter, afFlags)); 1782 1782 try: 1783 oCurDir = oGuestSession.directoryOpen(sCurDir, sFilter, fFlags);1783 oCurDir = oGuestSession.directoryOpen(sCurDir, sFilter, afFlags); 1784 1784 except: 1785 reporter.maybeErrXcpt(fIsError, 'sCurDir=%s sFilter=%s fFlags=%s' % (sCurDir, sFilter,fFlags,))1785 reporter.maybeErrXcpt(fIsError, 'sCurDir=%s sFilter=%s afFlags=%s' % (sCurDir, sFilter, afFlags,)) 1786 1786 return (False, 0, 0, 0); 1787 1787 … … 2011 2011 # Start the process: 2012 2012 # 2013 reporter.log2('Executing sCmd=%s, fFlags=%s, timeoutMS=%d, asArgs=%s, asEnv=%s'2014 % (oTest.sCmd, oTest. fFlags, oTest.timeoutMS, oTest.asArgs, oTest.aEnv,));2013 reporter.log2('Executing sCmd=%s, afFlags=%s, timeoutMS=%d, asArgs=%s, asEnv=%s' 2014 % (oTest.sCmd, oTest.afFlags, oTest.timeoutMS, oTest.asArgs, oTest.aEnv,)); 2015 2015 try: 2016 2016 oProcess = oGuestSession.processCreate(oTest.sCmd, 2017 2017 oTest.asArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.asArgs[1:], 2018 oTest.aEnv, oTest. fFlags, oTest.timeoutMS);2018 oTest.aEnv, oTest.afFlags, oTest.timeoutMS); 2019 2019 except: 2020 2020 reporter.maybeErrXcpt(fIsError, 'asArgs=%s' % (oTest.asArgs,)); … … 2053 2053 # What to wait for: 2054 2054 aeWaitFor = [ vboxcon.ProcessWaitForFlag_Terminate, ]; 2055 if vboxcon.ProcessCreateFlag_WaitForStdOut in oTest. fFlags:2055 if vboxcon.ProcessCreateFlag_WaitForStdOut in oTest.afFlags: 2056 2056 aeWaitFor.append(vboxcon.ProcessWaitForFlag_StdOut); 2057 if vboxcon.ProcessCreateFlag_WaitForStdErr in oTest. fFlags:2057 if vboxcon.ProcessCreateFlag_WaitForStdErr in oTest.afFlags: 2058 2058 aeWaitFor.append(vboxcon.ProcessWaitForFlag_StdErr); 2059 2059 ## @todo Add vboxcon.ProcessWaitForFlag_StdIn. … … 2721 2721 # tdTestResultExec(fRc = True, iExitCode = 1) ] 2722 2722 # [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '/C', 'set', 'windir' ], 2723 # fFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),2723 # afFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]), 2724 2724 # tdTestResultExec(fRc = True, sBuf = 'windir=C:\\WINDOWS\r\n') ], 2725 2725 # [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '/C', 'set', 'TEST_FOO' ], 2726 2726 # aEnv = [ 'TEST_FOO=BAR' ], 2727 # fFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),2727 # afFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]), 2728 2728 # tdTestResultExec(fRc = True, sBuf = 'TEST_FOO=BAR\r\n') ], 2729 2729 # [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '/C', 'set', 'TEST_FOO' ], 2730 2730 # aEnv = [ 'TEST_FOO=BAR', 'TEST_BAZ=BAR' ], 2731 # fFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),2731 # afFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]), 2732 2732 # tdTestResultExec(fRc = True, sBuf = 'TEST_FOO=BAR\r\n') ] 2733 2733 … … 2771 2771 # [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '/C', 'set', 'windir' ], 2772 2772 # 2773 # fFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),2773 # afFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]), 2774 2774 # tdTestResultExec(fRc = True, sBuf = 'windir=C:\\WINDOWS\r\n') ], 2775 2775 # [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '/C', 'set', 'TEST_FOO' ], 2776 2776 # aEnv = [ 'TEST_FOO=BAR' ], 2777 # fFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),2777 # afFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]), 2778 2778 # tdTestResultExec(fRc = True, sBuf = 'TEST_FOO=BAR\r\n') ], 2779 2779 # [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '/C', 'set', 'TEST_FOO' ], 2780 2780 # aEnv = [ 'TEST_FOO=BAR', 'TEST_BAZ=BAR' ], 2781 # fFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),2781 # afFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]), 2782 2782 # tdTestResultExec(fRc = True, sBuf = 'TEST_FOO=BAR\r\n') ] 2783 2783 … … 2955 2955 sImage = self.getGuestSystemShell(oTestVm); 2956 2956 asArgs = [ sImage, ]; 2957 aEnv = [];2958 fFlags = [];2957 aEnv = []; 2958 afFlags = []; 2959 2959 try: 2960 2960 oGuestProcess = oGuestSession.processCreate(sImage, 2961 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], aEnv, fFlags,2961 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], aEnv, afFlags, 2962 2962 30 * 1000); 2963 2963 except: … … 3184 3184 [ tdTestDirCreate(sDirectory = sScratch ), tdTestResultSuccess() ], 3185 3185 [ tdTestDirCreate(sDirectory = oTestVm.pathJoin(sScratch, 'foo', 'bar', 'baz'), 3186 fFlags = (vboxcon.DirectoryCreateFlag_Parents,) ), tdTestResultSuccess() ],3186 afFlags = (vboxcon.DirectoryCreateFlag_Parents,) ), tdTestResultSuccess() ], 3187 3187 [ tdTestDirCreate(sDirectory = oTestVm.pathJoin(sScratch, 'foo', 'bar', 'baz'), 3188 fFlags = (vboxcon.DirectoryCreateFlag_Parents,) ), tdTestResultSuccess() ],3188 afFlags = (vboxcon.DirectoryCreateFlag_Parents,) ), tdTestResultSuccess() ], 3189 3189 # Long random names. 3190 3190 [ tdTestDirCreate(sDirectory = oTestVm.pathJoin(sScratch, self.oTestFiles.generateFilenameEx(36, 28))), … … 3312 3312 # Invalid stuff. 3313 3313 [ tdTestDirRead(sDirectory = ''), tdTestResultDirRead() ], 3314 [ tdTestDirRead(sDirectory = sSystemDir, fFlags = [ 1234 ]), tdTestResultDirRead() ],3314 [ tdTestDirRead(sDirectory = sSystemDir, afFlags = [ 1234 ]), tdTestResultDirRead() ], 3315 3315 [ tdTestDirRead(sDirectory = sSystemDir, sFilter = '*.foo'), tdTestResultDirRead() ], 3316 3316 # Non-existing stuff. … … 4373 4373 ## @todo Apparently Main doesn't check the flags, so the first test succeeds. 4374 4374 # Both given, but invalid flags. 4375 [ tdTestCopyToFile(sSrc = sBigFileHst, sDst = sScratchGst, fFlags = [ 0x40000000] ), tdTestResultFailure() ],4376 [ tdTestCopyToDir( sSrc = sScratchEmptyDirHst, sDst = sScratchGst, fFlags = [ 0x40000000] ),4375 [ tdTestCopyToFile(sSrc = sBigFileHst, sDst = sScratchGst, afFlags = [ 0x40000000] ), tdTestResultFailure() ], 4376 [ tdTestCopyToDir( sSrc = sScratchEmptyDirHst, sDst = sScratchGst, afFlags = [ 0x40000000] ), 4377 4377 tdTestResultFailure() ], 4378 4378 ]); … … 4445 4445 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst), tdTestResultFailure() ], 4446 4446 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst, 4447 fFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting]), tdTestResultSuccess() ],4447 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting]), tdTestResultSuccess() ], 4448 4448 # Try again with trailing slash, should yield the same result: 4449 4449 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + oTestVm.pathSep()), … … 4452 4452 tdTestResultFailure() ], 4453 4453 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + oTestVm.pathSep(), 4454 fFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting]),4454 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting]), 4455 4455 tdTestResultSuccess() ], 4456 4456 ]); … … 4469 4469 atTests.extend([ 4470 4470 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst, 4471 fFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting]), tdTestResultSuccess() ],4471 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting]), tdTestResultSuccess() ], 4472 4472 ]); 4473 4473 atTests.extend([ … … 4482 4482 oCurTest = tTest[0]; # tdTestCopyTo 4483 4483 oCurRes = tTest[1]; # tdTestResult 4484 reporter.log('Testing #%d, sSrc=%s, sDst=%s, fFlags=%s ...' % (i, oCurTest.sSrc, oCurTest.sDst, oCurTest.fFlags));4484 reporter.log('Testing #%d, sSrc=%s, sDst=%s, afFlags=%s ...' % (i, oCurTest.sSrc, oCurTest.sDst, oCurTest.afFlags)); 4485 4485 4486 4486 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); … … 4492 4492 fRc2 = False; 4493 4493 if isinstance(oCurTest, tdTestCopyToFile): 4494 fRc2 = self.gctrlCopyFileTo(oCurGuestSession, oCurTest.sSrc, oCurTest.sDst, oCurTest. fFlags, oCurRes.fRc);4494 fRc2 = self.gctrlCopyFileTo(oCurGuestSession, oCurTest.sSrc, oCurTest.sDst, oCurTest.afFlags, oCurRes.fRc); 4495 4495 else: 4496 fRc2 = self.gctrlCopyDirTo(oCurGuestSession, oCurTest.sSrc, oCurTest.sDst, oCurTest. fFlags, oCurRes.fRc);4496 fRc2 = self.gctrlCopyDirTo(oCurGuestSession, oCurTest.sSrc, oCurTest.sDst, oCurTest.afFlags, oCurRes.fRc); 4497 4497 if fRc2 is not oCurRes.fRc: 4498 4498 fRc = reporter.error('Test #%d failed: Got %s, expected %s' % (i, fRc2, oCurRes.fRc)); … … 4559 4559 ## 4560 4560 ## Invalid flags: 4561 #[ tdTestCopyFromFile(oSrc = oExistingFileGst, sDst = os.path.join(sScratchHst, 'somefile'), fFlags = [ 0x40000000]),4561 #[ tdTestCopyFromFile(oSrc = oExistingFileGst, sDst = os.path.join(sScratchHst, 'somefile'), afFlags = [0x40000000]), 4562 4562 # tdTestResultFailure() ], 4563 #[ tdTestCopyFromDir( oSrc = oEmptyDirGst, sDst = os.path.join(sScratchHst, 'somedir'), fFlags = [ 0x40000000] ),4563 #[ tdTestCopyFromDir( oSrc = oEmptyDirGst, sDst = os.path.join(sScratchHst, 'somedir'), afFlags = [ 0x40000000] ), 4564 4564 # tdTestResultFailure() ], 4565 4565 # Non-existing sources: … … 4629 4629 # Add the DirectoryCopyFlag_CopyIntoExisting flag being set and it should work. 4630 4630 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst, 4631 fFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],4631 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4632 4632 # Try again with trailing slash, should yield the same result: 4633 4633 [ tdTestRemoveHostDir(os.path.join(sScratchDstDir1Hst, 'empty')), tdTestResult() ], … … 4637 4637 tdTestResultFailure() ], 4638 4638 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep, 4639 fFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],4639 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4640 4640 # Copy with a different destination name just for the heck of it: 4641 4641 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = os.path.join(sScratchHst, 'empty2'), fIntoDst = True), … … 4645 4645 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst), tdTestResultFailure() ], 4646 4646 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst, 4647 fFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],4647 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4648 4648 # Copy the entire test tree: 4649 4649 [ tdTestCopyFromDir(sSrc = self.oTestFiles.oTreeDir.sPath, sDst = sScratchDstDir3Hst), tdTestResultSuccess() ], … … 4658 4658 oCurRes = tTest[1] # type: tdTestResult 4659 4659 if isinstance(oCurTest, tdTestCopyFrom): 4660 reporter.log('Testing #%d, %s: sSrc="%s", sDst="%s", fFlags="%s" ...'4660 reporter.log('Testing #%d, %s: sSrc="%s", sDst="%s", afFlags="%s" ...' 4661 4661 % (i, "directory" if isinstance(oCurTest, tdTestCopyFromDir) else "file", 4662 oCurTest.sSrc, oCurTest.sDst, oCurTest. fFlags,));4662 oCurTest.sSrc, oCurTest.sDst, oCurTest.afFlags,)); 4663 4663 else: 4664 4664 reporter.log('Testing #%d, tdTestRemoveHostDir "%s" ...' % (i, oCurTest.sDir,)); … … 4683 4683 if fRc2 != oCurRes.fRc: 4684 4684 fRc = reporter.error('Test #%d failed: Got %s, expected %s' % (i, fRc2, oCurRes.fRc)); 4685 fRc2 = False;4686 4685 4687 4686 fRc = oCurTest.closeSession() and fRc;
Note:
See TracChangeset
for help on using the changeset viewer.