Changeset 70490 in vbox
- Timestamp:
- Jan 8, 2018 10:14:41 PM (7 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testdriver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/vbox.py
r70392 r70490 2203 2203 eNic0Type = None, eNic0AttachType = None, sNic0NetName = 'default', sNic0MacAddr = 'grouped', \ 2204 2204 sFloppy = None, fNatForwardingForTxs = None, sHddControllerType = 'IDE Controller', \ 2205 fVmmDevTestingPart = None, fVmmDevTestingMmio = False, sFirmwareType = 'bios', sChipsetType = 'piix3'): 2205 fVmmDevTestingPart = None, fVmmDevTestingMmio = False, sFirmwareType = 'bios', sChipsetType = 'piix3', \ 2206 sDvdControllerType = 'IDE Controller',): 2206 2207 """ 2207 2208 Creates a test VM with a immutable HD from the test resources. … … 2264 2265 fRc = oSession.enablePae(fPae); 2265 2266 if fRc and sDvdImage is not None: 2266 fRc = oSession.attachDvd(sDvdImage );2267 fRc = oSession.attachDvd(sDvdImage, sDvdControllerType); 2267 2268 if fRc and sHd is not None: 2268 2269 fRc = oSession.attachHd(sHd, sHddControllerType); … … 3274 3275 # pylint: enable=C0111 3275 3276 3276 def txsCdWait(self, oSession, oTxsSession, cMsTimeout = 30000, sFileCdWait = 'vboxtxs-readme.txt'): 3277 def txsCdWait(self, 3278 oSession, # type: vboxwrappers.SessionWrapper 3279 oTxsSession, # type: txsclient.Session 3280 cMsTimeout = 30000, # type: int 3281 asFiles = None # type: list(String) 3282 ): # -> bool 3277 3283 """ 3278 3284 Mostly an internal helper for txsRebootAndReconnectViaTcp and … … 3285 3291 """ 3286 3292 3293 if asFiles is None: 3294 asFiles = [ 'vboxtxs-readme.txt', 'vboxtxsreadme.txt' ]; 3287 3295 fRemoveVm = self.addTask(oSession); 3288 3296 fRemoveTxs = self.addTask(oTxsSession); … … 3290 3298 msStart = base.timestampMilli(); 3291 3299 cMsTimeout2 = cMsTimeout; 3292 fRc = oTxsSession.asyncIsFile('${CDROM}/%s' % (sFileCdWait), cMsTimeout2); 3300 iFile = 0; 3301 fRc = oTxsSession.asyncIsFile('${CDROM}/%s' % (asFiles[iFile],), cMsTimeout2); 3293 3302 if fRc is True: 3294 3303 while True: … … 3298 3307 oTxsSession.cancelTask(); 3299 3308 if oTask is None: 3300 reporter.errorTimeout('txs ToCdWait: The task timed out (after %s ms).'3309 reporter.errorTimeout('txsCdWait: The task timed out (after %s ms).' 3301 3310 % (base.timestampMilli() - msStart,)); 3302 3311 elif oTask is oSession: 3303 reporter.error('txs ToCdWait: The VM terminated unexpectedly');3312 reporter.error('txsCdWait: The VM terminated unexpectedly'); 3304 3313 else: 3305 reporter.error('txs ToCdWait: An unknown task %s was returned' % (oTask,));3314 reporter.error('txsCdWait: An unknown task %s was returned' % (oTask,)); 3306 3315 fRc = False; 3307 3316 break; … … 3312 3321 cMsElapsed = base.timestampMilli() - msStart; 3313 3322 if cMsElapsed >= cMsTimeout: 3314 reporter.error('txs ToCdWait: timed out');3323 reporter.error('txsCdWait: timed out'); 3315 3324 fRc = False; 3316 3325 break; … … 3323 3332 if cMsTimeout2 < 500: 3324 3333 cMsTimeout2 = 500; 3325 fRc = oTxsSession.asyncIsFile('${CDROM}/%s' % (sFileCdWait), cMsTimeout2); 3334 iFile = (iFile + 1) % len(asFiles); 3335 fRc = oTxsSession.asyncIsFile('${CDROM}/%s' % (asFiles[iFile]), cMsTimeout2); 3326 3336 if fRc is not True: 3327 reporter.error('txs ToCdWait: asyncIsFile failed');3337 reporter.error('txsCdWait: asyncIsFile failed'); 3328 3338 break; 3329 3339 else: 3330 reporter.error('txs ToCdWait: asyncIsFile failed');3340 reporter.error('txsCdWait: asyncIsFile failed'); 3331 3341 3332 3342 if fRemoveTxs: … … 3378 3388 3379 3389 def startVmAndConnectToTxsViaTcp(self, sVmName, fCdWait = False, cMsTimeout = 15*60000, \ 3380 cMsCdWait = 30000, sFileCdWait = 'vboxtxs-readme.txt', \3390 cMsCdWait = 30000, sFileCdWait = None, \ 3381 3391 fNatForwardingForTxs = False): 3382 3392 """ … … 3427 3437 3428 3438 def txsRebootAndReconnectViaTcp(self, oSession, oTxsSession, fCdWait = False, cMsTimeout = 15*60000, \ 3429 cMsCdWait = 30000, sFileCdWait = 'vboxtxs-readme.txt', fNatForwardingForTxs = False):3439 cMsCdWait = 30000, sFileCdWait = None, fNatForwardingForTxs = False): 3430 3440 """ 3431 3441 Executes the TXS reboot command -
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r69111 r70490 45 45 46 46 47 def _ControllerNameToBus (sController):47 def _ControllerNameToBusAndType(sController): 48 48 """ Translate a controller name to a storage bus. """ 49 49 if sController == "IDE Controller": 50 iType = vboxcon.StorageBus_IDE; 50 eBus = vboxcon.StorageBus_IDE; 51 eType = vboxcon.StorageControllerType_PIIX4; 51 52 elif sController == "SATA Controller": 52 iType = vboxcon.StorageBus_SATA; 53 eBus = vboxcon.StorageBus_SATA; 54 eType = vboxcon.StorageControllerType_IntelAhci; 53 55 elif sController == "Floppy Controller": 54 iType = vboxcon.StorageBus_Floppy; 56 eType = vboxcon.StorageControllerType_I82078; 57 eBus = vboxcon.StorageBus_Floppy; 55 58 elif sController == "SAS Controller": 56 iType = vboxcon.StorageBus_SAS; 59 eBus = vboxcon.StorageBus_SAS; 60 eType = vboxcon.StorageControllerType_LsiLogicSas; 57 61 elif sController == "SCSI Controller": 58 iType = vboxcon.StorageBus_SCSI; 62 eBus = vboxcon.StorageBus_SCSI; 63 eType = vboxcon.StorageControllerType_LsiLogic; 64 elif sController == "BusLogic SCSI Controller": 65 eBus = vboxcon.StorageBus_SCSI; 66 eType = vboxcon.StorageControllerType_BusLogic; 59 67 elif sController == "NVMe Controller": 60 iType = vboxcon.StorageBus_PCIe; 68 eBus = vboxcon.StorageBus_PCIe; 69 eType = vboxcon.StorageControllerType_NVMe; 61 70 else: 62 iType = vboxcon.StorageBus_Null; 63 return iType; 71 eBus = vboxcon.StorageBus_Null; 72 eType = vboxcon.StorageControllerType_Null; 73 return (eBus, eType); 74 64 75 65 76 def _nameMachineState(eState): … … 1632 1643 self.o.machine.getStorageControllerByName(sController); 1633 1644 except: 1634 iType = _ControllerNameToBus(sController);1645 (eBus, eType) = _ControllerNameToBusAndType(sController); 1635 1646 try: 1636 self.o.machine.addStorageController(sController, iType); 1637 reporter.log('added storage controller "%s" (type %s) to %s' % (sController, iType, self.sName)); 1647 oCtl = self.o.machine.addStorageController(sController, eBus); 1638 1648 except: 1639 reporter.errorXcpt('addStorageController("%s",%s) failed on "%s"' % (sController, iType, self.sName) );1649 reporter.errorXcpt('addStorageController("%s",%s) failed on "%s"' % (sController, eBus, self.sName) ); 1640 1650 return False; 1651 else: 1652 try: 1653 oCtl.controllerType = eType; 1654 reporter.log('added storage controller "%s" (bus %s, type %s) to %s' 1655 % (sController, eBus, eType, self.sName)); 1656 except: 1657 reporter.errorXcpt('controllerType = %s on ("%s" / %s) failed on "%s"' 1658 % (eType, sController, eBus, self.sName) ); 1659 return False; 1641 1660 finally: 1642 1661 self.oTstDrv.processPendingEvents(); … … 1697 1716 oCtl = self.o.machine.getStorageControllerByName(sController); 1698 1717 except: 1699 iType = _ControllerNameToBus(sController);1700 try: 1701 oCtl = self.o.machine.addStorageController(sController, iType);1702 reporter.log('added storage controller "%s" ( type %s) to %s' % (sController, iType, self.sName));1703 except: 1704 reporter.errorXcpt('addStorageController("%s",%s) failed on "%s"' % (sController, iType, self.sName) );1718 (eBus, _) = _ControllerNameToBusAndType(sController); 1719 try: 1720 oCtl = self.o.machine.addStorageController(sController, eBus); 1721 reporter.log('added storage controller "%s" (bus %s) to %s' % (sController, eBus, self.sName)); 1722 except: 1723 reporter.errorXcpt('addStorageController("%s",%s) failed on "%s"' % (sController, eBus, self.sName) ); 1705 1724 return False; 1706 1725 try:
Note:
See TracChangeset
for help on using the changeset viewer.