Changeset 74003 in vbox for trunk/src/VBox/ValidationKit/tests/api
- Timestamp:
- Aug 31, 2018 2:47:37 PM (6 years ago)
- Location:
- trunk/src/VBox/ValidationKit/tests/api
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium1.py
r72732 r74003 66 66 # 67 67 68 def setLocation(self, sLocation, aoMediumAttachments):68 def moveTo(self, sLocation, aoMediumAttachments): 69 69 for oAttachment in aoMediumAttachments: 70 70 try: … … 74 74 reporter.errorXcpt('failed to get the medium from the IMediumAttachment "%s"' % (oAttachment)) 75 75 76 try: 77 oProgress = vboxwrappers.ProgressWrapper(oMedium.setLocation(sLocation), self.oTstDrv.oVBoxMgr, self.oTstDrv, 78 'move "%s"' % (oMedium.name,)) 79 except: 80 return reporter.errorXcpt('Medium::setLocation("%s") for medium "%s" failed' % (sLocation, oMedium.name,)) 76 if self.oTstDrv.fpApiVer >= 5.3 and self.oTstDrv.uRevision > 124748: 77 try: 78 oProgress = vboxwrappers.ProgressWrapper(oMedium.moveTo(sLocation), self.oTstDrv.oVBoxMgr, self.oTstDrv, 79 'move "%s"' % (oMedium.name,)); 80 except: 81 return reporter.errorXcpt('Medium::moveTo("%s") for medium "%s" failed' % (sLocation, oMedium.name,)); 82 else: 83 try: 84 oProgress = vboxwrappers.ProgressWrapper(oMedium.setLocation(sLocation), self.oTstDrv.oVBoxMgr, self.oTstDrv, 85 'move "%s"' % (oMedium.name,)); 86 except: 87 return reporter.errorXcpt('Medium::setLocation("%s") for medium "%s" failed' % (sLocation, oMedium.name,)); 88 81 89 82 90 oProgress.wait() … … 149 157 aoMediumAttachments = oVM.getMediumAttachmentsOfController(sController) 150 158 #case 1. Only path without file name, with trailing separator 151 fRc = self. setLocation(sNewLoc + os.sep, aoMediumAttachments) and fRc159 fRc = self.moveTo(sNewLoc + os.sep, aoMediumAttachments) and fRc 152 160 fRc = self.checkLocation(sNewLoc, aoMediumAttachments, asFiles) and fRc 153 161 154 162 #case 2. Only path without file name, without trailing separator 155 fRc = self. setLocation(sOrigLoc, aoMediumAttachments) and fRc163 fRc = self.moveTo(sOrigLoc, aoMediumAttachments) and fRc 156 164 fRc = self.checkLocation(sOrigLoc, aoMediumAttachments, asFiles) and fRc 157 165 … … 162 170 #and the file name is processed as folder name (aka mv(1) logic). 163 171 #Be discussed. 164 fRc = self. setLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments) and fRc172 fRc = self.moveTo(os.path.join(sNewLoc, 'newName'), aoMediumAttachments) and fRc 165 173 asNewFiles = ['newName' + os.path.splitext(s)[1] for s in asFiles] 166 174 fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments, asFiles) and fRc … … 170 178 171 179 #case 4. Only file name 172 fRc = self. setLocation('onlyMediumName', aoMediumAttachments) and fRc180 fRc = self.moveTo('onlyMediumName', aoMediumAttachments) and fRc 173 181 asNewFiles = ['onlyMediumName' + os.path.splitext(s)[1] for s in asFiles] 174 182 if self.oTstDrv.fpApiVer >= 5.3: … … 183 191 aoMediumAttachments = oVM.getMediumAttachmentsOfController(sController) 184 192 asSnapFiles = [os.path.basename(o.medium.name) for o in aoMediumAttachments] 185 fRc = self. setLocation(sOrigLoc, aoMediumAttachments) and fRc193 fRc = self.moveTo(sOrigLoc, aoMediumAttachments) and fRc 186 194 fRc = self.checkLocation(sOrigLoc, aoMediumAttachments, asSnapFiles) and fRc 187 195 -
trunk/src/VBox/ValidationKit/tests/api/tdMoveVM1.py
r72742 r74003 287 287 aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController) 288 288 oSubTstDrvMoveMedium1Instance = SubTstDrvMoveMedium1(self.oTstDrv) 289 oSubTstDrvMoveMedium1Instance. setLocation(sOldLoc, aoMediumAttachments)289 oSubTstDrvMoveMedium1Instance.moveTo(sOldLoc, aoMediumAttachments) 290 290 291 291 del oSubTstDrvMoveMedium1Instance
Note:
See TracChangeset
for help on using the changeset viewer.