- Timestamp:
- Jul 27, 2020 9:32:26 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/api/tdMoveVm1.py
r82968 r85464 51 51 52 52 53 # @todo r=aeichner: The whole path handling/checking needs fixing to also work on Windows 54 # The current quick workaround is to spill os.path.normcase() all over the place when 55 # constructing paths. I'll leave the real fix to the original author... 53 56 class SubTstDrvMoveVm1(base.SubTestDriverBase): 54 57 """ … … 198 201 aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sValue) ##@todo r=bird: API call, try-except! 199 202 for oAttachment in aoMediumAttachments: 200 aActuals.add(o Attachment.medium.location)203 aActuals.add(os.path.normcase(oAttachment.medium.location)) 201 204 202 205 elif sKey == 'SnapshotFile': … … 209 212 aReferences = dsReferenceFiles[sKey] 210 213 if aReferences: 211 aActuals.add(o Machine.settingsFilePath)214 aActuals.add(os.path.normcase(oMachine.settingsFilePath)) 212 215 213 216 # Check saved state files location … … 234 237 235 238 reporter.log('####### Reference locations: #######') 236 for eachItem in a References:239 for eachItem in aActuals: 237 240 reporter.log(' "%s"' % (eachItem)) 238 241 … … 256 259 def __getStatesFiles(self, oMachine, fPrint = False): 257 260 asStateFilesList = set() 258 sFolder = oMachine.snapshotFolder 261 sFolder = oMachine.snapshotFolder; 259 262 for sFile in self.__safeListDir(sFolder): 260 263 if sFile.endswith(".sav"): 261 sFullPath = os.path. join(sFolder, sFile)264 sFullPath = os.path.normcase(os.path.join(sFolder, sFile)); 262 265 asStateFilesList.add(sFullPath) 263 266 if fPrint is True: … … 270 273 for sFile in self.__safeListDir(sFolder): 271 274 if sFile.endswith(".sav") is False: 272 sFullPath = os.path. join(sFolder, sFile)275 sFullPath = os.path.normcase(os.path.join(sFolder, sFile)); 273 276 asSnapshotsFilesList.add(sFullPath) 274 277 if fPrint is True: … … 281 284 for sFile in self.__safeListDir(sFolder): 282 285 if sFile.endswith(".log"): 283 sFullPath = os.path. join(sFolder, sFile)286 sFullPath = os.path.normcase(os.path.join(sFolder, sFile)); 284 287 asLogFilesList.add(sFullPath) 285 288 if fPrint is True: … … 305 308 for s in self.asImagesNames: 306 309 reporter.log('"%s"' % (s,)) 307 dsReferenceFiles['StandardImage'].add( sNewLoc + os.sep + oMachine.name + os.sep + s)310 dsReferenceFiles['StandardImage'].add(os.path.normcase(sNewLoc + os.sep + oMachine.name + os.sep + s)) 308 311 309 312 sSettingFile = os.path.join(sNewLoc, os.path.join(oMachine.name, oMachine.name + '.vbox')) 310 dsReferenceFiles['SettingsFile'].add( sSettingFile)313 dsReferenceFiles['SettingsFile'].add(os.path.normcase(sSettingFile)) 311 314 312 315 fRc = self.moveVMToLocation(sNewLoc, oSession.o.machine) … … 347 350 for oAttachment in aoMediumAttachments: 348 351 sRes = oAttachment.medium.location.rpartition(os.sep) 349 dsReferenceFiles['SnapshotFile'].add( sNewLoc + os.sep + oMachine.name + os.sep +350 'Snapshots' + os.sep + sRes[2]) 352 dsReferenceFiles['SnapshotFile'].add(os.path.normcase(sNewLoc + os.sep + oMachine.name + os.sep + 353 'Snapshots' + os.sep + sRes[2])) 351 354 352 355 sSettingFile = os.path.join(sNewLoc, os.path.join(oMachine.name, oMachine.name + '.vbox')) 353 dsReferenceFiles['SettingsFile'].add( sSettingFile)356 dsReferenceFiles['SettingsFile'].add(os.path.normcase(sSettingFile)) 354 357 355 358 fRc = self.moveVMToLocation(sNewLoc, oSession.o.machine) … … 403 406 for sFile in asLogs: 404 407 sRes = sFile.rpartition(os.sep) 405 dsReferenceFiles['LogFile'].add(sNewLoc + os.sep + oMachine.name + os.sep + 'Logs' + os.sep + sRes[2]) 408 dsReferenceFiles['LogFile'].add(os.path.normcase(sNewLoc + os.sep + oMachine.name + os.sep + 409 'Logs' + os.sep + sRes[2])) 406 410 407 411 asStates = self.__getStatesFiles(oMachine) 408 412 for sFile in asStates: 409 413 sRes = sFile.rpartition(os.sep) 410 dsReferenceFiles['SavedStateFile'].add(sNewLoc + os.sep + oMachine.name + os.sep + 'Snapshots' + os.sep + sRes[2]) 414 dsReferenceFiles['SavedStateFile'].add(os.path.normcase(sNewLoc + os.sep + oMachine.name + os.sep + 415 'Snapshots' + os.sep + sRes[2])) 411 416 412 417 fRc = self.moveVMToLocation(sNewLoc, oSession.o.machine) … … 472 477 iPort = len(aoMediumAttachments) 473 478 fRc = oSession.attachDvd(sISOLoc, sController, iPort, iDevice = 0) 474 dsReferenceFiles['ISOImage'].add(os.path. join(os.path.join(sNewLoc, oMachine.name), sISOImageName))479 dsReferenceFiles['ISOImage'].add(os.path.normcase(os.path.join(os.path.join(sNewLoc, oMachine.name), sISOImageName))) 475 480 476 481 if fRc is True: … … 532 537 sController=self.dsKeys['FloppyImage'] 533 538 fRc = fRc and oSession.attachFloppy(sFloppyLoc, sController, 0, 0) 534 dsReferenceFiles['FloppyImage'].add(os.path. join(os.path.join(sNewLoc, oMachine.name), sFloppyImageName))539 dsReferenceFiles['FloppyImage'].add(os.path.normcase(os.path.join(os.path.join(sNewLoc, oMachine.name), sFloppyImageName))) 535 540 536 541 if fRc is True: … … 626 631 for s in self.asImagesNames: 627 632 reporter.log('"%s"' % (s,)) 628 dsReferenceFiles['StandardImage'].add(os.path. join(sOrigLoc, s))629 630 sSettingFile = os.path. join(sNewLoc, os.path.join(oMachine.name, oMachine.name + '.vbox'))633 dsReferenceFiles['StandardImage'].add(os.path.normcase(os.path.join(sOrigLoc, s))) 634 635 sSettingFile = os.path.normcase(os.path.join(sNewLoc, os.path.join(oMachine.name, oMachine.name + '.vbox'))) 631 636 dsReferenceFiles['SettingsFile'].add(sSettingFile) 632 637
Note:
See TracChangeset
for help on using the changeset viewer.