Changeset 97418 in vbox for trunk/src/VBox/ValidationKit/tests/additions
- Timestamp:
- Nov 6, 2022 10:47:52 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r97401 r97418 4869 4869 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst), tdTestResultFailure() ], 4870 4870 # Same existing host directory, but this time with DirectoryCopyFlag_CopyIntoExisting set. 4871 # This should copy the contents of oEmptyDirGst to sScratchDstDir1 Hst (empty, but anyway).4871 # This should copy the contents of oEmptyDirGst to sScratchDstDir1Gst (empty, but anyway). 4872 4872 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst, 4873 4873 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], … … 4876 4876 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4877 4877 # With a trailing slash added to the destination, copy the empty guest directory 4878 # (should end up as sScratch Hst/empty):4879 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir 1Gst + os.path.sep), tdTestResultSuccess() ],4878 # (should end up as sScratchDstDir2Gst/empty): 4879 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + os.path.sep), tdTestResultSuccess() ], 4880 4880 # Repeat -- this time it should fail, as the destination directory already exists (and 4881 4881 # DirectoryCopyFlag_CopyIntoExisting is not specified): 4882 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir 1Gst + os.path.sep), tdTestResultFailure() ],4883 # Add the DirectoryCopyFlag_CopyIntoExisting flag being set and it should work .4884 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir 1Gst + 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, 4885 4885 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4886 4886 # Copy with a different destination name just for the heck of it: 4887 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = oTestVm.pathJoin(sScratchDstDir 1Gst, 'empty2')),4887 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = oTestVm.pathJoin(sScratchDstDir2Gst, 'empty2')), 4888 4888 tdTestResultSuccess() ], 4889 4889 ]); 4890 4890 atTests.extend([ 4891 4891 # Now the same using a directory with files in it: 4892 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir 2Gst,4892 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst, 4893 4893 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4894 4894 # Again. 4895 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir 2Gst,4895 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst, 4896 4896 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4897 4897 ]); 4898 4898 atTests.extend([ 4899 4899 # Copy the entire test tree: 4900 [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir 3Gst + os.path.sep), tdTestResultSuccess() ],4900 [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir4Gst + os.path.sep), tdTestResultSuccess() ], 4901 4901 # 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() ], 4903 4906 ]); 4904 4907 … … 4942 4945 sScratchDstDir2Hst = os.path.join(sScratchHst, "dstdir2"); 4943 4946 sScratchDstDir3Hst = os.path.join(sScratchHst, "dstdir3"); 4947 sScratchDstDir4Hst = os.path.join(sScratchHst, "dstdir4"); 4944 4948 oExistingFileGst = self.oTestFiles.chooseRandomFile(); 4945 4949 oNonEmptyDirGst = self.oTestFiles.chooseRandomDirFromTree(fNonEmpty = True); … … 4967 4971 reporter.log2('Creating host sub dirs ...'); 4968 4972 4969 for sSubDir in (sScratchDstDir1Hst, sScratchDstDir2Hst, sScratchDstDir3Hst ):4973 for sSubDir in (sScratchDstDir1Hst, sScratchDstDir2Hst, sScratchDstDir3Hst, sScratchDstDir4Hst): 4970 4974 try: 4971 4975 os.mkdir(sSubDir); … … 5064 5068 # With a trailing slash added to the destination, copy the empty guest directory 5065 5069 # (should end up as sScratchHst/empty): 5066 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir 1Hst + os.path.sep), tdTestResultSuccess() ],5070 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir2Hst + os.path.sep), tdTestResultSuccess() ], 5067 5071 # Repeat -- this time it should fail, as the destination directory already exists (and 5068 5072 # DirectoryCopyFlag_CopyIntoExisting is not specified): 5069 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir 1Hst + os.path.sep), tdTestResultFailure() ],5070 # Add the DirectoryCopyFlag_CopyIntoExisting flag being set and it should work .5071 [ tdTestCopyFromDir(oSrc = oEmptyDirGst, sDst = sScratchDstDir 1Hst + 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, 5072 5076 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 5073 5077 # Copy with a different destination name just for the heck of it: 5074 [ tdTestCopyFromDir(sSrc = oEmptyDirGst.sPath, sDst = os.path.join(sScratch Hst, 'empty2'), fIntoDst = True),5078 [ tdTestCopyFromDir(sSrc = oEmptyDirGst.sPath, sDst = os.path.join(sScratchDstDir2Hst, 'empty2'), fIntoDst = True), 5075 5079 tdTestResultSuccess() ], 5076 5080 ]); 5077 5081 atTests.extend([ 5078 5082 # Now the same using a directory with files in it: 5079 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir 2Hst + os.path.sep), tdTestResultSuccess() ],5083 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir3Hst + os.path.sep), tdTestResultSuccess() ], 5080 5084 # Again. 5081 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir 2Hst, fIntoDst = True,5085 [ tdTestCopyFromDir(oSrc = oNonEmptyDirGst, sDst = sScratchDstDir3Hst, fIntoDst = True, 5082 5086 afFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 5083 5087 ]); 5084 5088 atTests.extend([ 5085 5089 # Copy the entire test tree: 5086 [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir 3Hst + os.path.sep), tdTestResultSuccess() ],5090 [ tdTestCopyFromDir(oSrc = oTreeDirGst, sDst = sScratchDstDir4Hst + os.path.sep), tdTestResultSuccess() ], 5087 5091 # 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() ], 5089 5096 ]); 5090 5097
Note:
See TracChangeset
for help on using the changeset viewer.