Changeset 92868 in vbox
- Timestamp:
- Dec 10, 2021 9:58:58 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r92822 r92868 1878 1878 """ 1879 1879 Helper function to copy a single file from the host to the guest. 1880 1881 afFlags is either None or an array of vboxcon.DirectoryCopyFlag_Xxxx values. 1880 1882 """ 1881 1883 reporter.log2('Copying host file "%s" to guest "%s" (flags %s)' % (limitString(sSrc), limitString(sDst), afFlags)); … … 1906 1908 """ 1907 1909 Helper function to copy a directory (tree) from the host to the guest. 1910 1911 afFlags is either None or an array of vboxcon.DirectoryCopyFlag_Xxxx values. 1908 1912 """ 1909 1913 reporter.log2('Copying host directory "%s" to guest "%s" (flags %s)' % (limitString(sSrc), limitString(sDst), afFlags)); … … 1911 1915 if self.oTstDrv.fpApiVer >= 7.0: 1912 1916 ## @todo Make the following new flags implicit for 7.0 for now. Develop dedicated tests for this later and remove. 1913 if vboxcon.DirectoryCopyFlag_Recursive not in afFlags: 1914 afFlags.extend([ vboxcon.DirectoryCopyFlag_Recursive ]); 1917 if not afFlags: 1918 afFlags = [ vboxcon.DirectoryCopyFlag_Recursive, ]; 1919 elif vboxcon.DirectoryCopyFlag_Recursive not in afFlags: 1920 afFlags.append(vboxcon.DirectoryCopyFlag_Recursive); 1915 1921 ## @todo Ditto. 1916 if vboxcon.DirectoryCopyFlag_FollowLinks not in afFlags: 1917 afFlags.extend([ vboxcon.DirectoryCopyFlag_FollowLinks ]); 1922 if not afFlags: 1923 afFlags = [vboxcon.DirectoryCopyFlag_FollowLinks,]; 1924 elif vboxcon.DirectoryCopyFlag_FollowLinks not in afFlags: 1925 afFlags.append(vboxcon.DirectoryCopyFlag_FollowLinks); 1918 1926 oCurProgress = oGuestSession.directoryCopyToGuest(sSrc, sDst, afFlags); 1919 1927 except: … … 4651 4659 [ tdTestCopyToDir( sDst = sScratchGst), tdTestResultFailure() ], 4652 4660 # Both given, but invalid flags. 4653 [ tdTestCopyToFile(sSrc = sBigFileHst, sDst = sScratchGst, afFlags = [ 0x40000000 ] ), tdTestResultFailure() ],4654 [ tdTestCopyToDir( sSrc = sScratchEmptyDirHst, sDst = sScratchGst, afFlags = [ 0x40000000 ] ),4661 [ tdTestCopyToFile(sSrc = sBigFileHst, sDst = sScratchGst, afFlags = [ 0x40000000, ] ), tdTestResultFailure() ], 4662 [ tdTestCopyToDir( sSrc = sScratchEmptyDirHst, sDst = sScratchGst, afFlags = [ 0x40000000, ] ), 4655 4663 tdTestResultFailure() ], 4656 4664 ]; … … 4721 4729 atTests.extend([ 4722 4730 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst, 4723 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), tdTestResultSuccess() ],4731 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4724 4732 # Try again. 4725 4733 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst, 4726 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), tdTestResultSuccess() ],4734 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4727 4735 # Should fail, as destination directory already exists. 4728 4736 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir1Gst), tdTestResultFailure() ], 4729 4737 # Try again with trailing slash, should yield the same result: 4730 4738 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + oTestVm.pathSep(), 4731 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), tdTestResultSuccess() ],4739 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4732 4740 # Try again. 4733 4741 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + oTestVm.pathSep(), 4734 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), tdTestResultSuccess() ],4742 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4735 4743 # Should fail, as destination directory already exists. 4736 4744 [ tdTestCopyToDir(sSrc = sScratchEmptyDirHst, sDst = sScratchDstDir2Gst + oTestVm.pathSep()), … … 4744 4752 # Now the same using a directory with files in it: 4745 4753 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst, 4746 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), tdTestResultSuccess() ],4754 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4747 4755 # Again. 4748 4756 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst, 4749 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), tdTestResultSuccess() ],4757 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4750 4758 # Should fail, as directory is existing already. 4751 4759 [ tdTestCopyToDir(sSrc = sScratchNonEmptyDirHst, sDst = sScratchDstDir3Gst), tdTestResultFailure() ], … … 4754 4762 # Copy the entire test tree: 4755 4763 [ tdTestCopyToDir(sSrc = sScratchTreeDirHst, sDst = sScratchDstDir4Gst, 4756 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), tdTestResultSuccess() ],4764 afFlags = [vboxcon.DirectoryCopyFlag_CopyIntoExisting, ]), tdTestResultSuccess() ], 4757 4765 ]); 4758 4766
Note:
See TracChangeset
for help on using the changeset viewer.