VirtualBox

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


Ignore:
Timestamp:
Nov 4, 2024 7:40:36 PM (2 months ago)
Author:
vboxsync
Message:

Validation Kit/vboxinstaller: Try adding the setupapi logs to the report if something has failed during (un)installation. bugref:10762

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py

    r106061 r106823  
    905905    kasWindowsServices = [ 'vboxsup', 'vboxusbmon', 'vboxnetadp', 'vboxnetflt', 'vboxnetlwf' ];
    906906
     907    ## Windows SetupAPI log files we handle.
     908    kasSetupApiLogFiles = [
     909        ( '%WINDIR%/setupapi.log', 'log/host-setupapi.log', 'SetupAPI (setupapi.log)', ),
     910        ( '%WINDIR%/setupact.log', 'log/host-setupact.log', 'SetupAPI (setupact.log)', ),
     911        ( '%WINDIR%/setuperr.log', 'log/host-setuperr.log', 'SetupAPI (setuperr.log)', ),
     912    ];
     913
     914    def _winPurgeSetupApiLogs(self):
     915        """
     916        Tries deleting the Setup API host logs.
     917        """
     918        for sFile, _ in self.kasSetupApiLogFiles:
     919            sFile = os.path.expandvars(sFile);
     920            try:
     921                os.remove(sFile);
     922            except:
     923                pass;
     924
     925    def _winAddSetupApiLogs(self, sDescPrefix = None):
     926        """
     927        Adds all defined (and existing) SetupAPI host logs to the report.
     928
     929        The sDescPrefix is an optional prefix for the file naming.
     930        """
     931        if sDescPrefix:
     932            sDescPrefix = sDescPrefix + ": ";
     933        else:
     934            sDescPrefix = '';
     935
     936        for sFile, sKind, sDesc in self.kasSetupApiLogFiles:
     937            sFile = os.path.expandvars(sFile);
     938            if os.path.isfile(sFile):
     939                reporter.addLogFile(sFile, sKind, sDescPrefix + sDesc);
     940
    907941    def _installVBoxOnWindows(self):
    908942        """ Installs VBox on Windows."""
     
    952986                return False;
    953987
     988        # Try removing old setupapi logs to get a fresh start before installing our stuff.
     989        self._winPurgeSetupApiLogs();
     990
    954991        # We need the help text to detect supported options below.
    955992        reporter.log('Executing: %s' % ([sExe, '--silent', '--help'], ));
     
    9871024            reporter.addLogFile(sLogFile, 'log/installer', "Verbose MSI installation log file");
    9881025        self._waitForTestManagerConnectivity(30);
     1026
     1027        # Add setupapi logs if something failed, to give some more clues about driver installation.
     1028        if fRc is False:
     1029            self._winAddSetupApiLogs('Installation');
    9891030
    9901031        return fRc;
     
    11041145                time.sleep(2); # fudge.
    11051146
     1147        # Try removing old setupapi logs to get a fresh start before uninstalling our stuff.
     1148        self._winPurgeSetupApiLogs();
     1149
    11061150        # Do the uninstalling.
    11071151        fRc = True;
     
    11231167        if fRc is False and os.path.isfile(sLogFile):
    11241168            reporter.addLogFile(sLogFile, 'log/uninstaller', "Verbose MSI uninstallation log file");
     1169            self._winAddSetupApiLogs('Uninstallation');
    11251170            sLogFile = None;
    11261171
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