VirtualBox

Changeset 85377 in vbox


Ignore:
Timestamp:
Jul 17, 2020 5:28:24 PM (5 years ago)
Author:
vboxsync
Message:

Main: bugref:9341: Added additional waiting the GA readiness after VM reboot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py

    r84758 r85377  
    214214
    215215        return sVBoxCfg;
     216
     217    def _waitAdditionsIsRunning(self, oGuest):
     218        """
     219        Check is the additions running
     220        """
     221        cAttempt = 0;
     222        fRc = False;
     223        while cAttempt < 30:
     224            fRc = oGuest.additionsRunLevel in [vboxcon.AdditionsRunLevelType_Userland,
     225                                               vboxcon.AdditionsRunLevelType_Desktop];
     226            if fRc:
     227                eServiceStatus, _ = oGuest.getFacilityStatus(vboxcon.AdditionsFacilityType_VBoxService);
     228                fRc = eServiceStatus == vboxcon.AdditionsFacilityStatus_Active;
     229                if fRc:
     230                    break;
     231
     232            self.oTestDriver.sleep(10);
     233            cAttempt += 1;
     234        return fRc;
    216235
    217236    def createSession(self, oSession, sName, sUser, sPassword, cMsTimeout = 10 * 1000, fIsError = True):
     
    545564        # To do it, one will try to open the guest session and start the guest process in loop
    546565
     566        if not self._waitAdditionsIsRunning(oSession.o.console.guest):
     567            return (False, None);
     568
    547569        cAttempt = 0;
    548570        oGuestSession = None;
     
    850872        """
    851873
     874        self.oTestDriver.sleep(30);
     875
    852876        _ = oSession;
    853877
     
    912936        # Waiting the VM is ready.
    913937        # To do it, one will try to open the guest session and start the guest process in loop
     938
     939        if not self._waitAdditionsIsRunning(oSession.o.console.guest):
     940            return (False, None);
    914941
    915942        cAttempt = 0;
     
    11711198        """
    11721199
     1200        self.oTestDriver.sleep(30);
     1201
    11731202        _ = oGuestSession;
    11741203
     
    11811210        else:
    11821211
    1183             #---- report tasklist for debug purpose -----
    1184             (fRc, _, _, aBuf) = self.guestProcessExecute(oGuestSession, 'Check for running VM',
    1185                                                        60 * 1000, 'C:\\Windows\\System32\\tasklist.exe',
    1186                                                        ['C:\\Windows\\System32\\tasklist.exe', '/m',
    1187                                                         'vboxheadless*', '/nh'], True, True);
    1188             try:
    1189                 sTaskList = str(aBuf);
    1190                 reporter.log("Guest tasks for user %s: %s" % (sUser, sTaskList));
    1191             except:
    1192                 pass;
    1193             #---- end report tasklist for debug purpose -----
    11941212
    11951213            (fRc, _, _, aBuf) = self.guestProcessExecute(oGuestSession, 'Check for running VM',
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