VirtualBox

Ignore:
Timestamp:
Aug 31, 2018 2:47:37 PM (6 years ago)
Author:
vboxsync
Message:

Main: bugref:9231: added ability to set IMedium:location for medium moved by user

Location:
trunk/src/VBox/ValidationKit/tests/api
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium1.py

    r72732 r74003  
    6666    #
    6767
    68     def setLocation(self, sLocation, aoMediumAttachments):
     68    def moveTo(self, sLocation, aoMediumAttachments):
    6969        for oAttachment in aoMediumAttachments:
    7070            try:
     
    7474                reporter.errorXcpt('failed to get the medium from the IMediumAttachment "%s"' % (oAttachment))
    7575
    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
    8189
    8290            oProgress.wait()
     
    149157            aoMediumAttachments = oVM.getMediumAttachmentsOfController(sController)
    150158            #case 1. Only path without file name, with trailing separator
    151             fRc = self.setLocation(sNewLoc + os.sep, aoMediumAttachments) and fRc
     159            fRc = self.moveTo(sNewLoc + os.sep, aoMediumAttachments) and fRc
    152160            fRc = self.checkLocation(sNewLoc, aoMediumAttachments, asFiles) and fRc
    153161
    154162            #case 2. Only path without file name, without trailing separator
    155             fRc = self.setLocation(sOrigLoc, aoMediumAttachments) and fRc
     163            fRc = self.moveTo(sOrigLoc, aoMediumAttachments) and fRc
    156164            fRc = self.checkLocation(sOrigLoc, aoMediumAttachments, asFiles) and fRc
    157165
     
    162170            #and the file name is processed as folder name (aka mv(1) logic).
    163171            #Be discussed.
    164             fRc = self.setLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments) and fRc
     172            fRc = self.moveTo(os.path.join(sNewLoc, 'newName'), aoMediumAttachments) and fRc
    165173            asNewFiles = ['newName' + os.path.splitext(s)[1] for s in asFiles]
    166174            fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments, asFiles) and fRc
     
    170178
    171179            #case 4. Only file name
    172             fRc = self.setLocation('onlyMediumName', aoMediumAttachments) and fRc
     180            fRc = self.moveTo('onlyMediumName', aoMediumAttachments) and fRc
    173181            asNewFiles = ['onlyMediumName' + os.path.splitext(s)[1] for s in asFiles]
    174182            if self.oTstDrv.fpApiVer >= 5.3:
     
    183191                aoMediumAttachments = oVM.getMediumAttachmentsOfController(sController)
    184192                asSnapFiles = [os.path.basename(o.medium.name) for o in aoMediumAttachments]
    185                 fRc = self.setLocation(sOrigLoc, aoMediumAttachments) and fRc
     193                fRc = self.moveTo(sOrigLoc, aoMediumAttachments) and fRc
    186194                fRc = self.checkLocation(sOrigLoc, aoMediumAttachments, asSnapFiles) and fRc
    187195
  • trunk/src/VBox/ValidationKit/tests/api/tdMoveVM1.py

    r72742 r74003  
    287287        aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
    288288        oSubTstDrvMoveMedium1Instance = SubTstDrvMoveMedium1(self.oTstDrv)
    289         oSubTstDrvMoveMedium1Instance.setLocation(sOldLoc, aoMediumAttachments)
     289        oSubTstDrvMoveMedium1Instance.moveTo(sOldLoc, aoMediumAttachments)
    290290
    291291        del oSubTstDrvMoveMedium1Instance
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette