VirtualBox

Changeset 65116 in vbox


Ignore:
Timestamp:
Jan 4, 2017 3:58:27 PM (8 years ago)
Author:
vboxsync
Message:

testdriver/vboxinstaller.py: repeat drvinst killing 4 times since MSI doesn't seem to mind us killing it. Also kill it's child processes, like the rundll32 popup dialog process.

File:
1 edited

Legend:

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

    r65115 r65116  
    782782        return False;
    783783
    784     def _killProcessesByName(self, sName, sDesc):
     784    def _killProcessesByName(self, sName, sDesc, fChildren = False):
    785785        """ Checks whether the named process is present or not. """
    786786        cKilled = 0;
    787         for oProcess in utils.processListAll():
     787        aoProcesses = utils.processListAll();
     788        for oProcess in aoProcesses:
    788789            sBase = oProcess.getBaseImageNameNoExeSuff();
    789790            if sBase is not None and sBase.lower() == sName:
     
    791792                utils.processKill(oProcess.iPid);
    792793                cKilled += 1;
     794
     795                if fChildren:
     796                    for oChild in aoProcesses:
     797                        if oChild.iParentPid == oProcess.iPid and oChild.iParentPid is not None:
     798                            reporter.log('Killing %s child process: %s (%s)' % (sDesc, oChild.iPid, sBase));
     799                            utils.processKill(oChild.iPid);
     800                            cKilled += 1;
    793801        return cKilled;
    794802
     
    818826        # Before we start uninstalling anything, just ruthlessly kill any
    819827        # msiexec and drvinst process we might find hanging around.
    820         cKilled = 0;
    821828        if self._isProcessPresent('drvinst'):
    822829            time.sleep(15);     # In the hope that it goes away.
    823             cKilled = self._killProcessesByName('drvinst', 'MSI driver installation');
    824             if cKilled > 0:
    825                 time.sleep(15); # Give related MSI process a chance to clean up after we killed the driver installer.
     830            cTimes = 0;
     831            while cTimes < 4:
     832                cTimes += 1;
     833                cKilled = self._killProcessesByName('drvinst', 'MSI driver installation', True);
     834                if cKilled <= 0:
     835                    break;
     836                time.sleep(10); # Give related MSI process a chance to clean up after we killed the driver installer.
    826837
    827838        if self._isProcessPresent('msiexec'):
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