VirtualBox

Changeset 84017 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Apr 27, 2020 4:28:19 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137586
Message:

Validation Kit/Additions: Added a bit of code to extract the Linux GA installer's exit code; required for distros which already have VBox kernel modules loaded while installing, as the installer then exits with status 2 instead of 0.

File:
1 edited

Legend:

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

    r83977 r84017  
    337337        return (fRc, oTxsSession);
    338338
     339    def getAdditionsInstallerResult(self, oTxsSession):
     340        """
     341        Extracts the Guest Additions installer exit code from a run before.
     342        Assumes that nothing else has been run on the same TXS session in the meantime.
     343        """
     344        iRc = 0;
     345        (_, sOpcode, abPayload) = oTxsSession.getLastReply();
     346        if sOpcode.startswith('PROC NOK '): # Extract process rc
     347            iRc = abPayload[0]; # ASSUMES 8-bit rc for now.
     348        ## @todo Parse more statuses here.
     349        return iRc;
     350
    339351    def testLinuxInstallAdditions(self, oSession, oTxsSession, oTestVm):
    340352        _ = oSession;
     
    350362        # xterm window spawned.
    351363        fRc = self.txsRunTest(oTxsSession, 'VBoxLinuxAdditions.run', 30 * 60 * 1000,
    352                               '/bin/sh', ('/bin/sh', '${CDROM}/VBoxLinuxAdditions.run', '--nox11'),
    353                               fCheckSessionStatus = True);
     364                              '/bin/sh', ('/bin/sh', '${CDROM}/VBoxLinuxAdditions.run', '--nox11'));
    354365        if not fRc:
    355             reporter.error('Installing Linux Additions failed (isSuccess=%s, iResult=%d, see log file for details)'
    356                             % (oTxsSession.isSuccess(), oTxsSession.getResult()));
     366            iRc = self.getAdditionsInstallerResult(oTxsSession);
     367            # Check for rc == 0 just for completeness.
     368            if iRc == 0 \
     369            or iRc == 2: # Can happen if the GA installer has detected older VBox kernel modules running and needs a reboot.
     370                reporter.log('Guest has old(er) VBox kernel modules still running; requires a reboot');
     371                fRc = True;
     372
     373            if not fRc:
     374                reporter.error('Installing Linux Additions failed (isSuccess=%s, lastReply=%s, see log file for details)'
     375                               % (oTxsSession.isSuccess(), oTxsSession.getLastReply()));
    357376
    358377        #
     
    368387            reporter.testStart('Rebooting guest w/ updated Guest Additions active');
    369388            (fRc, oTxsSession) = self.txsRebootAndReconnectViaTcp(oSession, oTxsSession, 15 * 60 * 1000,
    370                                                                     sFileCdWait = self.sFileCdWait);
     389                                                                  sFileCdWait = self.sFileCdWait);
    371390            if fRc:
    372391                pass
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