VirtualBox

Ignore:
Timestamp:
Mar 20, 2018 9:06:31 AM (7 years ago)
Author:
vboxsync
Message:

bugref:8345. Temporarily turned off 5 and 6 scenarios, till the correct handling of the needed resources on the test machines.

File:
1 edited

Legend:

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

    r71379 r71384  
    320320            #There is an ISO image (.iso) attached to the VM.
    321321            #Prerequisites - there is IDE Controller and there are no any images attached to it.
    322             fRc = True
    323             oVirtualBox = self.oTstDrv.oVBoxMgr.getVirtualBox()
    324             oMachine = oVirtualBox.findMachine('test-vm-move')
    325             if oMachine == None:
    326                 reporter.log("Machine '%s' is unknown" % (oMachine.name))
    327                 return False
    328 
    329             del oVirtualBox
    330 
    331             sLoc = sMoveLoc + os.sep + oMachine.name + os.sep
    332             sMoveLoc = os.path.join(sOrigLoc, 'moveFolder_5th_scenario')
    333             os.mkdir(sMoveLoc, 0o775)
    334             sISOLoc = os.path.join(g_ksValidationKitDir + os.sep, 'tests' + os.sep + 'api' + os.sep + 'tdMoveVM.iso')
    335             if not os.path.exists(sISOLoc):
    336                 reporter.log('ISO file does not exist at "%s"' % (sISOLoc,))
    337                 fRc = False
    338 
    339             #attach ISO image to the IDE controller
    340             if fRc is True:
    341                 sController='IDE Controller'
    342                 aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
    343                 iPort = len(aoMediumAttachments)
    344                 reporter.log('sISOLoc "%s", sController "%s", iPort "%s"' % (sISOLoc,sController,iPort))
    345                 fRc = oSession.attachDvd(sISOLoc, sController, iPort, iDevice = 0)
    346 
    347             fRc = fRc and oSession.saveSettings()
    348             if fRc is False:
    349                 reporter.log('Couldn\'t save machine settings')
    350 
    351             reporter.log('fRc after oSession.attachDvd "%s"' % (fRc))
    352 
    353             #move ISO image to the VM settings folder
    354             if fRc is True:
    355                 aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
    356                 reporter.log('number of attachments on IDE Controller is "%s"' % (len(aoMediumAttachments)))
    357                 for oAttachment in aoMediumAttachments:
    358                     sActualFilePath = oAttachment.medium.location
    359                     reporter.log('medium location is "%s"' % (sActualFilePath))
    360 
    361                 oSubTstDrvMoveMedium1Instance = SubTstDrvMoveMedium1(self.oTstDrv)
    362                 oSubTstDrvMoveMedium1Instance.setLocation(sLoc, aoMediumAttachments)
    363 
    364             if fRc is True:
    365                 fRc = self.moveVMToLocation(sMoveLoc, oSession.o.machine) and fRc
    366 
    367             fRc = fRc and oSession.saveSettings()
    368             if fRc is False:
    369                 reporter.log('Couldn\'t save machine settings')
    370 
    371             #back ISO image to the original destination
    372             aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
    373             oSubTstDrvMoveMedium1Instance.setLocation(sActualFilePath, aoMediumAttachments)
    374             del oSubTstDrvMoveMedium1Instance
    375 
    376             #detach ISO image
    377             fRc = oSession.detachHd(sController, iPort, 0)
    378 
    379             fRc = fRc and oSession.saveSettings()
    380             if fRc is False:
    381                 reporter.log('Couldn\'t save machine settings')
     322#           fRc = True
     323#           oVirtualBox = self.oTstDrv.oVBoxMgr.getVirtualBox()
     324#           oMachine = oVirtualBox.findMachine('test-vm-move')
     325#           if oMachine == None:
     326#               reporter.log("Machine '%s' is unknown" % (oMachine.name))
     327#               return False
     328#
     329#           del oVirtualBox
     330#
     331#           sLoc = sMoveLoc + os.sep + oMachine.name + os.sep
     332#           sMoveLoc = os.path.join(sOrigLoc, 'moveFolder_5th_scenario')
     333#           os.mkdir(sMoveLoc, 0o775)
     334#           sISOLoc = os.path.join(g_ksValidationKitDir + os.sep, 'tests' + os.sep + 'api' + os.sep + 'tdMoveVM.iso')
     335#           if not os.path.exists(sISOLoc):
     336#               reporter.log('ISO file does not exist at "%s"' % (sISOLoc,))
     337#               fRc = False
     338#
     339#           #attach ISO image to the IDE controller
     340#           if fRc is True:
     341#               sController='IDE Controller'
     342#               aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
     343#               iPort = len(aoMediumAttachments)
     344#               reporter.log('sISOLoc "%s", sController "%s", iPort "%s"' % (sISOLoc,sController,iPort))
     345#               fRc = oSession.attachDvd(sISOLoc, sController, iPort, iDevice = 0)
     346#
     347#           fRc = fRc and oSession.saveSettings()
     348#           if fRc is False:
     349#               reporter.log('Couldn\'t save machine settings')
     350#
     351#           reporter.log('fRc after oSession.attachDvd "%s"' % (fRc))
     352#
     353#           #move ISO image to the VM settings folder
     354#           if fRc is True:
     355#               aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
     356#               reporter.log('number of attachments on IDE Controller is "%s"' % (len(aoMediumAttachments)))
     357#               for oAttachment in aoMediumAttachments:
     358#                   sActualFilePath = oAttachment.medium.location
     359#                   reporter.log('medium location is "%s"' % (sActualFilePath))
     360#
     361#               oSubTstDrvMoveMedium1Instance = SubTstDrvMoveMedium1(self.oTstDrv)
     362#               oSubTstDrvMoveMedium1Instance.setLocation(sLoc, aoMediumAttachments)
     363#
     364#           if fRc is True:
     365#               fRc = self.moveVMToLocation(sMoveLoc, oSession.o.machine) and fRc
     366#
     367#           fRc = fRc and oSession.saveSettings()
     368#           if fRc is False:
     369#               reporter.log('Couldn\'t save machine settings')
     370#
     371#           #back ISO image to the original destination
     372#           aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
     373#           oSubTstDrvMoveMedium1Instance.setLocation(sActualFilePath, aoMediumAttachments)
     374#           del oSubTstDrvMoveMedium1Instance
     375#
     376#           #detach ISO image
     377#           fRc = oSession.detachHd(sController, iPort, 0)
     378#
     379#           fRc = fRc and oSession.saveSettings()
     380#           if fRc is False:
     381#               reporter.log('Couldn\'t save machine settings')
    382382
    383383############# 6 case. ##########################################################################################
    384384            #There is a floppy image (.img) attached to the VM.
    385385            #Prerequisites - there is Floppy Controller and there are no any images attached to it.
    386             fRc = True
    387             sLoc = sMoveLoc + os.sep + oMachine.name + os.sep
    388             sMoveLoc = os.path.join(sOrigLoc, 'moveFolder_6th_scenario')
    389             os.mkdir(sMoveLoc, 0o775)
    390             sFloppyLoc = os.path.join(g_ksValidationKitDir + os.sep, 'tests' + os.sep + 'api' + os.sep + 'tdMoveVM.img')
    391             if not os.path.exists(sISOLoc):
    392                 reporter.log('Floppy disk does not exist at "%s"' % (sISOLoc,))
    393                 fRc = False
    394 
    395             # attach floppy image
    396             if fRc is True:
    397                 sController='Floppy Controller'
    398                 reporter.log('sFloppyLoc "%s", sController "%s"' % (sFloppyLoc,sController))
    399                 fRc = fRc and oSession.attachFloppy(sFloppyLoc, sController, 0, 0)
    400 
    401             fRc = fRc and oSession.saveSettings()
    402             if fRc is False:
    403                 reporter.log('Couldn\'t save machine settings')
    404 
    405             reporter.log('fRc after oSession.attachFloppy "%s"' % (fRc))
    406 
    407             #move Floppy image to the VM settings folder
    408             if fRc is True:
    409                 aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
    410                 reporter.log('number of attachments on Floppy Controller is "%s"' % (len(aoMediumAttachments)))
    411                 for oAttachment in aoMediumAttachments:
    412                     sActualFilePath = oAttachment.medium.location
    413                     reporter.log('medium location is "%s"' % (sActualFilePath))
    414 
    415                 oSubTstDrvMoveMedium1Instance = SubTstDrvMoveMedium1(self.oTstDrv)
    416                 oSubTstDrvMoveMedium1Instance.setLocation(sLoc, aoMediumAttachments)
    417 
    418             if fRc is True:
    419                 fRc = self.moveVMToLocation(sMoveLoc, oSession.o.machine) and fRc
    420 
    421             #back Floppy image to the original destination
    422             aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
    423             oSubTstDrvMoveMedium1Instance.setLocation(sActualFilePath, aoMediumAttachments)
    424             del oSubTstDrvMoveMedium1Instance
    425 
    426             #detach Floppy image
    427             fRc = oSession.detachHd(sController, 0, 0)
    428 
    429             fRc = fRc and oSession.saveSettings()
    430             if fRc is False:
    431                 reporter.log('Couldn\'t save machine settings')
     386#           fRc = True
     387#           sLoc = sMoveLoc + os.sep + oMachine.name + os.sep
     388#           sMoveLoc = os.path.join(sOrigLoc, 'moveFolder_6th_scenario')
     389#           os.mkdir(sMoveLoc, 0o775)
     390#           sFloppyLoc = os.path.join(g_ksValidationKitDir + os.sep, 'tests' + os.sep + 'api' + os.sep + 'tdMoveVM.img')
     391#           if not os.path.exists(sISOLoc):
     392#               reporter.log('Floppy disk does not exist at "%s"' % (sISOLoc,))
     393#               fRc = False
     394#
     395#           # attach floppy image
     396#           if fRc is True:
     397#               sController='Floppy Controller'
     398#               reporter.log('sFloppyLoc "%s", sController "%s"' % (sFloppyLoc,sController))
     399#               fRc = fRc and oSession.attachFloppy(sFloppyLoc, sController, 0, 0)
     400#
     401#           fRc = fRc and oSession.saveSettings()
     402#           if fRc is False:
     403#               reporter.log('Couldn\'t save machine settings')
     404#
     405#           reporter.log('fRc after oSession.attachFloppy "%s"' % (fRc))
     406#
     407#           #move Floppy image to the VM settings folder
     408#           if fRc is True:
     409#               aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
     410#               reporter.log('number of attachments on Floppy Controller is "%s"' % (len(aoMediumAttachments)))
     411#               for oAttachment in aoMediumAttachments:
     412#                   sActualFilePath = oAttachment.medium.location
     413#                   reporter.log('medium location is "%s"' % (sActualFilePath))
     414#
     415#               oSubTstDrvMoveMedium1Instance = SubTstDrvMoveMedium1(self.oTstDrv)
     416#               oSubTstDrvMoveMedium1Instance.setLocation(sLoc, aoMediumAttachments)
     417#
     418#           if fRc is True:
     419#               fRc = self.moveVMToLocation(sMoveLoc, oSession.o.machine) and fRc
     420#
     421#           #back Floppy image to the original destination
     422#           aoMediumAttachments = oMachine.getMediumAttachmentsOfController(sController)
     423#           oSubTstDrvMoveMedium1Instance.setLocation(sActualFilePath, aoMediumAttachments)
     424#           del oSubTstDrvMoveMedium1Instance
     425#
     426#           #detach Floppy image
     427#           fRc = oSession.detachHd(sController, 0, 0)
     428#
     429#           fRc = fRc and oSession.saveSettings()
     430#           if fRc is False:
     431#               reporter.log('Couldn\'t save machine settings')
    432432#
    433433############# 7 case. ##########################################################################################
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