VirtualBox

Ignore:
Timestamp:
Mar 6, 2018 8:55:08 AM (7 years ago)
Author:
vboxsync
Message:

bugref:8345. Added 2 new scenarios.

File:
1 edited

Legend:

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

    r71207 r71225  
    192192        #   There are no any snapshots and logs.
    193193        #   
    194         #3. There are snapshots and logs folder and some files in these folders.
    195         #
    196         #4. There are one or more save state files in the snapshots folder.
     194        #3. There are snapshots.
     195        #
     196        #4. There are one or more save state files in the snapshots folder
     197        #   and some files in the logs folder.
    197198        #
    198199        #5. There is an ISO image (.iso) attached to the VM.
     
    224225            oSession = self.oTstDrv.openSession(aMachine)
    225226            fRc = True
    226             fRc = self.moveVMToLocation(sNewLoc + os.sep, oSession.o.machine) and fRc
     227
     228            sMoveLoc = sNewLoc + os.sep
     229            #1 case.
     230            #   All disks attached to VM are located outside the VM's folder.
     231            #   There are no any snapshots and logs.
     232            #   In this case only VM setting file should be moved (.vbox file)
     233            fRc = self.moveVMToLocation(sMoveLoc, oSession.o.machine) and fRc
     234
     235            fRc = fRc and oSession.saveSettings()
     236            if fRc is False:
     237                reporter.log('Couldn\'t save machine settings')
     238
     239            #2 case.
     240            #   All disks attached to VM are located inside the VM's folder.
     241            #   There are no any snapshots and logs.
     242            sLoc = sMoveLoc + aMachine.name + os.sep
     243            sMoveLoc = os.path.join(sOrigLoc, 'moveFolder_2d_scenario')
     244            os.mkdir(sMoveLoc, 0o775)
     245            aoMediumAttachments = aMachine.getMediumAttachmentsOfController(sController)
     246            SubTstDrvMoveMedium1Instance = SubTstDrvMoveMedium1(self.oTstDrv)
     247            SubTstDrvMoveMedium1Instance.setLocation(sLoc, aoMediumAttachments)
     248            fRc = self.moveVMToLocation(sMoveLoc, oSession.o.machine) and fRc
     249
     250            fRc = fRc and oSession.saveSettings()
     251            if fRc is False:
     252                reporter.log('Couldn\'t save machine settings')
     253
     254            #3 case.
     255            #   There are snapshots.
     256            sLoc = sMoveLoc + aMachine.name + os.sep
     257            sMoveLoc = os.path.join(sOrigLoc, 'moveFolder_3d_scenario')
     258            os.mkdir(sMoveLoc, 0o775)
     259
     260            n = 5
     261            for counter in range(1,n+1):
     262                strSnapshot = 'Snapshot' + str(counter)
     263                fRc = fRc and oSession.takeSnapshot(strSnapshot)
     264                if fRc is False:
     265                    reporter.error('Error: Can\'t take snapshot "%s".' % (strSnapshot,))
     266                    reporter.testFailure('Error: Can\'t take snapshot "%s".' % (strSnapshot,));
     267
     268            aoMediumAttachments = aMachine.getMediumAttachmentsOfController(sController)
     269            if fRc is True:
     270                fRc = self.moveVMToLocation(sMoveLoc, oSession.o.machine) and fRc
    227271
    228272            fRc = fRc and oSession.saveSettings()
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