VirtualBox

Ignore:
Timestamp:
Jul 25, 2019 3:06:33 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132401
Message:

ValKit/tdGuestOsUnattendedInst1.py: XP tests. bugref:9151

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsUnattendedInst1.py

    r79933 r79970  
    4949from testdriver import vboxcon;
    5050from testdriver import vboxtestvms;
     51from common     import utils;
    5152
    5253# Sub-test driver imports.
     
    6364    kfUbuntuAvx2Crash       = 0x0001; ##< Disables AVX2 as ubuntu 16.04 think it means AVX512 is available and compiz crashes.
    6465    kfNoGAs                 = 0x0002; ##< No guest additions installation possible.
     66    kfKeyFile               = 0x0004; ##< ISO requires a .key file containing the product key.
     67    kfNeedCom1              = 0x0008; ##< Need serial port, typically for satifying the windows kernel debugger.
     68
    6569    kfIdeIrqDelay           = 0x1000;
    6670    kfUbuntuNewAmdBug       = 0x2000;
     
    9094        if fFlags & self.kfIdeIrqDelay:
    9195            self.asOptExtraData    += self.kasIdeIrqDelay;
     96        if fFlags & self.kfNeedCom1:
     97            self.fCom1RawFile       = True;
    9298
    9399    def _unattendedConfigure(self, oIUnattended, oTestDrv): # type: (Any, vbox.TestDriver) -> bool
     
    122128            else:
    123129                reporter.log("Warning! Ignoring request to install Guest Additions as kfNoGAs is set!");
     130
     131        #
     132        # Product key?
     133        #
     134        if self.fInstVmFlags & UnattendedVm.kfKeyFile:
     135            sKeyFile = '';
     136            sKey     = '';
     137            try:
     138                sKeyFile = oIUnattended.isoPath + '.key';
     139                oFile = utils.openNoInherit(sKeyFile);
     140                for sLine in oFile:
     141                    sLine = sLine.strip();
     142                    if sLine and not sLine.startswith(';') and not sLine.startswith('#') and not sLine.startswith('//'):
     143                        sKey = sLine;
     144                        break;
     145                oFile.close();
     146            except:
     147                return reporter.errorXcpt('sKeyFile=%s' % (sKeyFile,));
     148            if not sKey:
     149                return reporter.error('No key in keyfile (%s)!' % (sKeyFile,));
     150            try:    oIUnattended.productKey = sKey;
     151            except: return reporter.errorXcpt();
    124152
    125153        return True;
     
    192220
    193221    def getResourceSet(self):
     222        asRet = [];
    194223        if not os.path.isabs(self.sInstallIso):
    195             return [self.sInstallIso,];
    196         return [];
     224            asRet.append(self.sInstallIso);
     225            if self.fInstVmFlags & UnattendedVm.kfKeyFile:
     226                asRet.append(self.sInstallIso + '.key');
     227        return asRet;
    197228
    198229    def _createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage):
     
    202233        # We want predicable results.
    203234        #
    204         if     eNic0AttachType is None \
    205           and self.isLinux() \
    206            and (   'ubuntu' in self.sKind.lower()
    207                 or 'debian' in self.sKind.lower() ):
    208             eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnly;
     235        if eNic0AttachType is None:
     236            if self.isLinux() \
     237               and (   'ubuntu' in self.sKind.lower()
     238                    or 'debian' in self.sKind.lower()):
     239                eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnly;
     240
     241            # Also use it for windows xp to prevent it from ever going online.
     242            if self.sKind in ('WindowsXP','WindowsXP_64',):
     243                eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnly;
    209244
    210245        return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage);
     
    400435        oSet.aoTestVms.extend([
    401436            #
    402             # Windows
     437            # Windows.  The older windows ISOs requires a keyfile (for xp sp3
     438            # pick a key from the PID.INF file on the ISO).
    403439            #
     440            UnattendedVm(oSet, 'tst-xp-32',       'WindowsXP',       '6.0/uaisos/en_winxp_pro_x86_build2600_iso.img', UnattendedVm.kfKeyFile), # >=2GiB
     441            UnattendedVm(oSet, 'tst-xpsp2-32',    'WindowsXP',       '6.0/uaisos/en_winxp_pro_with_sp2.iso', UnattendedVm.kfKeyFile),          # >=2GiB
     442            UnattendedVm(oSet, 'tst-xpsp3-32',    'WindowsXP',       '6.0/uaisos/en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso', UnattendedVm.kfKeyFile), # >=2GiB
     443            UnattendedVm(oSet, 'tst-xp-64',       'WindowsXP_64',    '6.0/uaisos/en_win_xp_pro_x64_vl.iso', UnattendedVm.kfKeyFile), # >=3GiB
     444            UnattendedVm(oSet, 'tst-xpsp2-64',    'WindowsXP_64',    '6.0/uaisos/en_win_xp_pro_x64_with_sp2_vl_x13-41611.iso', UnattendedVm.kfKeyFile), # >=3GiB
     445            #fixme: UnattendedVm(oSet, 'tst-xpchk-64',    'WindowsXP_64',    '6.0/uaisos/en_windows_xp_professional_x64_chk.iso', UnattendedVm.kfKeyFile | UnattendedVm.kfNeedCom1), # >=3GiB
     446            # No key files needed:
    404447            UnattendedVm(oSet, 'tst-vista-32',    'WindowsVista',    '6.0/uaisos/en_windows_vista_ee_x86_dvd_vl_x13-17271.iso'),          # >=6GiB
    405448            UnattendedVm(oSet, 'tst-vista-64',    'WindowsVista_64', '6.0/uaisos/en_windows_vista_enterprise_x64_dvd_vl_x13-17316.iso'),  # >=8GiB
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette