cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -*- coding: utf-8 -*-
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox Validation Kit - OS/2 install tests.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCopyright (C) 2010-2014 Oracle Corporation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThis file is part of VirtualBox Open Source Edition (OSE), as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncavailable from http://www.virtualbox.org. This file is free software;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncyou can redistribute it and/or modify it under the terms of the GNU
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncGeneral Public License (GPL) as published by the Free Software
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFoundation, in version 2 as it comes in the "COPYING" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsynchope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThe contents of this file may alternatively be used under the terms
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncof the Common Development and Distribution License Version 1.0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync(CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution, in which case the provisions of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCDDL are applicable instead of those of the GPL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncYou may elect to license modified versions of this file under the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncterms and conditions of either the GPL or the CDDL or both.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Standard Python imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Only the main script needs to modify the path.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Validation Kit imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync OS/2 unattended installation.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync - Create new VM that corresponds specified installation ISO image
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync - Create HDD that corresponds to OS type that will be installed
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync - Set VM boot order: HDD, Floppy, ISO
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync - Start VM: sinse there is no OS installed on HDD, VM will booted from floppy
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync - After first reboot VM will continue installation from HDD automatically
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync - Wait for incomming TCP connection (guest should initiate such a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync connection in case installation has been completed successfully)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # VM parameters required to run ISO image.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Format: (cBytesHdd, sKind)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'acp2-txs.iso': ( 2*1024*1024*1024, 'OS2', ksIdeController ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'mcp2-txs.iso': ( 2*1024*1024*1024, 'OS2', ksIdeController ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Reinitialize child class instance.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sIsoPathBase = os.path.join(self.sResourcePath, '4.2', 'isos')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Overridden methods.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Extend usage info
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' Set VM extra data. This command line option might be used multiple times.')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Extend standard options set
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if iArg >= len(asArgs): raise base.InvalidOption('The "--install-iso" option requires an argument')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if iArg >= len(asArgs): raise base.InvalidOption('The "--cpus" option requires an argument')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return vbox.TestDriver.parseOption(self, asArgs, iArg)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Configure pre-conditions.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('Error: unknown ISO image specified: %s' % self.sIso)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Get VM params specific to ISO image
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cBytesHdd, sKind, sController = self.kaoVmParams[self.sIso]
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Create VM itself
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync eNic0AttachType = vboxcon.NetworkAttachmentType_NAT
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sIso = os.path.join(self.sIsoPathBase, self.sIso)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sFloppy = os.path.join(self.sIsoPathBase, os.path.splitext(self.sIso)[0] + '.img')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.oVM = self.createTestVM(self.sVmName, 1, sKind = sKind, sDvdImage = self.sIso, cCpus = self.cCpus,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sFloppy = self.sFloppy, eNic0AttachType = eNic0AttachType)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Create HDD
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHddPath = os.path.join(self.sScratchPath, self.sHddName)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = oSession.setStorageControllerType(vboxcon.StorageControllerType_IntelAhci, sController)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.createAndAttachHd(sHddPath, cb = cBytesHdd,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sController = sController, iPort = 0, fImmutable=False)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.setStorageControllerPortCount(sController, 1)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Set proper boot order
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.setBootOrder(1, vboxcon.DeviceType_HardDisk)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.setBootOrder(2, vboxcon.DeviceType_Floppy)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Enable HW virt
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Enable I/O APIC
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.enableIoApic(self.fEnableIOAPIC)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Enable Nested Paging
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.enableNestedPaging(self.fEnableNestedPaging)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Enable PAE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Remote desktop
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Set extra data
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('Invalid extradata specified: %s' % sExtraData)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('Set extradata: %s => %s' % (sKey, sValue))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Execute the testcase itself.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Test execution helpers.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Install guest OS and wait for result
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.testStart('Installing %s' % (os.path.basename(self.sIso),))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if not reporter.isLocal(): ## @todo need to figure a better way of handling timeouts on the testboxes ...
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSession, _ = self.startVmAndConnectToTxsViaTcp(self.sVmName, fCdWait = False, cMsTimeout = cMsTimeout)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oSession is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Wait until guest reported success