VirtualBox

Changeset 93663 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 8, 2022 6:17:06 PM (3 years ago)
Author:
vboxsync
Message:

Validation Kit/Guest Control: Log status changes (as error) when waiting to start for a guest session (most certainly a bug, needs investigation).

File:
1 edited

Legend:

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

    r93169 r93663  
    179179                return (False, None);
    180180
    181             reporter.log('Waiting for session "%s" to start within %dms...' % (sName, self.timeoutMS));
    182             aeWaitFor = [ vboxcon.GuestSessionWaitForFlag_Start, ];
    183             try:
    184                 waitResult = self.oGuestSession.waitForArray(aeWaitFor, self.timeoutMS);
    185 
    186                 #
    187                 # Be nice to Guest Additions < 4.3: They don't support session handling and
    188                 # therefore return WaitFlagNotSupported.
    189                 #
    190                 if waitResult not in (vboxcon.GuestSessionWaitResult_Start, vboxcon.GuestSessionWaitResult_WaitFlagNotSupported):
     181            tsStartMs = base.timestampMilli();
     182            while base.timestampMilli() - tsStartMs < self.timeoutMS:
     183                reporter.log('Waiting for session "%s" to start within %dms...' % (sName, self.timeoutMS));
     184                aeWaitFor = [ vboxcon.GuestSessionWaitForFlag_Start, ];
     185                try:
     186                    waitResult = self.oGuestSession.waitForArray(aeWaitFor, self.timeoutMS);
     187
     188                    # Log session status changes.
     189                    if waitResult is vboxcon.GuestSessionWaitResult_Status:
     190                        reporter.error('Session "%s" indicated status change (status is now %d)' \
     191                                     % (sName, self.oGuestSession.status));
     192                        if self.oGuestSession.status is vboxcon.GuestSessionStatus_Started:
     193                            reporter.error('Session "%s" successfully started (thru status change)' % (sName,));
     194                            break;
     195                        continue; # Continue waiting for the session to start.
     196
     197                    #
     198                    # Be nice to Guest Additions < 4.3: They don't support session handling and
     199                    # therefore return WaitFlagNotSupported.
     200                    #
     201                    if waitResult not in (vboxcon.GuestSessionWaitResult_Start, vboxcon.GuestSessionWaitResult_WaitFlagNotSupported):
     202                        # Just log, don't assume an error here (will be done in the main loop then).
     203                        reporter.maybeErr(fIsError, 'Session did not start successfully, returned wait result: %d' % (waitResult,));
     204                        return (False, None);
     205                    reporter.log('Session "%s" successfully started' % (sName,));
     206                except:
    191207                    # Just log, don't assume an error here (will be done in the main loop then).
    192                     reporter.maybeErr(fIsError, 'Session did not start successfully, returned wait result: %d' % (waitResult,));
     208                    reporter.maybeErrXcpt(fIsError, 'Waiting for guest session "%s" (usr=%s;pw=%s;dom=%s) to start failed:'
     209                                          % (sName, self.oCreds.sUser, self.oCreds.sPassword, self.oCreds.sDomain,));
    193210                    return (False, None);
    194                 reporter.log('Session "%s" successfully started' % (sName,));
    195             except:
    196                 # Just log, don't assume an error here (will be done in the main loop then).
    197                 reporter.maybeErrXcpt(fIsError, 'Waiting for guest session "%s" (usr=%s;pw=%s;dom=%s) to start failed:'
    198                                       % (sName, self.oCreds.sUser, self.oCreds.sPassword, self.oCreds.sDomain,));
    199                 return (False, None);
    200211        else:
    201212            reporter.log('Warning: Session already set; this is probably not what you want');
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