Changeset 71384 in vbox for trunk/src/VBox/ValidationKit/tests
- Timestamp:
- Mar 20, 2018 9:06:31 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/api/tdMoveVM.py
r71379 r71384 320 320 #There is an ISO image (.iso) attached to the VM. 321 321 #Prerequisites - there is IDE Controller and there are no any images attached to it. 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 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') 382 382 383 383 ############# 6 case. ########################################################################################## 384 384 #There is a floppy image (.img) attached to the VM. 385 385 #Prerequisites - there is Floppy Controller and there are no any images attached to it. 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 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') 432 432 # 433 433 ############# 7 case. ##########################################################################################
Note:
See TracChangeset
for help on using the changeset viewer.