Changeset 97395 in vbox for trunk/src/VBox/ValidationKit/tests/additions
- Timestamp:
- Nov 4, 2022 11:17:21 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r96407 r97395 4865 4865 if self.oTstDrv.fpApiVer > 5.2: # Copying directories via Main is supported only in versions > 5.2. 4866 4866 atTests.extend([ 4867 # Without a trailing slash added to the destination this should fail, 4868 # as the destination directory already exist. 4869 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst), tdTestResultFailure() ], 4870 # Same existing host directory, but this time with DirectoryCopyFlag_CopyIntoExisting set. 4871 # This should copy the contents of oEmptyDirGst to sScratchDstDir1Hst (empty, but anyway). 4867 4872 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst, 4868 4873 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], … … 4870 4875 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst, 4871 4876 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4872 # Should fail, as destination directory already exists. 4873 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst), tdTestResultFailure() ], 4874 # Try again with trailing slash, should yield the same result: 4875 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + oTestVm.pathSep(), 4876 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4877 # Try again. 4878 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + oTestVm.pathSep(), 4879 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4880 # Should fail, as destination directory already exists. 4881 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + oTestVm.pathSep()), 4882 tdTestResultFailure() ], 4877 # 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() ], 4880 # Repeat -- this time it should fail, as the destination directory already exists (and 4881 # 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, 4885 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4883 4886 # Copy with a different destination name just for the heck of it: 4884 # disabled at the moment, causes test failures due to the non-existing target 4885 #[ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = oTestVm.pathJoin(sScratchDstDir1Gst, 'empty2')), 4886 # tdTestResultSuccess() ], 4887 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = oTestVm.pathJoin(sScratchDstDir1Gst, 'empty2')), 4888 tdTestResultSuccess() ], 4887 4889 ]); 4888 4890 atTests.extend([ 4889 4891 # Now the same using a directory with files in it: 4890 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir 3Gst,4891 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), 4892 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir2Gst, 4893 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4892 4894 # Again. 4893 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst, 4894 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4895 # Should fail, as directory is existing already. 4896 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst), tdTestResultFailure() ], 4895 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir2Gst, 4896 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4897 4897 ]); 4898 4898 atTests.extend([ 4899 4899 # Copy the entire test tree: 4900 [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir4Gst, 4901 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4900 [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir3Gst + os.path.sep), tdTestResultSuccess() ], 4901 # Again, should fail this time. 4902 [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir3Gst + os.path.sep), tdTestResultFailure() ], 4902 4903 ]); 4903 4904 … … 4943 4944 oExistingFileGst = self.oTestFiles.chooseRandomFile(); 4944 4945 oNonEmptyDirGst = self.oTestFiles.chooseRandomDirFromTree(fNonEmpty = True); 4946 oTreeDirGst = self.oTestFiles.oTreeDir; 4945 4947 oEmptyDirGst = self.oTestFiles.oEmptyDir; 4946 4948 … … 5050 5052 # 5051 5053 atTests.extend([ 5052 # Copy the empty guest directory (should end up as sScratchHst/empty): 5053 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst), tdTestResultSuccess() ], 5054 # Without a trailing slash added to the destination this should fail, 5055 # as the destination directory already exist. 5056 [ tdTestCopyFromDir(sSrc = oEmptyDirGst.sPath, sDst = sScratchDstDir1Hst), tdTestResultFailure() ], 5057 # Same existing host directory, but this time with DirectoryCopyFlag_CopyIntoExisting set. 5058 # This should copy the contents of oEmptyDirGst to sScratchDstDir1Hst (empty, but anyway). 5059 [ tdTestCopyFromDir(sSrc = oEmptyDirGst.sPath, sDst = sScratchDstDir1Hst, 5060 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 5061 # Try again. 5062 [ tdTestCopyFromDir(sSrc = oEmptyDirGst.sPath, sDst = sScratchDstDir1Hst, 5063 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 5064 # With a trailing slash added to the destination, copy the empty guest directory 5065 # (should end up as sScratchHst/empty): 5066 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep), tdTestResultSuccess() ], 5054 5067 # Repeat -- this time it should fail, as the destination directory already exists (and 5055 5068 # DirectoryCopyFlag_CopyIntoExisting is not specified): 5056 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst ), tdTestResultFailure() ],5069 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep), tdTestResultFailure() ], 5057 5070 # Add the DirectoryCopyFlag_CopyIntoExisting flag being set and it should work. 5058 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst,5059 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ],5060 # Try again with trailing slash, should yield the same result:5061 [ tdTestRemoveHostDir(os.path.join(sScratchDstDir1Hst, 'empty')), tdTestResult() ],5062 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep),5063 tdTestResultSuccess() ],5064 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep),5065 tdTestResultFailure() ],5066 5071 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir1Hst + os.path.sep, 5067 5072 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 5068 5073 # Copy with a different destination name just for the heck of it: 5069 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = os.path.join(sScratchHst, 'empty2'), fIntoDst = True), 5070 tdTestResultFailure() ], 5071 ## bird 2021-12-15: These seems to be failing a lot, so I've temporarily disabled them. Please debug and re-enable. 5072 ## # Now the same using a directory with files in it: 5073 ## [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst), tdTestResultSuccess() ], 5074 ## [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst), tdTestResultFailure() ], 5075 ## [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst, 5076 ## afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 5077 ## # Copy the entire test tree: 5078 ## [ tdTestCopyFromDir(sSrc = self.oTestFiles.oTreeDir.sPath, sDst = sScratchDstDir3Hst), tdTestResultSuccess() ], 5074 [ tdTestCopyFromDir(sSrc = oEmptyDirGst.sPath, sDst = os.path.join(sScratchHst, 'empty2'), fIntoDst = True), 5075 tdTestResultSuccess() ], 5076 ]); 5077 atTests.extend([ 5078 # Now the same using a directory with files in it: 5079 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst + os.path.sep), tdTestResultSuccess() ], 5080 # Again. 5081 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir2Hst, fIntoDst = True, 5082 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 5083 ]); 5084 atTests.extend([ 5085 # Copy the entire test tree: 5086 [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir3Hst + os.path.sep), tdTestResultSuccess() ], 5087 # Again, should fail this time. 5088 [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir3Hst + os.path.sep), tdTestResultFailure() ], 5079 5089 ]); 5080 5090
Note:
See TracChangeset
for help on using the changeset viewer.