Changeset 71668 in vbox for trunk/src/VBox/ValidationKit/tests
- Timestamp:
- Apr 4, 2018 5:07:39 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r71646 r71668 928 928 'dir_create', 'dir_create_temp', 'dir_read', 929 929 'file_remove', 'file_stat', 'file_read', 'file_write', 930 #'copy_to', 931 #'copy_from', 930 'copy_to', 'copy_from', 932 931 'update_additions' 933 932 ]; … … 1101 1100 except: 1102 1101 reporter.logXcpt('Waiting exception for sSrc="%s", sDst="%s":' % (sSrc, sDst)); 1103 fRc = False;1102 fRc = False; 1104 1103 else: 1105 1104 reporter.error('No progress object returned'); … … 3165 3164 aFlags = [ 1234 ] ), 3166 3165 tdTestResult(fRc = False) ], 3166 # Testing DirectoryCopyFlag flags. 3167 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO, 3168 sDst = 'Whatever', aFlags = [ 1234 ] ), 3169 tdTestResult(fRc = False) ], 3170 # Testing FileCopyFlag flags. 3171 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO, 3172 sDst = 'Whatever', aFlags = [ 1234 ] ), 3173 tdTestResult(fRc = False) ], 3167 3174 # Nothing to copy (source and/or destination is empty). 3168 3175 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = 'z:\\'), 3169 3176 tdTestResult(fRc = False) ], 3170 3177 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = '\\\\uncrulez\\foo'), 3171 3172 3178 tdTestResult(fRc = False) ], 3173 3179 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = 'non-exist', 3174 3180 sDst = os.path.join(sScratch, 'non-exist.dll')), 3175 3181 tdTestResult(fRc = False) ], 3176 # Copying single files. 3182 3183 # 3184 # Single file handling. 3185 # 3186 3177 3187 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO, 3178 3188 sDst = os.path.join(sScratch, 'C:\\non-exist\\')), … … 3198 3208 sDst = sScratch), 3199 3209 tdTestResult(fRc = True) ], 3200 ## @todo Add testing the CopyTo flags here! 3201 ]); 3202 3210 ]); 3211 3212 # 3213 # Directory handling. 3214 # 3203 3215 if self.oTstDrv.fpApiVer > 5.2: # Copying directories via Main is supported only in versions > 5.2. 3204 3216 if self.oTstDrv.sHost == "win": … … 3283 3295 reporter.log('Scratch path is: %s' % (sScratch,)); 3284 3296 3297 sScratchNotExist = "/does-not-exist"; 3298 3285 3299 aaTests = []; 3286 3300 if oTestVm.isWindows(): … … 3289 3303 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = ''), 3290 3304 tdTestResult(fRc = False) ], 3291 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = ' C:\\Windows',3305 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'Something', 3292 3306 aFlags = [ 1234 ] ), 3293 3307 tdTestResult(fRc = False) ], … … 3295 3309 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sDst = ''), 3296 3310 tdTestResult(fRc = False) ], 3297 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sDst = ' C:\\Windows',3311 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sDst = 'Something', 3298 3312 aFlags = [ 1234 ] ), 3313 tdTestResult(fRc = False) ], 3314 # Testing DirectoryCopyFlag flags. 3315 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32', 3316 sDst = 'Whatever', aFlags = [ 1234 ] ), 3317 tdTestResult(fRc = False) ], 3318 # Testing FileCopyFlag flags. 3319 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32\\ole32.dll', 3320 sDst = 'Whatever', aFlags = [ 1234 ] ), 3299 3321 tdTestResult(fRc = False) ], 3300 3322 # Nothing to copy (sDst is empty / unreachable). … … 3306 3328 sDst = os.path.join(sScratch, 'non-exist.dll')), 3307 3329 tdTestResult(fRc = False) ], 3330 3331 # 3332 # Single file handling. 3333 # 3334 3308 3335 # Copying single files. 3309 3336 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32\\ole32.dll', 3310 sDst = 'C:\\non-exist\\'),3337 sDst = sScratchNotExist), 3311 3338 tdTestResult(fRc = False) ], 3312 3339 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32\\ole32.dll', 3313 sDst = 'C:\\non\\exist\\'), 3314 tdTestResult(fRc = False) ], 3315 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32\\ole32.dll', 3316 sDst = 'C:\\non\\exist\\renamedfile.dll'), 3317 tdTestResult(fRc = False) ], 3340 sDst = os.path.join(sScratchNotExist, 'renamedfile.dll')), 3341 tdTestResult(fRc = False) ], 3342 # Copy over file using a different destination name. 3318 3343 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32\\ole32.dll', 3319 3344 sDst = os.path.join(sScratch, 'renamedfile.dll')), 3320 3345 tdTestResult(fRc = True) ], 3346 # Copy over same file (and overwrite existing one). 3321 3347 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32\\ole32.dll', 3322 3348 sDst = os.path.join(sScratch, 'renamedfile.dll')), 3323 3349 tdTestResult(fRc = True) ], 3324 # Destination is a directory, should fail. 3350 # Destination is a directory with a trailing slash (should work). 3351 # See "cp" syntax. 3352 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32\\ole32.dll', 3353 sDst = sScratch + "/"), 3354 tdTestResult(fRc = True) ], 3355 # Destination is a directory (should fail). 3356 # See "cp" syntax. 3325 3357 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\system32\\ole32.dll', 3326 3358 sDst = sScratch), 3327 tdTestResult(fRc = False) ], 3328 # Copying directories. 3329 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\Web', 3330 sDst = sScratch), 3331 tdTestResult(fRc = True) ] 3332 ## @todo Add testing the CopyFrom aFlags here! 3359 tdTestResult(fRc = False) ] 3333 3360 ]); 3361 3362 # 3363 # Directory handling. 3364 # 3365 if self.oTstDrv.fpApiVer > 5.2: # Copying directories via Main is supported only in versions > 5.2. 3366 aaTests.extend([ 3367 # Copying entire directories (destination is "<sScratch>", which exists, which should fail). 3368 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\Web', 3369 sDst = sScratch), 3370 tdTestResult(fRc = False) ], 3371 # Copying entire directories (destination is "<sScratch>\Web"). 3372 # Should fail, as the corresponding flag is missing. 3373 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\Web', 3374 sDst = sScratch + "/"), 3375 tdTestResult(fRc = False) ], 3376 # Next try with correct flag being set. 3377 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\Web', 3378 sDst = sScratch + "/", aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), 3379 tdTestResult(fRc = True) ], 3380 # Copying contents of directories (destination is "<sScratch>/"). 3381 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'C:\\Windows\\Web\\', 3382 sDst = sScratch + "/", aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), 3383 tdTestResult(fRc = True) ] 3384 ]); 3334 3385 else: 3335 3386 reporter.log('No OS-specific tests for non-Windows yet!'); … … 3347 3398 break; 3348 3399 3400 fRc2 = True; 3401 3349 3402 try: 3350 3403 if self.oTstDrv.fpApiVer >= 5.0: … … 3354 3407 3355 3408 if oFsInfo.type is vboxcon.FsObjType_Directory: 3356 curProgress = curGuestSession.directoryCopyFrom (curTest.sSrc, curTest.sDst, curTest.aFlags);3409 curProgress = curGuestSession.directoryCopyFromGuest(curTest.sSrc, curTest.sDst, curTest.aFlags); 3357 3410 if curProgress is not None: 3358 3411 oProgress = vboxwrappers.ProgressWrapper(curProgress, self.oTstDrv.oVBoxMgr, self.oTstDrv, \
Note:
See TracChangeset
for help on using the changeset viewer.