cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -*- coding: utf-8 -*-
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# $Id$
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox Test VMs
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync__copyright__ = \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCopyright (C) 2010-2014 Oracle Corporation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
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.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
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.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
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"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync__version__ = "$Revision$"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Standard Python imports.
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncimport re;
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncimport random;
1859e17ebfeca9bb36190ecf145a6d023eae00b4vboxsyncimport socket;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Validation Kit imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testdriver import base;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testdriver import reporter;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testdriver import vboxcon;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# All virtualization modes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_asVirtModes = ['hwvirt', 'hwvirt-np', 'raw',];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# All virtualization modes except for raw-mode.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_asVirtModesNoRaw = ['hwvirt', 'hwvirt-np',];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Dictionary mapping the virtualization mode mnemonics to a little less cryptic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# strings used in test descriptions.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_dsVirtModeDescs = {
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'raw' : 'Raw-mode',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'hwvirt' : 'HwVirt',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'hwvirt-np' : 'NestedPaging'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync};
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Arch constants.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_k32 = 32; # pylint: disable=C0103
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_k64 = 64; # pylint: disable=C0103
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_k32_64 = 96; # pylint: disable=C0103
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Array indexes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_iGuestOsType = 0;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_iKind = 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_iArch = 2;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_iMinCpu = 3;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_iMaxCpu = 4;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_iRegEx = 5;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Table translating from VM name core to a more detailed guest info.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# pylint: disable=C0301
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_aaNameToDetails = \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync[
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'WindowsNT4', 'WindowsNT4', g_k32, 1, 32, ['nt4', 'nt4sp[0-9]']], # max cpus??
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Windows2000', 'Windows2000', g_k32, 1, 32, ['w2k', 'w2ksp[0-9]', 'win2k', 'win2ksp[0-9]']], # max cpus??
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'WindowsXP', 'WindowsXP', g_k32, 1, 32, ['xp', 'xpsp[0-9]']],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'WindowsXP_64', 'WindowsXP_64', g_k64, 1, 32, ['xp64', 'xp64sp[0-9]']],
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Windows2003', 'Windows2003', g_k32, 1, 32, ['w2k3', 'w2k3sp[0-9]', 'win2k3', 'win2k3sp[0-9]']],
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'WindowsVista', 'WindowsVista', g_k32, 1, 32, ['vista', 'vistasp[0-9]']],
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Windows2008', 'Windows2008', g_k32, 1, 64, ['w2k8', 'w2k8sp[0-9]', 'win2k8', 'win2k8sp[0-9]']], # max cpus/cores??
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Windows2008_64', 'Windows2008_64', g_k64, 1, 64, ['w2k8r2', 'w2k8r2sp[0-9]', 'win2k8r2', 'win2k8r2sp[0-9]']], # max cpus/cores??
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Windows7', 'Windows7', g_k32, 1, 32, ['w7', 'w7sp[0-9]', 'win7',]], # max cpus/cores??
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Windows7_64', 'Windows7_64', g_k64, 1, 64, ['w7-64', 'w7sp[0-9]-64', 'win7-64',]], # max cpus/cores??
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Windows8', 'Windows8', g_k32, 1, 32, ['w8', 'w8sp[0-9]', 'win8',]], # max cpus/cores??
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Windows8_64', 'Windows8_64', g_k64, 1, 64, ['w8-64', 'w8sp[0-9]-64', 'win8-64',]], # max cpus/cores??
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Windows81', 'Windows81', g_k32, 1, 32, ['w81', 'w81sp[0-9]', 'win81',]], # max cpus/cores??
849851bf2ca145028b5729e48076e5723140affdvboxsync [ 'Windows81_64', 'Windows81_64', g_k64, 1, 64, ['w81-64', 'w81sp[0-9]-64', 'win81-64',]], # max cpus/cores??
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Linux', 'Debian', g_k32, 1, 256, ['deb[0-9]*', 'debian[0-9]*', ]],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Linux_64', 'Debian_64', g_k64, 1, 256, ['deb[0-9]*-64', 'debian[0-9]*-64', ]],
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Linux', 'RedHat', g_k32, 1, 256, ['rhel', 'rhel[0-9]', 'rhel[0-9]u[0-9]']],
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Linux', 'Fedora', g_k32, 1, 256, ['fedora', 'fedora[0-9]*', ]],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Linux_64', 'Fedora_64', g_k64, 1, 256, ['fedora-64', 'fedora[0-9]*-64', ]],
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Linux', 'Oracle', g_k32, 1, 256, ['ols[0-9]*', 'oel[0-9]*', ]],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Linux_64', 'Oracle_64', g_k64, 1, 256, ['ols[0-9]*-64', 'oel[0-9]*-64', ]],
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Linux', 'OpenSUSE', g_k32, 1, 256, ['opensuse[0-9]*', 'suse[0-9]*', ]],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Linux_64', 'OpenSUSE_64', g_k64, 1, 256, ['opensuse[0-9]*-64', 'suse[0-9]*-64', ]],
2849c1c13746836fae51db4f2a934e0a2de6f120vboxsync [ 'Linux', 'Ubuntu', g_k32, 1, 256, ['ubuntu[0-9]*', ]],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Linux_64', 'Ubuntu_64', g_k64, 1, 256, ['ubuntu[0-9]*-64', ]],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Solaris', 'Solaris', g_k32, 1, 256, ['sol10', 'sol10u[0-9]']],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Solaris_64', 'Solaris_64', g_k64, 1, 256, ['sol10-64', 'sol10u-64[0-9]']],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Solaris_64', 'Solaris11_64', g_k64, 1, 256, ['sol11u1']],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'BSD', 'FreeBSD_64', g_k32_64, 1, 1, ['bs-.*']], # boot sectors, wanted 64-bit type.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync## @name Guest OS type string constants.
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync## @{
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksGuestOsTypeDarwin = 'darwin';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksGuestOsTypeFreeBSD = 'freebsd';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksGuestOsTypeLinux = 'linux';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksGuestOsTypeOS2 = 'os2';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksGuestOsTypeSolaris = 'solaris';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksGuestOsTypeWindows = 'windows';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync## @}
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync## @name String constants for paravirtualization providers.
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync## @{
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksParavirtProviderNone = 'none';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksParavirtProviderDefault = 'default';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksParavirtProviderLegacy = 'legacy';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksParavirtProviderMinimal = 'minimal';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_ksParavirtProviderHyperV = 'hyperv';
42634b0ae449be8d087db91b81384bce7a5c21c3vboxsyncg_ksParavirtProviderKVM = 'kvm';
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync## @}
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync## Valid paravirtualization providers.
fef7670f1122a99df607422af1622eb495f5ba4fvboxsyncg_kasParavirtProviders = ( g_ksParavirtProviderNone, g_ksParavirtProviderDefault, g_ksParavirtProviderLegacy,
42634b0ae449be8d087db91b81384bce7a5c21c3vboxsync g_ksParavirtProviderMinimal, g_ksParavirtProviderHyperV, g_ksParavirtProviderKVM );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Mapping for support of paravirtualisation providers per guest OS.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync#g_kdaParavirtProvidersSupported = {
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# g_ksGuestOsTypeDarwin : ( g_ksParavirtProviderMinimal, ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# g_ksGuestOsTypeFreeBSD : ( g_ksParavirtProviderNone, g_ksParavirtProviderMinimal, ),
42634b0ae449be8d087db91b81384bce7a5c21c3vboxsync# g_ksGuestOsTypeLinux : ( g_ksParavirtProviderNone, g_ksParavirtProviderMinimal, g_ksParavirtProviderHyperV, g_ksParavirtProviderKVM),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# g_ksGuestOsTypeOS2 : ( g_ksParavirtProviderNone, ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# g_ksGuestOsTypeSolaris : ( g_ksParavirtProviderNone, ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# g_ksGuestOsTypeWindows : ( g_ksParavirtProviderNone, g_ksParavirtProviderMinimal, g_ksParavirtProviderHyperV, )
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync#}
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Temporary tweak:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# since for the most guests g_ksParavirtProviderNone is almost the same as g_ksParavirtProviderMinimal,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# g_ksParavirtProviderMinimal is removed from the list in order to get maximum number of unique choices
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# during independent test runs when paravirt provider is taken randomly.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_kdaParavirtProvidersSupported = {
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksGuestOsTypeDarwin : ( g_ksParavirtProviderMinimal, ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksGuestOsTypeFreeBSD : ( g_ksParavirtProviderNone, ),
42634b0ae449be8d087db91b81384bce7a5c21c3vboxsync g_ksGuestOsTypeLinux : ( g_ksParavirtProviderNone, g_ksParavirtProviderHyperV, g_ksParavirtProviderKVM),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksGuestOsTypeOS2 : ( g_ksParavirtProviderNone, ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksGuestOsTypeSolaris : ( g_ksParavirtProviderNone, ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksGuestOsTypeWindows : ( g_ksParavirtProviderNone, g_ksParavirtProviderHyperV, )
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync}
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# pylint: enable=C0301
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncdef _intersects(asSet1, asSet2):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Checks if any of the strings in set 1 matches any of the regular
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync expressions in set 2.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for sStr1 in asSet1:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for sRx2 in asSet2:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if re.match(sStr1, sRx2 + '$'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncclass TestVm(object):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync A Test VM - name + VDI/whatever.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync This is just a data object.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def __init__(self, oSet, sVmName, sHd = None, sKind = None, acCpusSup = None, asVirtModesSup = None, # pylint: disable=R0913
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fIoApic = None, fPae = None, sNic0AttachType = None, sHddControllerType = 'IDE Controller',
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync sFloppy = None, fVmmDevTestingPart = None, fVmmDevTestingMmio = False, asParavirtModesSup = None,
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync fRandomPvPMode = False):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.oSet = oSet;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sVmName = sVmName;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sHd = sHd; # Relative to the testrsrc root.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.acCpusSup = acCpusSup;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModesSup = asVirtModesSup;
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync self.asParavirtModesSup = asParavirtModesSup;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sKind = sKind;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sGuestOsType = None;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sDvdImage = None; # Relative to the testrsrc root.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.fIoApic = fIoApic;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.fPae = fPae;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sNic0AttachType = sNic0AttachType;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sHddControllerType = sHddControllerType;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sFloppy = sFloppy; # Relative to the testrsrc root, except when it isn't...
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.fVmmDevTestingPart = fVmmDevTestingPart;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.fVmmDevTestingMmio = fVmmDevTestingMmio;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync self.fSnapshotRestoreCurrent = False; # Whether to restore execution on the current snapshot.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.fSkip = False; # All VMs are included in the configured set by default.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.aInfo = None;
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync self._guessStuff(fRandomPvPMode);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def _mkCanonicalGuestOSType(self, sType):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Convert guest OS type into constant representation.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Raise exception if specified @param sType is unknown.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sType.lower().startswith('darwin'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return g_ksGuestOsTypeDarwin
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sType.lower().startswith('bsd'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return g_ksGuestOsTypeFreeBSD
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sType.lower().startswith('linux'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return g_ksGuestOsTypeLinux
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sType.lower().startswith('os2'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return g_ksGuestOsTypeOS2
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sType.lower().startswith('solaris'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return g_ksGuestOsTypeSolaris
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sType.lower().startswith('windows'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return g_ksGuestOsTypeWindows
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.GenError(sWhat="unknown guest OS kind: %s" % str(sType))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync def _guessStuff(self, fRandomPvPMode):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Used by the constructor to guess stuff.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sNm = self.sVmName.lower().strip();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asSplit = sNm.replace('-', ' ').split(' ');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sKind is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # From name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for aInfo in g_aaNameToDetails:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if _intersects(asSplit, aInfo[g_iRegEx]):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.aInfo = aInfo;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sGuestOsType = self._mkCanonicalGuestOSType(aInfo[g_iGuestOsType])
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sKind = aInfo[g_iKind];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync break;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sKind is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.fatal('The OS of test VM "%s" cannot be guessed' % (self.sVmName,));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Check for 64-bit, if required and supported.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.aInfo[g_iArch] == g_k32_64 and _intersects(asSplit, ['64', 'amd64']):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sKind = self.sKind + '_64';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Lookup the kind.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for aInfo in g_aaNameToDetails:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sKind == aInfo[g_iKind]:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.aInfo = aInfo;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync break;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.aInfo is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.fatal('The OS of test VM "%s" with sKind="%s" cannot be guessed' % (self.sVmName, self.sKind));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Translate sKind into sGuest OS Type.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sGuestOsType is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.aInfo is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sGuestOsType = self._mkCanonicalGuestOSType(self.aInfo[g_iGuestOsType])
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif self.sKind.find("Windows") >= 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sGuestOsType = g_ksGuestOsTypeWindows
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif self.sKind.find("Linux") >= 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sGuestOsType = g_ksGuestOsTypeLinux;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif self.sKind.find("Solaris") >= 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sGuestOsType = g_ksGuestOsTypeSolaris;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.fatal('The OS of test VM "%s", sKind="%s" cannot be guessed' % (self.sVmName, self.sKind));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Restrict modes and such depending on the OS.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.asVirtModesSup is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModesSup = list(g_asVirtModes);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sGuestOsType in (g_ksGuestOsTypeOS2, g_ksGuestOsTypeDarwin):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModesSup = [sVirtMode for sVirtMode in self.asVirtModesSup if sVirtMode != 'raw'];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sKind.find('_64') > 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModesSup = [sVirtMode for sVirtMode in self.asVirtModesSup if sVirtMode != 'raw'];
1859e17ebfeca9bb36190ecf145a6d023eae00b4vboxsync # TEMPORARY HACK - START
1859e17ebfeca9bb36190ecf145a6d023eae00b4vboxsync sHostName = socket.getfqdn();
1859e17ebfeca9bb36190ecf145a6d023eae00b4vboxsync if sHostName.startswith('testboxpile1'):
1859e17ebfeca9bb36190ecf145a6d023eae00b4vboxsync self.asVirtModesSup = [sVirtMode for sVirtMode in self.asVirtModesSup if sVirtMode != 'raw'];
1859e17ebfeca9bb36190ecf145a6d023eae00b4vboxsync # TEMPORARY HACK - END
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Restrict the CPU count depending on the OS and/or percieved SMP readiness.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.acCpusSup is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if _intersects(asSplit, ['uni']):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.acCpusSup = [1];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif self.aInfo is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.acCpusSup = [i for i in range(self.aInfo[g_iMinCpu], self.aInfo[g_iMaxCpu]) ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.acCpusSup = [1];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync # Figure relevant PV modes based on the OS.
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync if self.asParavirtModesSup is None:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync self.asParavirtModesSup = g_kdaParavirtProvidersSupported[self.sGuestOsType];
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync ## @todo Remove this hack as soon as we've got around to explictly configure test variations
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync ## on the server side. Client side random is interesting but not the best option.
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync if fRandomPvPMode:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync random.seed();
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync self.asParavirtModesSup = (random.choice(self.asParavirtModesSup),);
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def getReconfiguredVm(self, oTestDrv, cCpus, sVirtMode, sParavirtMode = None):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync actionExecute worker that finds and reconfigure a test VM.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns (fRc, oVM) where fRc is True, None or False and oVM is a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync VBox VM object that is only present when rc is True.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oVM = oTestDrv.getVmByName(self.sVmName);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oVM is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.fSnapshotRestoreCurrent is True:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fHostSupports64bit = oTestDrv.hasHostLongMode();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.is64bitRequired() and not fHostSupports64bit:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = None; # Skip the test.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif self.isViaIncompatible() and oTestDrv.isHostCpuVia():
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = None; # Skip the test.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSession = oTestDrv.openSession(oVM);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oSession is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = oSession.enableVirtEx(sVirtMode != 'raw');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.enableNestedPaging(sVirtMode == 'hwvirt-np');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.setCpuCount(cCpus);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
580e040eb04ce04ec23c4a2a32ee89445bedcc21vboxsync if sParavirtMode is not None and oSession.fpApiVer >= 5.0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync adParavirtProviders = {
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksParavirtProviderNone : vboxcon.ParavirtProvider_None,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksParavirtProviderDefault: vboxcon.ParavirtProvider_Default,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksParavirtProviderLegacy : vboxcon.ParavirtProvider_Legacy,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksParavirtProviderMinimal: vboxcon.ParavirtProvider_Minimal,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_ksParavirtProviderHyperV : vboxcon.ParavirtProvider_HyperV,
42634b0ae449be8d087db91b81384bce7a5c21c3vboxsync g_ksParavirtProviderKVM : vboxcon.ParavirtProvider_KVM,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync };
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.setParavirtProvider(adParavirtProviders[sParavirtMode]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fCfg64Bit = self.is64bitRequired() or (self.is64bit() and fHostSupports64bit and sVirtMode != 'raw');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.enableLongMode(fCfg64Bit);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if fCfg64Bit: # This is to avoid GUI pedantic warnings in the GUI. Sigh.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oOsType = oSession.getOsType();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oOsType is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oOsType.is64Bit and sVirtMode == 'raw':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync assert(oOsType.id[-3:] == '_64');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.setOsType(oOsType.id[:-3]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif not oOsType.is64Bit and sVirtMode != 'raw':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.setOsType(oOsType.id + '_64');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and oSession.saveSettings();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if not oSession.close():
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if fRc is True:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return (True, oVM);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return (fRc, None);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def isWindows(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """ Checks if it's a Windows VM. """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return self.sGuestOsType == g_ksGuestOsTypeWindows;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def isOS2(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """ Checks if it's an OS/2 VM. """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return self.sGuestOsType == g_ksGuestOsTypeOS2;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def is64bit(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """ Checks if it's a 64-bit VM. """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return self.sKind.find('_64') >= 0;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def is64bitRequired(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """ Check if 64-bit is required or not. """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return (self.aInfo[g_iArch] & g_k64) != 0;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def isLoggedOntoDesktop(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """ Checks if the test VM is logging onto a graphical desktop by default. """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.isWindows():
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.isOS2():
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sVmName.find('-desktop'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def isViaIncompatible(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Identifies VMs that doesn't work on VIA.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns True if NOT supported on VIA, False if it IS supported.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Oracle linux doesn't like VIA in our experience
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.aInfo[g_iKind] in ['Oracle', 'Oracle_64']:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # OS/2: "The system detected an internal processing error at location
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # 0168:fff1da1f - 000e:ca1f. 0a8606fd
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.isOS2():
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Windows NT4 before SP4 won't work because of cmpxchg8b not being
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # detected, leading to a STOP 3e(80,0,0,0).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.aInfo[g_iKind] == 'WindowsNT4':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sVmName.find('sp') < 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True; # no service pack.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if self.sVmName.find('sp0') >= 0 \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync or self.sVmName.find('sp1') >= 0 \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync or self.sVmName.find('sp2') >= 0 \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync or self.sVmName.find('sp3') >= 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncclass BootSectorTestVm(TestVm):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync A Boot Sector Test VM.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def __init__(self, oSet, sVmName, sFloppy = None, asVirtModesSup = None, f64BitRequired = False):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.f64BitRequired = f64BitRequired;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if asVirtModesSup is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asVirtModesSup = list(g_asVirtModes);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync TestVm.__init__(self, oSet, sVmName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync acCpusSup = [1,],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sFloppy = sFloppy,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asVirtModesSup = asVirtModesSup,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fPae = True,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fIoApic = True,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fVmmDevTestingPart = True,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fVmmDevTestingMmio = True,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def is64bitRequired(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return self.f64BitRequired;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncclass TestVmSet(object):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync A set of Test VMs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def __init__(self, oTestVmManager = None, acCpus = None, asVirtModes = None, fIgnoreSkippedVm = False):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.oTestVmManager = oTestVmManager;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if acCpus is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync acCpus = [1, 2];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.acCpusDef = acCpus;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.acCpus = acCpus;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if asVirtModes is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asVirtModes = list(g_asVirtModes);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModesDef = asVirtModes;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModes = asVirtModes;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.aoTestVms = [];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.fIgnoreSkippedVm = fIgnoreSkippedVm;
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync self.asParavirtModes = None; ##< If None, use the first PV mode of the test VM, otherwise all modes in this list.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def findTestVmByName(self, sVmName):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns the TestVm object with the given name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns None if not found.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for oTestVm in self.aoTestVms:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm.sVmName == sVmName:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return oTestVm;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return None;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def getAllVmNames(self, sSep = ':'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns names of all the test VMs in the set separated by
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sSep (defaults to ':').
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sVmNames = '';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for oTestVm in self.aoTestVms:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sVmNames == '':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sVmNames = oTestVm.sVmName;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sVmNames = sVmNames + sSep + oTestVm.sVmName;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return sVmNames;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def showUsage(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Invoked by vbox.TestDriver.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('Test VM selection and general config options:');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' --virt-modes <m1[:m2[:]]');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' Default: %s' % (':'.join(self.asVirtModesDef)));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' --skip-virt-modes <m1[:m2[:]]');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' Use this to avoid hwvirt or hwvirt-np when not supported by the host');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' since we cannot detect it using the main API. Use after --virt-modes.');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' --cpu-counts <c1[:c2[:]]');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' Default: %s' % (':'.join(str(c) for c in self.acCpusDef)));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' --test-vms <vm1[:vm2[:...]]>');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' Test the specified VMs in the given order. Use this to change');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' the execution order or limit the choice of VMs');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' Default: %s (all)' % (self.getAllVmNames(),));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' --skip-vms <vm1[:vm2[:...]]>');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' Skip the specified VMs when testing.');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' --snapshot-restore-current');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log(' Restores the current snapshot and resumes execution.');
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync reporter.log(' --paravirt-modes <pv1[:pv2[:]]>');
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync reporter.log(' Set of paravirtualized providers (modes) to tests. Intersected with what the test VM supports.');
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync reporter.log(' Default is the first PV mode the test VMs support, generally same as "legacy".');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ## @todo Add more options for controlling individual VMs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def parseOption(self, asArgs, iArg):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Parses the set test vm set options (--test-vms and --skip-vms), modifying the set
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Invoked by the testdriver method with the same name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Keyword arguments:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asArgs -- The argument vector.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iArg -- The index of the current argument.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns iArg if the option was not recognized and the caller should handle it.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns the index of the next argument when something is consumed.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync In the event of a syntax error, a InvalidOption or QuietInvalidOption
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync is thrown.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if asArgs[iArg] == '--virt-modes':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iArg += 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if iArg >= len(asArgs):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--virt-modes" takes a colon separated list of modes');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModes = asArgs[iArg].split(':');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for s in self.asVirtModes:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if s not in self.asVirtModesDef:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--virt-modes" value "%s" is not valid; valid values are: %s' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % (s, ' '.join(self.asVirtModesDef)));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif asArgs[iArg] == '--skip-virt-modes':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iArg += 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if iArg >= len(asArgs):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--skip-virt-modes" takes a colon separated list of modes');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for s in asArgs[iArg].split(':'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if s not in self.asVirtModesDef:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--virt-modes" value "%s" is not valid; valid values are: %s' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % (s, ' '.join(self.asVirtModesDef)));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if s in self.asVirtModes:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModes.remove(s);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif asArgs[iArg] == '--cpu-counts':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iArg += 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if iArg >= len(asArgs):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--cpu-counts" takes a colon separated list of cpu counts');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.acCpus = [];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for s in asArgs[iArg].split(':'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync try: c = int(s);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync except: raise base.InvalidOption('The "--cpu-counts" value "%s" is not an integer' % (s,));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if c <= 0: raise base.InvalidOption('The "--cpu-counts" value "%s" is zero or negative' % (s,));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.acCpus.append(c);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif asArgs[iArg] == '--test-vms':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iArg += 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if iArg >= len(asArgs):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--test-vms" takes colon separated list');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for oTestVm in self.aoTestVms:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm.fSkip = True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asTestVMs = asArgs[iArg].split(':');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for s in asTestVMs:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = self.findTestVmByName(s);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--test-vms" value "%s" is not valid; valid values are: %s' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % (s, self.getAllVmNames(' ')));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm.fSkip = False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif asArgs[iArg] == '--skip-vms':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iArg += 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if iArg >= len(asArgs):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--skip-vms" takes colon separated list');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asTestVMs = asArgs[iArg].split(':');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for s in asTestVMs:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = self.findTestVmByName(s);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('warning: The "--test-vms" value "%s" does not specify any of our test VMs.' % (s,));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm.fSkip = True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif asArgs[iArg] == '--snapshot-restore-current':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for oTestVm in self.aoTestVms:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm.fSkip is False:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm.fSnapshotRestoreCurrent = True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('VM "%s" will be restored.' % (oTestVm.sVmName));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif asArgs[iArg] == '--paravirt-modes':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iArg += 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if iArg >= len(asArgs):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise base.InvalidOption('The "--paravirt-modes" takes a colon separated list of modes');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asParavirtModes = asArgs[iArg].split(':')
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync for sPvMode in self.asParavirtModes:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync if sPvMode not in g_kasParavirtProviders:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync raise base.InvalidOption('The "--paravirt-modes" value "%s" is not valid; valid values are: %s'
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync % (sPvMode, ', '.join(g_kasParavirtProviders),));
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync if len(self.asParavirtModes) == 0:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync self.asParavirtModes = None;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return iArg;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return iArg + 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def getResourceSet(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Implements base.TestDriver.getResourceSet
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asResources = [];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for oTestVm in self.aoTestVms:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if not oTestVm.fSkip:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm.sHd is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asResources.append(oTestVm.sHd);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm.sDvdImage is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asResources.append(oTestVm.sDvdImage);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return asResources;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def actionConfig(self, oTestDrv, eNic0AttachType = None, sDvdImage = None):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync For base.TestDriver.actionConfig. Configure the VMs with defaults and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync a few tweaks as per arguments.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns True if successful.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns False if not.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for oTestVm in self.aoTestVms:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm.fSkip:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync continue;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm.fSnapshotRestoreCurrent:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # If we want to restore a VM we don't need to create
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # the machine anymore -- so just add it to the test VM list.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oVM = oTestDrv.addTestMachine(oTestVm.sVmName);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ## @todo This could possibly be moved to the TestVM object.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sDvdImage is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sMyDvdImage = sDvdImage;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sMyDvdImage = oTestVm.sDvdImage;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if eNic0AttachType is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync eMyNic0AttachType = eNic0AttachType;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif oTestVm.sNic0AttachType is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync eMyNic0AttachType = None;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif oTestVm.sNic0AttachType == 'nat':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync eMyNic0AttachType = vboxcon.NetworkAttachmentType_NAT;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif oTestVm.sNic0AttachType == 'bridged':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync eMyNic0AttachType = vboxcon.NetworkAttachmentType_Bridged;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync assert False, oTestVm.sNic0AttachType;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oVM = oTestDrv.createTestVM(oTestVm.sVmName, 1, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHd = oTestVm.sHd, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = oTestVm.sKind, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fIoApic = oTestVm.fIoApic, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fPae = oTestVm.fPae, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync eNic0AttachType = eMyNic0AttachType, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sDvdImage = sMyDvdImage, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHddControllerType = oTestVm.sHddControllerType,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sFloppy = oTestVm.sFloppy,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fVmmDevTestingPart = oTestVm.fVmmDevTestingPart,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fVmmDevTestingMmio = oTestVm.fVmmDevTestingPart);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oVM is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def _removeUnsupportedVirtModes(self, oTestDrv):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Removes unsupported virtualization modes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if 'hwvirt' in self.asVirtModes and not oTestDrv.hasHostHwVirt():
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('Hardware assisted virtualization is not available on the host, skipping it.');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModes.remove('hwvirt');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if 'hwvirt-np' in self.asVirtModes and not oTestDrv.hasHostNestedPaging():
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('Nested paging not supported by the host, skipping it.');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.asVirtModes.remove('hwvirt-np');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def actionExecute(self, oTestDrv, fnCallback): # pylint: disable=R0914
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync For base.TestDriver.actionExecute. Calls the callback function for
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync each of the VMs and basic configuration variations (virt-mode and cpu
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync count).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns True if all fnCallback calls returned True, otherwise False.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync The callback can return True, False or None. The latter is for when the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync test is skipped. (True is for success, False is for failure.)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._removeUnsupportedVirtModes(oTestDrv);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cMaxCpus = oTestDrv.getHostCpuCount();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # The test loop.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for oTestVm in self.aoTestVms:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm.fSkip and self.fIgnoreSkippedVm:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log2('Ignoring VM %s (fSkip = True).' % (oTestVm.sVmName,));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync continue;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.testStart(oTestVm.sVmName);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestVm.fSkip:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.testDone(fSkipped = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync continue;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Intersect the supported modes and the ones being testing.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asVirtModesSup = [sMode for sMode in oTestVm.asVirtModesSup if sMode in self.asVirtModes];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Ditto for CPUs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync acCpusSup = [cCpus for cCpus in oTestVm.acCpusSup if cCpus in self.acCpus];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync # Ditto for paravirtualization modes, except if not specified we got a less obvious default.
580e040eb04ce04ec23c4a2a32ee89445bedcc21vboxsync if self.asParavirtModes is not None and oTestDrv.fpApiVer >= 5.0:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync asParavirtModes = [sPvMode for sPvMode in oTestVm.asParavirtModesSup if sPvMode in self.asParavirtModes];
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync assert None not in asParavirtModes;
580e040eb04ce04ec23c4a2a32ee89445bedcc21vboxsync elif oTestDrv.fpApiVer >= 5.0:
8408ef7882c21890435b6b0d26ba1e39b8d7e3devboxsync asParavirtModes = (oTestVm.asParavirtModesSup[0],);
8408ef7882c21890435b6b0d26ba1e39b8d7e3devboxsync assert asParavirtModes[0] is not None;
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync else:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync asParavirtModes = (None,);
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for cCpus in acCpusSup:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if cCpus == 1:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.testStart('1 cpu');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync else:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.testStart('%u cpus' % (cCpus));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if cCpus > cMaxCpus:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.testDone(fSkipped = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync continue;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cTests = 0;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for sVirtMode in asVirtModesSup:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sVirtMode == 'raw' and cCpus > 1:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync continue;
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync reporter.testStart('%s' % ( g_dsVirtModeDescs[sVirtMode], ) );
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync cStartTests = cTests;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync for sParavirtMode in asParavirtModes:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync if sParavirtMode is not None:
580e040eb04ce04ec23c4a2a32ee89445bedcc21vboxsync assert oTestDrv.fpApiVer >= 5.0;
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync reporter.testStart('%s' % ( sParavirtMode, ) );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Reconfigure the VM.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync try:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync (rc2, oVM) = oTestVm.getReconfiguredVm(oTestDrv, cCpus, sVirtMode, sParavirtMode = sParavirtMode);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync except KeyboardInterrupt:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync except:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.errorXcpt(cFrames = 9);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync rc2 = False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if rc2 is True:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync # Do the testing.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync try:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync rc2 = fnCallback(oVM, oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync except KeyboardInterrupt:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync except:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.errorXcpt(cFrames = 9);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync rc2 = False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if rc2 is False:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.maybeErr(reporter.testErrorCount() == 0, 'fnCallback failed');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif rc2 is False:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.log('getReconfiguredVm failed');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if rc2 is False:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cTests = cTests + (rc2 is not None);
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync if sParavirtMode is not None:
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync reporter.testDone(fSkipped = (rc2 is None));
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync
fef7670f1122a99df607422af1622eb495f5ba4fvboxsync reporter.testDone(fSkipped = cTests == cStartTests);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync reporter.testDone(fSkipped = cTests == 0);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync _, cErrors = reporter.testDone();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if cErrors > 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = False;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return fRc;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def enumerateTestVms(self, fnCallback):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Enumerates all the 'active' VMs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns True if all fnCallback calls returned True.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns False if any returned False.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Returns None immediately if fnCallback returned None.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = True;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for oTestVm in self.aoTestVms:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if not oTestVm.fSkip:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc2 = fnCallback(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if fRc2 is None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return fRc2;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fRc = fRc and fRc2;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return fRc;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncclass TestVmManager(object):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Test VM manager.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def __init__(self, sResourcePath):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.sResourcePath = sResourcePath;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def getStandardVmSet(self, sTxsTransport):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Gets the set of standard test VMs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync This is supposed to do something seriously clever, like searching the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync testrsrc tree for usable VMs, but for the moment it's all hard coded. :-)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet = TestVmSet(oTestVmManager = self);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-nt4sp1', sHd = '4.2/' + sTxsTransport + '/nt4sp1/t-nt4sp1.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsNT4', acCpusSup = [1]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xppro', sHd = '4.2/' + sTxsTransport + '/xppro/t-xppro.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-nt4sp6', sHd = '4.2/nt4sp6/t-nt4sp6.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsNT4', acCpusSup = range(1, 33));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-2ksp4', sHd = '4.2/win2ksp4/t-win2ksp4.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Windows2000', acCpusSup = range(1, 33));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2', sHd = '4.2/xpsp2/t-winxpsp2.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halaacpi', sHd = '4.2/xpsp2/t-winxp-halaacpi.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halacpi', sHd = '4.2/xpsp2/t-winxp-halacpi.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halapic', sHd = '4.2/xpsp2/t-winxp-halapic.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halmacpi', sHd = '4.2/xpsp2/t-winxp-halmacpi.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(2, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halmps', sHd = '4.2/xpsp2/t-winxp-halmps.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(2, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-win7', sHd = '4.2/win7-32/t-win7.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Windows7', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-win8', sHd = '4.2/win8-32/t-win8.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Windows8', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return oSet;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def getSmokeVmSet(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Gets a representative set of VMs for smoke testing.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet = TestVmSet(oTestVmManager = self);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-nt4sp1', sHd = '4.2/nat/nt4sp1/t-nt4sp1.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsNT4', acCpusSup = [1], sNic0AttachType = 'nat');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xppro', sHd = '4.2/nat/xppro/t-xppro.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), sNic0AttachType = 'nat');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-rhel5', sHd = '3.0/tcp/rhel5.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'RedHat', acCpusSup = range(1, 33), fIoApic = True, sNic0AttachType = 'nat');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-win2k3ent', sHd = '3.0/tcp/win2k3ent-acpi.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Windows2003', acCpusSup = range(1, 33), fPae = True, sNic0AttachType = 'bridged');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-sol10', sHd = '3.0/tcp/solaris10.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Solaris', acCpusSup = range(1, 33), fPae = True, sNic0AttachType = 'bridged');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-sol10-64', sHd = '3.0/tcp/solaris10.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Solaris_64', acCpusSup = range(1, 33), sNic0AttachType = 'bridged');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-sol11u1', sHd = '4.2/nat/sol11u1/t-sol11u1.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Solaris11_64', acCpusSup = range(1, 33), sNic0AttachType = 'nat',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fIoApic = True, sHddControllerType = 'SATA Controller');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-nt4sp6', sHd = '4.2/nt4sp6/t-nt4sp6.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsNT4', acCpusSup = range(1, 33));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-2ksp4', sHd = '4.2/win2ksp4/t-win2ksp4.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Windows2000', acCpusSup = range(1, 33));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2', sHd = '4.2/xpsp2/t-winxpsp2.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halaacpi', sHd = '4.2/xpsp2/t-winxp-halaacpi.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halacpi', sHd = '4.2/xpsp2/t-winxp-halacpi.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halapic', sHd = '4.2/xpsp2/t-winxp-halapic.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halmacpi', sHd = '4.2/xpsp2/t-winxp-halmacpi.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(2, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-xpsp2-halmps', sHd = '4.2/xpsp2/t-winxp-halmps.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'WindowsXP', acCpusSup = range(2, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-win7', sHd = '4.2/win7-32/t-win7.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Windows7', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestVm = TestVm(oSet, 'tst-win8', sHd = '4.2/win8-32/t-win8.vdi',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sKind = 'Windows8', acCpusSup = range(1, 33), fIoApic = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oSet.aoTestVms.append(oTestVm);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return oSet;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def shutUpPyLint(self):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """ Shut up already! """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return self.sResourcePath;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync