VirtualBox

Changeset 98592 in vbox


Ignore:
Timestamp:
Feb 15, 2023 3:11:09 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155878
Message:

ValKit/tdAddBasic1.py: There is no reg.exe on NT4, so setting env vars and enabling setupapi.dev.log always fails. Cleanups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py

    r98103 r98592  
    340340        """ Sets a system-wide environment variable on the guest. Only supports Windows guests so far. """
    341341        _ = oSession;
    342         if oTestVm.isWindows():
     342        if oTestVm.sKind not in ('WindowsNT4',):
    343343            sPathRegExe   = oTestVm.pathJoin(self.getGuestSystemDir(oTestVm), 'reg.exe');
    344344            self.txsRunTest(oTxsSession, ('Set env var \"%s\"' % (sName,)),
     
    365365        if oTestVm.sKind not in ('WindowsNT4', 'Windows2000', 'WindowsXP', 'Windows2003'):
    366366            fRc = self.txsRunTest(oTxsSession, 'VBoxCertUtil.exe', 1 * 60 * 1000,
    367                                    '${CDROM}/%s/cert/VBoxCertUtil.exe' % self.sGstPathGaPrefix,
    368                                   ('${CDROM}/%s/cert/VBoxCertUtil.exe' % self.sGstPathGaPrefix, 'add-trusted-publisher',
    369                                    '${CDROM}/%s/cert/vbox-sha1.cer'    % self.sGstPathGaPrefix),
     367                                  '${CDROM}/%s/cert/VBoxCertUtil.exe' % (self.sGstPathGaPrefix,),
     368                                  ('${CDROM}/%s/cert/VBoxCertUtil.exe' % (self.sGstPathGaPrefix,),
     369                                   'add-trusted-publisher',
     370                                   '${CDROM}/%s/cert/vbox-sha1.cer'    % (self.sGstPathGaPrefix,)),
    370371                                  fCheckSessionStatus = True);
    371372            if not fRc:
     
    373374            else:
    374375                fRc = self.txsRunTest(oTxsSession, 'VBoxCertUtil.exe', 1 * 60 * 1000,
    375                                        '${CDROM}/%s/cert/VBoxCertUtil.exe' % self.sGstPathGaPrefix,
    376                                       ('${CDROM}/%s/cert/VBoxCertUtil.exe' % self.sGstPathGaPrefix, 'add-trusted-publisher',
    377                                        '${CDROM}/%s/cert/vbox-sha256.cer'  % self.sGstPathGaPrefix), fCheckSessionStatus = True);
     376                                      '${CDROM}/%s/cert/VBoxCertUtil.exe' % (self.sGstPathGaPrefix,),
     377                                      ('${CDROM}/%s/cert/VBoxCertUtil.exe' % (self.sGstPathGaPrefix,),
     378                                       'add-trusted-publisher',
     379                                       '${CDROM}/%s/cert/vbox-sha256.cer'  % (self.sGstPathGaPrefix,)),
     380                                      fCheckSessionStatus = True);
    378381                if not fRc:
    379382                    reporter.error('Error installing SHA256 certificate');
     
    394397        # Apply The SetupAPI logging level so that we also get the (most verbose) setupapi.dev.log file.
    395398        ## @todo !!! HACK ALERT !!! Add the value directly into the testing source image. Later.
    396         sRegExe = oTestVm.pathJoin(self.getGuestSystemDir(oTestVm), 'reg.exe');
    397         fHaveSetupApiDevLog = self.txsRunTest(oTxsSession, 'Enabling setupapi.dev.log', 30 * 1000,
    398                                               sRegExe,
    399                                               (sRegExe, 'add',
    400                                                '"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Setup"',
    401                                                '/v', 'LogLevel', '/t', 'REG_DWORD', '/d', '0xFF'),
    402                                                fCheckSessionStatus = True);
     399        fHaveSetupApiDevLog = False;
     400        if oTestVm.sKind not in ('WindowsNT4',):
     401            sRegExe = oTestVm.pathJoin(self.getGuestSystemDir(oTestVm), 'reg.exe');
     402            fHaveSetupApiDevLog = self.txsRunTest(oTxsSession, 'Enabling setupapi.dev.log', 30 * 1000,
     403                                                  sRegExe,
     404                                                  (sRegExe, 'add',
     405                                                   '"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Setup"',
     406                                                   '/v', 'LogLevel', '/t', 'REG_DWORD', '/d', '0xFF'),
     407                                                   fCheckSessionStatus = True);
    403408
    404409        for sGstFile, _ in aasLogFiles:
     
    407412        # Enable installing the optional auto-logon modules (VBoxGINA/VBoxCredProv).
    408413        # Also tell the installer to produce the appropriate log files.
    409         sExe   = '${CDROM}/%s/VBoxWindowsAdditions.exe' % self.sGstPathGaPrefix;
     414        sExe   = '${CDROM}/%s/VBoxWindowsAdditions.exe' % (self.sGstPathGaPrefix,);
    410415        asArgs = [ sExe, '/S', '/l', '/with_autologon' ];
    411416
     
    413418        # Note: Don't force installing when the Guest Additions installer should do this automatically,
    414419        #       i.e, only force it for Windows Server 2016 and up.
    415         fForceInstallTimeStampCA = False;
    416         if     self.fpApiVer >= 6.1 \
    417            and oTestVm.getNonCanonicalGuestOsType() \
    418            in [ 'Windows2016', 'Windows2019', 'Windows2022', 'Windows11' ]:
    419             fForceInstallTimeStampCA = True;
    420 
    421         # As we don't have a console command line to parse for the Guest Additions installer (only a message box) and
    422         # unknown / unsupported parameters get ignored with silent installs anyway, we safely can add the following parameter(s)
    423         # even if older Guest Addition installers might not support those.
    424         if fForceInstallTimeStampCA:
    425             asArgs.extend([ '/install_timestamp_ca' ]);
     420        # Note! This may mess up testing if GA ISO is from before r152467 when the option was added.
     421        #       Just add a VBox revision check here if we're suddenly keen on testing old stuff.
     422        if (    self.fpApiVer >= 6.1
     423            and oTestVm.getNonCanonicalGuestOsType() in [ 'Windows2016', 'Windows2019', 'Windows2022', 'Windows11' ]):
     424            asArgs.append('/install_timestamp_ca');
    426425
    427426        #
    428427        # Do the actual install.
    429428        #
    430         fRc = self.txsRunTest(oTxsSession, 'VBoxWindowsAdditions.exe', 5 * 60 * 1000,
    431                               sExe, asArgs, fCheckSessionStatus = True);
     429        fRc = self.txsRunTest(oTxsSession, 'VBoxWindowsAdditions.exe', 5 * 60 * 1000, sExe, asArgs, fCheckSessionStatus = True);
    432430
    433431        # Add the Windows Guest Additions installer files to the files we want to download
Note: See TracChangeset for help on using the changeset viewer.

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