tdGuestOsInstTest1.py revision 6943863c190e951f08adf261d420e888375052c0
# -*- coding: utf-8 -*-
# $Id$
"""
VirtualBox Validation Kit - Guest OS installation tests.
"""
__copyright__ = \
"""
Copyright (C) 2010-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
General Public License (GPL) as published by the Free Software
Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
The contents of this file may alternatively be used under the terms
of the Common Development and Distribution License Version 1.0
(CDDL) only, as it comes in the "COPYING.CDDL" file of the
VirtualBox OSE distribution, in which case the provisions of the
CDDL are applicable instead of those of the GPL.
You may elect to license modified versions of this file under the
terms and conditions of either the GPL or the CDDL or both.
"""
__version__ = "$Revision$"
# Standard Python imports.
import os
import sys
# Only the main script needs to modify the path.
try: __file__
# Validation Kit imports.
from testdriver import vbox;
from testdriver import base;
from testdriver import reporter;
from testdriver import vboxcon;
from testdriver import vboxtestvms;
""" Installation test VM. """
## @name The primary controller, to which the disk will be attached.
ksSataController = 'SATA Controller'
ksIdeController = 'IDE Controller'
## @name VM option flags (OR together).
## @{
kf32Bit = 0x01;
kf64Bit = 0x02;
kfReqIoApic = 0x10;
kfReqIoApicSmp = 0x20;
kfReqPae = 0x40;
kfIdeIrqDelay = 0x80;
kfUbuntuNewAmdBug = 0x80;
kfNoWin81Paravirt = 0x100;
## @}
## IRQ delay extra data config for win2k VMs.
kasIdeIrqDelay = [ 'VBoxInternal/Devices/piix3ide/0/Config/IRQDelay:1', ];
## Install ISO path relative to the testrsrc root.
# Tweaks
self.asExtraData = [];
"""
Detaches and deletes the HD.
Returns success indicator, error info logged.
"""
if oVM is not None:
if oSession is not None:
return fRc;
#
# Do the standard reconfig in the base class first, it'll figure out
# if we can run the VM as requested.
#
#
# Make sure there is no HD from the previous run attached nor taking
# up storage on the host.
#
#
# Check for ubuntu installer vs. AMD host CPU.
#
return (None, None); # (skip)
#
# Make adjustments to the default config, and adding a fresh HD.
#
if oSession is not None:
try:
except:
sHddPath = None;
iPort = 0,
fImmutable = False);
# Set proper boot order
# Adjust memory if requested.
# Set extra data
try:
except ValueError:
# Other variations?
# Save the settings.
else:
oVM = None;
# Done.
"""
Checks if the host OS is affected by older ubuntu installers being very
picky about which families of AMD CPUs it would run on.
The installer checks for family 15, later 16, later 20, and in 11.10
they remove the family check for AMD CPUs.
"""
if not oTestDrv.isHostCpuAmd():
return False;
try:
except:
return False;
return False;
if uFamily == 0xf:
## @todo Break this down into which old ubuntu release supports exactly
## which AMD family, if we care.
if uFamily <= 15:
return False;
reporter.log('Skipping "%s" because host CPU is a family %u AMD, which may cause trouble for the guest OS installer.'
return True;
"""
Guest OS installation tests.
Scenario:
- Create new VM that corresponds specified installation ISO image.
- Create HDD that corresponds to OS type that will be installed.
- Boot VM from ISO image (i.e. install guest OS).
- Wait for incomming TCP connection (guest should initiate such a
connection in case installation has been completed successfully).
"""
"""
Reinitialize child class instance.
"""
#
# Our install test VM set.
#
# pylint: disable=C0301
InstallTestVm(oSet, 'tst-fedora4', 'Fedora', 'fedora4-txs.iso', InstallTestVm.ksIdeController, 8, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-fedora5', 'Fedora', 'fedora5-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit | InstallTestVm.kfReqPae | InstallTestVm.kfReqIoApicSmp),
InstallTestVm(oSet, 'tst-fedora6', 'Fedora', 'fedora6-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit | InstallTestVm.kfReqIoApic),
InstallTestVm(oSet, 'tst-fedora7', 'Fedora', 'fedora7-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit | InstallTestVm.kfReqIoApic),
InstallTestVm(oSet, 'tst-fedora9', 'Fedora', 'fedora9-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-fedora18-64', 'Fedora_64', 'fedora18-x64-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf64Bit),
InstallTestVm(oSet, 'tst-fedora18', 'Fedora', 'fedora18-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-ols6', 'Oracle', 'ols6-i386-txs.iso', InstallTestVm.ksSataController, 12, InstallTestVm.kf32Bit | InstallTestVm.kfReqPae),
InstallTestVm(oSet, 'tst-ols6-64', 'Oracle_64', 'ols6-x86_64-txs.iso', InstallTestVm.ksSataController, 12, InstallTestVm.kf64Bit),
InstallTestVm(oSet, 'tst-rhel5', 'RedHat', 'rhel5-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit | InstallTestVm.kfReqPae | InstallTestVm.kfReqIoApic),
InstallTestVm(oSet, 'tst-suse102', 'OpenSUSE', 'opensuse102-txs.iso', InstallTestVm.ksIdeController, 8, InstallTestVm.kf32Bit | InstallTestVm.kfReqIoApic),
## @todo InstallTestVm(oSet, 'tst-ubuntu606', 'Ubuntu', 'ubuntu606-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit),
## @todo InstallTestVm(oSet, 'tst-ubuntu710', 'Ubuntu', 'ubuntu710-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-ubuntu804', 'Ubuntu', 'ubuntu804-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit | InstallTestVm.kfUbuntuNewAmdBug | InstallTestVm.kfReqPae | InstallTestVm.kfReqIoApic),
InstallTestVm(oSet, 'tst-ubuntu804-64', 'Ubuntu_64', 'ubuntu804-amd64-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf64Bit),
InstallTestVm(oSet, 'tst-ubuntu904', 'Ubuntu', 'ubuntu904-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit | InstallTestVm.kfUbuntuNewAmdBug | InstallTestVm.kfReqPae),
InstallTestVm(oSet, 'tst-ubuntu904-64', 'Ubuntu_64', 'ubuntu904-amd64-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf64Bit),
InstallTestVm(oSet, 'tst-ubuntu1404', 'Ubuntu', 'ubuntu1404-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit | InstallTestVm.kfUbuntuNewAmdBug | InstallTestVm.kfReqPae),
InstallTestVm(oSet, 'tst-ubuntu1404-64','Ubuntu_64', 'ubuntu1404-amd64-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf64Bit),
InstallTestVm(oSet, 'tst-debian7', 'Debian', 'debian-7.0.0-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-debian7-64', 'Debian_64', 'debian-7.0.0-x64-txs.iso', InstallTestVm.ksSataController, 8, InstallTestVm.kf64Bit),
InstallTestVm(oSet, 'tst-w7-64', 'Windows7_64', 'win7-x64-txs.iso', InstallTestVm.ksSataController, 25, InstallTestVm.kf64Bit),
InstallTestVm(oSet, 'tst-w7-32', 'Windows7', 'win7-x86-txs.iso', InstallTestVm.ksSataController, 25, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-w2k3', 'Windows2003', 'win2k3ent-txs.iso', InstallTestVm.ksIdeController, 25, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-w2k', 'Windows2000', 'win2ksp0-txs.iso', InstallTestVm.ksIdeController, 25, InstallTestVm.kf32Bit | InstallTestVm.kfIdeIrqDelay),
InstallTestVm(oSet, 'tst-w2ksp4', 'Windows2000', 'win2ksp4-txs.iso', InstallTestVm.ksIdeController, 25, InstallTestVm.kf32Bit | InstallTestVm.kfIdeIrqDelay),
InstallTestVm(oSet, 'tst-wxp', 'WindowsXP', 'winxppro-txs.iso', InstallTestVm.ksIdeController, 25, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-wxpsp2', 'WindowsXP', 'winxpsp2-txs.iso', InstallTestVm.ksIdeController, 25, InstallTestVm.kf32Bit),
InstallTestVm(oSet, 'tst-wxp64', 'WindowsXP_64', 'winxp64-txs.iso', InstallTestVm.ksIdeController, 25, InstallTestVm.kf64Bit),
## @todo disable paravirt for Windows 8.1 guests as long as it's not fixed in the code
InstallTestVm(oSet, 'tst-w81-32', 'Windows81', 'win81-x86-txs.iso', InstallTestVm.ksSataController, 25, InstallTestVm.kf32Bit | InstallTestVm.kfNoWin81Paravirt),
InstallTestVm(oSet, 'tst-w81-64', 'Windows81_64', 'win81-x64-txs.iso', InstallTestVm.ksSataController, 25, InstallTestVm.kf64Bit | InstallTestVm.kfNoWin81Paravirt),
# pylint: enable=C0301
]);
#
# Overridden methods.
#
"""
Extend usage info
"""
return rc
"""
Extend standard options set
"""
if False:
pass;
# legacy, to be removed once TM is reconfigured.
else:
return iArg + 1
def legacyOptions(self):
""" Enables legacy option mode. """
if not self.fLegacyOptions:
return True;
def actionConfig(self):
return False;
def actionExecute(self):
"""
Execute the testcase.
"""
"""
Install guest OS and wait for result
"""
if not reporter.isLocal(): ## @todo need to figure a better way of handling timeouts on the testboxes ...
oSession, _ = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = False, cMsTimeout = cMsTimeout);
if oSession is not None:
# The guest has connected to TXS, so we're done (for now anyways).
## @todo Do save + restore.
return False
if __name__ == '__main__':