Changeset 70718 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Jan 23, 2018 10:25:22 PM (7 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testdriver
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/vbox.py
r70660 r70718 2115 2115 reporter.log(" traceFile: %s" % (oNic.traceFile)); 2116 2116 self.processPendingEvents(); 2117 2118 reporter.log(" Serial ports:"); 2119 for iSlot in range(0, 8): 2120 try: oPort = oVM.getSerialPort(iSlot) 2121 except: break; 2122 if oPort is not None and oPort.enabled: 2123 enmHostMode = oPort.hostMode; 2124 if enmHostMode == vboxcon.PortMode_Disconnected: sType = "Disconnected"; 2125 elif enmHostMode == vboxcon.PortMode_HostPipe: sType = "HostPipe"; 2126 elif enmHostMode == vboxcon.PortMode_HostDevice: sType = "HostDevice"; 2127 elif enmHostMode == vboxcon.PortMode_RawFile: sType = "RawFile"; 2128 elif enmHostMode == vboxcon.PortMode_TCP: sType = "TCP"; 2129 else: sType = "unknown %s" % (enmHostMode); 2130 reporter.log(" slot #%d: hostMode: %s (%s) I/O port: %s IRQ: %s server: %s path: %s" % 2131 (iSlot, sType, enmHostMode, oPort.IOBase, oPort.IRQ, oPort.server, oPort.path,) ); 2132 self.processPendingEvents(); 2133 2117 2134 return True; 2118 2135 … … 2179 2196 2180 2197 # pylint: disable=R0913,R0914,R0915 2181 def createTestVM(self, sName, iGroup, sHd = None, cMbRam = None, cCpus = 1, fVirtEx = None, fNestedPaging = None, \ 2182 sDvdImage = None, sKind = "Other", fIoApic = None, fPae = None, fFastBootLogo = True, \ 2183 eNic0Type = None, eNic0AttachType = None, sNic0NetName = 'default', sNic0MacAddr = 'grouped', \ 2184 sFloppy = None, fNatForwardingForTxs = None, sHddControllerType = 'IDE Controller', \ 2185 fVmmDevTestingPart = None, fVmmDevTestingMmio = False, sFirmwareType = 'bios', sChipsetType = 'piix3', \ 2186 sDvdControllerType = 'IDE Controller',): 2198 def createTestVM(self, 2199 sName, 2200 iGroup, 2201 sHd = None, 2202 cMbRam = None, 2203 cCpus = 1, 2204 fVirtEx = None, 2205 fNestedPaging = None, 2206 sDvdImage = None, 2207 sKind = "Other", 2208 fIoApic = None, 2209 fPae = None, 2210 fFastBootLogo = True, 2211 eNic0Type = None, 2212 eNic0AttachType = None, 2213 sNic0NetName = 'default', 2214 sNic0MacAddr = 'grouped', 2215 sFloppy = None, 2216 fNatForwardingForTxs = None, 2217 sHddControllerType = 'IDE Controller', 2218 fVmmDevTestingPart = None, 2219 fVmmDevTestingMmio = False, 2220 sFirmwareType = 'bios', 2221 sChipsetType = 'piix3', 2222 sDvdControllerType = 'IDE Controller', 2223 sCom1RawFile = None): 2187 2224 """ 2188 2225 Creates a test VM with a immutable HD from the test resources. … … 2276 2313 elif sChipsetType == 'ich9': 2277 2314 fRc = oSession.setChipsetType(vboxcon.ChipsetType_ICH9); 2315 if fRc and sCom1RawFile: 2316 fRc = oSession.setupSerialToRawFile(0, sCom1RawFile); 2278 2317 2279 2318 if fRc: fRc = oSession.saveSettings(); -
trunk/src/VBox/ValidationKit/testdriver/vboxtestvms.py
r70695 r70718 35 35 import random; 36 36 import socket; 37 import string; 37 38 38 39 # Validation Kit imports. … … 40 41 from testdriver import reporter; 41 42 from testdriver import vboxcon; 43 from common import utils; 42 44 43 45 … … 53 55 'hwvirt-np' : 'NestedPaging' 54 56 }; 57 58 ## @name VM grouping flags 59 ## @{ 60 g_kfGrpSmoke = 0x0001; ##< Smoke test VM. 61 g_kfGrpStandard = 0x0002; ##< Standard test VM. 62 g_kfGrpStdSmoke = g_kfGrpSmoke | g_kfGrpStandard; ##< shorthand. 63 g_kfGrpWithGAs = 0x0004; ##< The VM has guest additions installed. 64 g_kfGrpNoTxs = 0x0008; ##< The VM lacks test execution service. 65 g_kfGrpAncient = 0x1000; ##< Ancient OS. 66 g_kfGrpExotic = 0x2000; ##< Exotic OS. 67 ## @} 68 55 69 56 70 ## @name Flags. … … 107 121 [ 'Solaris_64', 'Solaris_64', g_k64, 1, 256, ['sol10-64', 'sol10u-64[0-9]']], 108 122 [ 'Solaris_64', 'Solaris11_64', g_k64, 1, 256, ['sol11u1']], 109 [ 'BSD', 'FreeBSD_64', g_k32_64, 1, 1, ['bs-.*']], # boot sectors, wanted 64-bit type. 123 [ 'BSD', 'FreeBSD_64', g_k32_64, 1, 1, ['bs-.*']], # boot sectors, wanted 64-bit type. 124 [ 'DOS', 'DOS', g_k32, 1, 1, ['bs-.*']], 110 125 ]; 111 126 … … 114 129 ## @{ 115 130 g_ksGuestOsTypeDarwin = 'darwin'; 131 g_ksGuestOsTypeDOS = 'dos'; 116 132 g_ksGuestOsTypeFreeBSD = 'freebsd'; 117 133 g_ksGuestOsTypeLinux = 'linux'; … … 150 166 g_kdaParavirtProvidersSupported = { 151 167 g_ksGuestOsTypeDarwin : ( g_ksParavirtProviderMinimal, ), 168 g_ksGuestOsTypeDOS : ( g_ksParavirtProviderNone, ), 152 169 g_ksGuestOsTypeFreeBSD : ( g_ksParavirtProviderNone, ), 153 170 g_ksGuestOsTypeLinux : ( g_ksParavirtProviderNone, g_ksParavirtProviderHyperV, g_ksParavirtProviderKVM), … … 222 239 self.sFirmwareType = sFirmwareType; 223 240 self.sChipsetType = sChipsetType; 241 self.fCom1RawFile = False; 224 242 225 243 self.fSnapshotRestoreCurrent = False; # Whether to restore execution on the current snapshot. 226 244 self.fSkip = False; # All VMs are included in the configured set by default. 227 245 self.aInfo = None; 246 self.sCom1RawFile = None; # Set by createVmInner and getReconfiguredVm if fCom1RawFile is set. 228 247 self._guessStuff(fRandomPvPMode); 229 248 … … 237 256 if sType.lower().startswith('bsd'): 238 257 return g_ksGuestOsTypeFreeBSD 258 if sType.lower().startswith('dos'): 259 return g_ksGuestOsTypeDOS 239 260 if sType.lower().startswith('linux'): 240 261 return g_ksGuestOsTypeLinux … … 288 309 elif self.sKind.find("Solaris") >= 0: 289 310 self.sGuestOsType = g_ksGuestOsTypeSolaris; 311 elif self.sKind.find("DOS") >= 0: 312 self.sGuestOsType = g_ksGuestOsTypeDOS; 290 313 else: 291 314 reporter.fatal('The OS of test VM "%s", sKind="%s" cannot be guessed' % (self.sVmName, self.sKind)); … … 362 385 return self.createVmInner(oTestDrv, eMyNic0AttachType, sMyDvdImage); 363 386 387 def _generateRawPortFilename(self, oTestDrv, sInfix, sSuffix): 388 """ Generates a raw port filename. """ 389 random.seed(); 390 sRandom = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(10)); 391 return os.path.join(oTestDrv.sScratchPath, self.sVmName + sInfix + sRandom + sSuffix); 392 364 393 def createVmInner(self, oTestDrv, eNic0AttachType, sDvdImage): 365 394 """ … … 370 399 reporter.log2(''); 371 400 reporter.log2('Calling createTestVM on %s...' % (self.sVmName,)) 401 if self.fCom1RawFile: 402 self.sCom1RawFile = self._generateRawPortFilename(oTestDrv, '-com1-', '.out'); 372 403 return oTestDrv.createTestVM(self.sVmName, 373 404 1, # iGroup … … 384 415 fVmmDevTestingMmio = self.fVmmDevTestingPart, 385 416 sFirmwareType = self.sFirmwareType, 386 sChipsetType = self.sChipsetType); 417 sChipsetType = self.sChipsetType, 418 sCom1RawFile = self.sCom1RawFile if self.fCom1RawFile else None 419 ); 387 420 388 421 def getReconfiguredVm(self, oTestDrv, cCpus, sVirtMode, sParavirtMode = None): … … 438 471 fRc = fRc and oSession.setOsType(oOsType.id + '_64'); 439 472 473 # New serial raw file. 474 if fRc and self.fCom1RawFile: 475 self.sCom1RawFile = self._generateRawPortFilename(oTestDrv, '-com1-', '.out'); 476 utils.noxcptDeleteFile(self.sCom1RawFile); 477 fRc = oSession.setupSerialToRawFile(0, self.sCom1RawFile); 478 479 # Make life simpler for child classes. 480 if fRc: 481 fRc = self._childVmReconfig(oTestDrv, oVM, oSession); 482 440 483 fRc = fRc and oSession.saveSettings(); 441 484 if not oSession.close(): … … 445 488 return (fRc, None); 446 489 490 def _childVmReconfig(self, oTestDrv, oVM, oSession): 491 """ Hook into getReconfiguredVm() for children. """ 492 _ = oTestDrv; _ = oVM; _ = oSession; 493 return True; 447 494 448 495 def isWindows(self): … … 545 592 546 593 547 548 #class AncientTestVm(object): 549 # """ 550 # A ancient Test VM, using the serial port for communicating results. 551 # 552 # We're looking for 'PASSED' and 'FAILED' lines in the COM1 output. 553 # """ 554 # 555 # def __init__(self, oSet, sVmName, fGrouping = , sHd = None, sKind = None, acCpusSup = None, asVirtModesSup = None, # pylint: disable=R0913 556 # fIoApic = None, fPae = None, sNic0AttachType = None, sFloppy = None, sFirmwareType = 'bios', 557 # sChipsetType = 'piix3', sHddControllerType = 'IDE Controller', sDvdControllerType = 'IDE Controller'): 558 # TestVm.__init__(self, oSet, sVmName, 559 # 594 class AncientTestVm(TestVm): 595 """ 596 A ancient Test VM, using the serial port for communicating results. 597 598 We're looking for 'PASSED' and 'FAILED' lines in the COM1 output. 599 """ 600 601 602 def __init__(self, # pylint: disable=R0913 603 sVmName, # type: str 604 fGrouping = g_kfGrpAncient | g_kfGrpNoTxs, # type: int 605 sHd = None, # type: str 606 sKind = None, # type: str 607 acCpusSup = None, # type: List[int] 608 asVirtModesSup = None, # type: List[str] 609 sNic0AttachType = None, # type: str 610 sFloppy = None, # type: str 611 sFirmwareType = 'bios', # type: str 612 sChipsetType = 'piix3', # type: str 613 sHddControllerName = 'IDE Controller', # type: str 614 sDvdControllerName = 'IDE Controller', # type: str 615 cMBRamMax = None, # type: int 616 ): 617 TestVm.__init__(self, 618 sVmName, 619 fGrouping = fGrouping, 620 sHd = sHd, 621 sKind = sKind, 622 acCpusSup = [1] if acCpusSup is None else acCpusSup, 623 asVirtModesSup = asVirtModesSup, 624 sNic0AttachType = sNic0AttachType, 625 sFloppy = sFloppy, 626 sFirmwareType = sFirmwareType, 627 sChipsetType = sChipsetType, 628 sHddControllerType = sHddControllerName, 629 sDvdControllerType = sDvdControllerName, 630 asParavirtModesSup = (g_ksParavirtProviderNone,) 631 ); 632 self.fCom1RawFile = True; 633 self.cMBRamMax= cMBRamMax; 634 635 636 def _childVmReconfig(self, oTestDrv, oVM, oSession): 637 _ = oVM; _ = oTestDrv; 638 fRc = True; 639 640 # DOS 4.01 doesn't like the default 32MB of memory. 641 if fRc and self.cMBRamMax is not None: 642 try: 643 cMBRam = oSession.o.machine.memorySize; 644 except: 645 cMBRam = self.cMBRamMax + 4; 646 if self.cMBRamMax < cMBRam: 647 fRc = oSession.setRamSize(self.cMBRamMax); 648 649 return fRc; 560 650 561 651 … … 926 1016 ## @name VM grouping flags 927 1017 ## @{ 928 kfGrpSmoke = 0x0001; ##< Smoke test VM.929 kfGrpStandard = 0x0002; ##< Standard test VM.930 kfGrpStdSmoke = kfGrpSmoke | kfGrpStandard; ##< shorthand.931 kfGrpWithGAs = 0x0004; ##< The VM has guest additions installed.932 kfGrpNoTxs = 0x0008; ##< The VM lacks test execution service.933 kfGrpAncient = 0x1000; ##< Ancient OS.934 kfGrpExotic = 0x2000; ##< Exotic OS.1018 kfGrpSmoke = g_kfGrpSmoke; 1019 kfGrpStandard = g_kfGrpStandard; 1020 kfGrpStdSmoke = g_kfGrpStdSmoke; 1021 kfGrpWithGAs = g_kfGrpWithGAs; 1022 kfGrpNoTxs = g_kfGrpNoTxs; 1023 kfGrpAncient = g_kfGrpAncient; 1024 kfGrpExotic = g_kfGrpExotic; 935 1025 ## @} 936 1026 … … 962 1052 sKind = 'WindowsNT3x', acCpusSup = [1], sHddControllerType = 'BusLogic SCSI Controller', 963 1053 sDvdControllerType = 'BusLogic SCSI Controller'), 964 TestVm('tst-nt351', kfGrpAncient, sHd = '5.2/great-old-ones/t-nt350/t-nt35 0.vdi',1054 TestVm('tst-nt351', kfGrpAncient, sHd = '5.2/great-old-ones/t-nt350/t-nt351.vdi', 965 1055 sKind = 'WindowsNT3x', acCpusSup = [1], sHddControllerType = 'BusLogic SCSI Controller', 966 1056 sDvdControllerType = 'BusLogic SCSI Controller'), … … 1016 1106 1017 1107 # DOS and Old Windows. 1018 # todo ... 1108 AncientTestVm('tst-dos20', sKind = 'DOS', sHd = '5.2/great-old-ones/t-dos20/t-dos20.vdi'), 1109 AncientTestVm('tst-dos71', sKind = 'DOS', sHd = '5.2/great-old-ones/t-dos71/t-dos71.vdi'), 1110 AncientTestVm('tst-dos401-win30me', sKind = 'DOS', sHd = '5.2/great-old-ones/t-dos401-win30me/t-dos401-win30me.vdi', 1111 cMBRamMax = 4), 1112 AncientTestVm('tst-dos5-win311a', sKind = 'DOS', sHd = '5.2/great-old-ones/t-dos5-win311a/t-dos5-win311a.vdi'), 1113 AncientTestVm('tst-dos622', sKind = 'DOS', sHd = '5.2/great-old-ones/t-dos622/t-dos622.vdi'), 1114 AncientTestVm('tst-dos622-emm386', sKind = 'DOS', sHd = '5.2/great-old-ones/t-dos622-emm386/t-dos622-emm386.vdi'), 1019 1115 ); 1020 1116 -
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r70660 r70718 2365 2365 2366 2366 2367 def setupSerialToRawFile(self, iSerialPort, sRawFile): 2368 """ 2369 Enables the given serial port (zero based) and redirects it to sRawFile. 2370 Returns the True on success, False on failure (logged). 2371 """ 2372 try: 2373 oPort = self.o.machine.GetSerialPort(iSerialPort); 2374 except: 2375 fRc = reporter.errorXcpt('failed to get serial port #%u' % (iSerialPort,)); 2376 else: 2377 try: 2378 oPort.path = sRawFile; 2379 except: 2380 fRc = reporter.errorXcpt('failed to set the "path" property on serial port #%u to "%s"' 2381 % (iSerialPort, sRawFile)); 2382 else: 2383 try: 2384 oPort.hostMode = vboxcon.PortMode_RawFile; 2385 except: 2386 fRc = reporter.errorXcpt('failed to set the "hostMode" property on serial port #%u to PortMode_RawFile' 2387 % (iSerialPort,)); 2388 else: 2389 try: 2390 oPort.enabled = True; 2391 except: 2392 fRc = reporter.errorXcpt('failed to set the "enable" property on serial port #%u to True' 2393 % (iSerialPort,)); 2394 else: 2395 reporter.log('set SerialPort[%s].enabled/hostMode/path=True/RawFile/%s' % (iSerialPort, sRawFile,)); 2396 fRc = True; 2397 self.oTstDrv.processPendingEvents(); 2398 return fRc; 2399 2367 2400 2368 2401 #
Note:
See TracChangeset
for help on using the changeset viewer.