Changeset 76938 in vbox for trunk/src/VBox/ValidationKit/tests
- Timestamp:
- Jan 22, 2019 4:50:18 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128315
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddLinux1.py
r72536 r76938 4 4 5 5 """ 6 VirtualBox Validation Kit - OS/2install tests.6 VirtualBox Validation Kit - Linux Additions install tests. 7 7 """ 8 8 … … 49 49 50 50 51 class tdGuestOsInst Os2(vbox.TestDriver):51 class tdGuestOsInstLinux(vbox.TestDriver): 52 52 """ 53 OS/2 unattended installation.53 Linux unattended installation with Additions. 54 54 55 55 Scenario: 56 56 - Create new VM that corresponds specified installation ISO image 57 57 - Create HDD that corresponds to OS type that will be installed 58 - Set VM boot order: HDD, Floppy, ISO 59 - Start VM: sinse there is no OS installed on HDD, VM will booted from floppy 60 - After first reboot VM will continue installation from HDD automatically 61 - Wait for incomming TCP connection (guest should initiate such a 62 connection in case installation has been completed successfully) 58 - Wait for the installed Additions to write their message to the 59 machine log file. 63 60 """ 64 65 ksSataController = 'SATA Controller'66 ksIdeController = 'IDE Controller'67 68 # VM parameters required to run ISO image.69 # Format: (cBytesHdd, sKind)70 kaoVmParams = {71 'acp2-txs.iso': ( 2*1024*1024*1024, 'OS2', ksIdeController ),72 'mcp2-txs.iso': ( 2*1024*1024*1024, 'OS2', ksIdeController ),73 }74 61 75 62 def __init__(self): … … 83 70 self.sIso = None 84 71 self.sFloppy = None 85 self.sIsoPathBase = os.path.join(self.sResourcePath, ' 4.2', 'isos')72 self.sIsoPathBase = os.path.join(self.sResourcePath, '5.3', 'isos') 86 73 self.fEnableIOAPIC = True 87 74 self.cCpus = 1 … … 89 76 self.fEnablePAE = False 90 77 self.asExtraData = [] 78 self.oUnattended = None 91 79 92 80 # … … 145 133 146 134 assert self.sIso is not None 147 if self.sIso not in self.kaoVmParams: 148 reporter.log('Error: unknown ISO image specified: %s' % self.sIso) 149 return False 150 151 # Get VM params specific to ISO image 152 cBytesHdd, sKind, sController = self.kaoVmParams[self.sIso] 135 136 # Create unattended object 137 oUnattended = self.oVBox.createUnattendedInstaller() 138 self.sIso = os.path.join(self.sIsoPathBase, self.sIso) 139 assert os.path.isfile(self.sIso) 140 oUnattended.isoPath = self.sIso 141 oUnattended.user = "vbox" 142 oUnattended.password = "password" 143 oUnattended.installGuestAdditions = True 144 try: 145 oUnattended.detectIsoOS() 146 except: 147 pass 148 sOSTypeId = oUnattended.detectedOSTypeId 149 sOSVersion = oUnattended.detectedOSVersion 150 oGuestOSType = self.oVBox.getGuestOSType(sOSTypeId) 151 assert oGuestOSType.familyId == "Linux" 153 152 154 153 # Create VM itself 155 154 eNic0AttachType = vboxcon.NetworkAttachmentType_NAT 156 self.sIso = os.path.join(self.sIsoPathBase, self.sIso) 157 assert os.path.isfile(self.sIso) 158 159 self.sFloppy = os.path.join(self.sIsoPathBase, os.path.splitext(self.sIso)[0] + '.img') 160 161 oVM = self.createTestVM(self.sVmName, 1, sKind = sKind, sDvdImage = self.sIso, cCpus = self.cCpus, 162 sFloppy = self.sFloppy, eNic0AttachType = eNic0AttachType) 155 156 oVM = self.createTestVM(self.sVmName, 1, sKind = oGuestOSType.id, sDvdImage = None, cCpus = self.cCpus, 157 eNic0AttachType = eNic0AttachType, sNic0MacAddr = None) 163 158 assert oVM is not None 164 159 … … 168 163 sHddPath = os.path.join(self.sScratchPath, self.sHddName) 169 164 fRc = True 170 if sController == self.ksSataController: 171 fRc = oSession.setStorageControllerType(vboxcon.StorageControllerType_IntelAhci, sController) 172 173 fRc = fRc and oSession.createAndAttachHd(sHddPath, cb = cBytesHdd, 165 if sOSTypeId == "RedHat" and sOSVersion.startswith("3."): 166 sController = 'IDE Controller' 167 fRc = fRc and oSession.setStorageControllerPortCount(sController, 1) 168 else: 169 sController = 'SATA Controller' 170 fRc = oSession.setStorageControllerType(vboxcon.StorageControllerType_PIIX4, sController) 171 172 fRc = fRc and oSession.createAndAttachHd(sHddPath, cb = 12 * 1024 * 1024 * 1024, 174 173 sController = sController, iPort = 0, fImmutable=False) 175 if sController == self.ksSataController:176 fRc = fRc and oSession.setStorageControllerPortCount(sController, 1)177 178 # Set proper boot order179 fRc = fRc and oSession.setBootOrder(1, vboxcon.DeviceType_HardDisk)180 fRc = fRc and oSession.setBootOrder(2, vboxcon.DeviceType_Floppy)181 174 182 175 # Enable HW virt … … 208 201 fRc = oSession.close() 209 202 assert fRc is True 203 204 # Set the machine on the unattended object 205 oUnattended.machine = oVM 206 207 # Additional set-up 208 oUnattended.prepare() 209 oUnattended.constructMedia() 210 oUnattended.reconfigureVM() 211 self.oUnattended = oUnattended 210 212 211 213 return vbox.TestDriver.actionConfig(self) … … 245 247 246 248 if __name__ == '__main__': 247 sys.exit(tdGuestOsInst Os2().main(sys.argv));248 249 sys.exit(tdGuestOsInstLinux().main(sys.argv)); 250
Note:
See TracChangeset
for help on using the changeset viewer.