VirtualBox

Ignore:
Timestamp:
Nov 6, 2022 10:47:52 AM (2 years ago)
Author:
vboxsync
Message:

Validation Kit/Guest Control: More copyfrom / copyto test fixes. ​bugref:10286

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r97401 r97418  
    48694869                [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst),   tdTestResultFailure() ],
    48704870                # Same existing host directory, but this time with DirectoryCopyFlag_CopyIntoExisting set.
    4871                 # This should copy the contents of oEmptyDirGst to sScratchDstDir1Hst (empty, but anyway).
     4871                # This should copy the contents of oEmptyDirGst to sScratchDstDir1Gst (empty, but anyway).
    48724872                [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst,
    48734873                                  afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]),  tdTestResultSuccess() ],
     
    48764876                                  afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]),  tdTestResultSuccess() ],
    48774877                # With a trailing slash added to the destination, copy the empty guest directory
    4878                 # (should end up as sScratchHst/empty):
    4879                 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst + os.path.sep), tdTestResultSuccess() ],
     4878                # (should end up as sScratchDstDir2Gst/empty):
     4879                [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + os.path.sep), tdTestResultSuccess() ],
    48804880                # Repeat -- this time it should fail, as the destination directory already exists (and
    48814881                # DirectoryCopyFlag_CopyIntoExisting is not specified):
    4882                 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst + os.path.sep), tdTestResultFailure() ],
    4883                 # Add the DirectoryCopyFlag_CopyIntoExisting flag being set and it should work.
    4884                 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst + os.path.sep,
     4882                [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + os.path.sep), tdTestResultFailure() ],
     4883                # Add the DirectoryCopyFlag_CopyIntoExisting flag being set and it should work (again).
     4884                [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + os.path.sep,
    48854885                                  afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],
    48864886                # Copy with a different destination name just for the heck of it:
    4887                 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = oTestVm.pathJoin(sScratchDstDir1Gst, 'empty2')),
     4887                [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = oTestVm.pathJoin(sScratchDstDir2Gst, 'empty2')),
    48884888                  tdTestResultSuccess() ],
    48894889            ]);
    48904890            atTests.extend([
    48914891                # Now the same using a directory with files in it:
    4892                 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir2Gst,
     4892                [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst,
    48934893                                  afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],
    48944894                # Again.
    4895                 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir2Gst,
     4895                [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst,
    48964896                                  afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],
    48974897            ]);
    48984898            atTests.extend([
    48994899                # Copy the entire test tree:
    4900                 [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir3Gst + os.path.sep), tdTestResultSuccess() ],
     4900                [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir4Gst + os.path.sep), tdTestResultSuccess() ],
    49014901                # Again, should fail this time.
    4902                 [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir3Gst + os.path.sep), tdTestResultFailure() ],
     4902                [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir4Gst + os.path.sep), tdTestResultFailure() ],
     4903                # Works again, as DirectoryCopyFlag_CopyIntoExisting is specified.
     4904                [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir4Gst + os.path.sep,
     4905                                  afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],
    49034906            ]);
    49044907
     
    49424945        sScratchDstDir2Hst      = os.path.join(sScratchHst, "dstdir2");
    49434946        sScratchDstDir3Hst      = os.path.join(sScratchHst, "dstdir3");
     4947        sScratchDstDir4Hst      = os.path.join(sScratchHst, "dstdir4");
    49444948        oExistingFileGst        = self.oTestFiles.chooseRandomFile();
    49454949        oNonEmptyDirGst         = self.oTestFiles.chooseRandomDirFromTree(fNonEmpty = True);
     
    49674971        reporter.log2('Creating host sub dirs ...');
    49684972
    4969         for sSubDir in (sScratchDstDir1Hst, sScratchDstDir2Hst, sScratchDstDir3Hst):
     4973        for sSubDir in (sScratchDstDir1Hst, sScratchDstDir2Hst, sScratchDstDir3Hst, sScratchDstDir4Hst):
    49704974            try:
    49714975                os.mkdir(sSubDir);
     
    50645068                # With a trailing slash added to the destination, copy the empty guest directory
    50655069                # (should end up as sScratchHst/empty):
    5066                 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep), tdTestResultSuccess() ],
     5070                [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir2Hst + os.path.sep), tdTestResultSuccess() ],
    50675071                # Repeat -- this time it should fail, as the destination directory already exists (and
    50685072                # DirectoryCopyFlag_CopyIntoExisting is not specified):
    5069                 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep), tdTestResultFailure() ],
    5070                 # Add the DirectoryCopyFlag_CopyIntoExisting flag being set and it should work.
    5071                 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep,
     5073                [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir2Hst + os.path.sep), tdTestResultFailure() ],
     5074                # Add the DirectoryCopyFlag_CopyIntoExisting flag being set and it should work (again).
     5075                [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir2Hst + os.path.sep,
    50725076                                    afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],
    50735077                # Copy with a different destination name just for the heck of it:
    5074                 [ tdTestCopyFromDir(sSrc = oEmptyDirGst.sPath, sDst = os.path.join(sScratchHst, 'empty2'), fIntoDst = True),
     5078                [ tdTestCopyFromDir(sSrc = oEmptyDirGst.sPath, sDst = os.path.join(sScratchDstDir2Hst, 'empty2'), fIntoDst = True),
    50755079                  tdTestResultSuccess() ],
    50765080            ]);
    50775081            atTests.extend([
    50785082                # Now the same using a directory with files in it:
    5079                 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst + os.path.sep), tdTestResultSuccess() ],
     5083                [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir3Hst + os.path.sep), tdTestResultSuccess() ],
    50805084                # Again.
    5081                 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst, fIntoDst = True,
     5085                [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir3Hst, fIntoDst = True,
    50825086                                    afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],
    50835087            ]);
    50845088            atTests.extend([
    50855089                # Copy the entire test tree:
    5086                 [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir3Hst + os.path.sep), tdTestResultSuccess() ],
     5090                [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir4Hst + os.path.sep), tdTestResultSuccess() ],
    50875091                # Again, should fail this time.
    5088                 [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir3Hst + os.path.sep), tdTestResultFailure() ],
     5092                [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir4Hst + os.path.sep), tdTestResultFailure() ],
     5093                # Works again, as DirectoryCopyFlag_CopyIntoExisting is specified.
     5094                [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir4Hst + os.path.sep,
     5095                                    afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],
    50895096            ]);
    50905097
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette