Index: /trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py	(revision 84184)
+++ /trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py	(revision 84185)
@@ -81,5 +81,5 @@
         reporter.log('onAdditionsStateChange');
         self.oTstDrv.fGAStatusCallbackFired = True;
-        self.oTstDrv.iGAStatusCallbackRunlevel = self.oGuest.additionsRunLevel;
+        self.oTstDrv.eGAStatusCallbackRunlevel = self.oGuest.additionsRunLevel;
         self.oVBoxMgr.interruptWaitEvents();
         return None;
@@ -106,5 +106,5 @@
 
         self.fGAStatusCallbackFired    = False;
-        self.iGAStatusCallbackRunlevel = 0;
+        self.eGAStatusCallbackRunlevel = 0;
 
     #
@@ -249,9 +249,11 @@
         """
         # No need to wait as we already reached the run level?
-        if eRunLevel == oGuest.additionsRunLevel:
+        eRunLevelCur = oGuest.additionsRunLevel;
+        if eRunLevelCur == eRunLevel:
             reporter.log('Already reached run level %s' % eRunLevel);
             return True;
 
-        reporter.log('Waiting for Guest Additions to reach run level %s ...' % eRunLevel);
+        reporter.log('Waiting for Guest Additions to reach run level %s with %dms (current: %s) ...' %
+                     (eRunLevel, cMsTimeout, eRunLevelCur));
 
         oConsoleCallbacks = oSession.registerDerivedEventHandler(tdAddBasicConsoleCallbacks, \
@@ -266,11 +268,12 @@
                     break;
                 if self.fGAStatusCallbackFired:
-                    reporter.log('Reached new run level %s' % eRunLevel);
-                    if eRunLevel == self.iGAStatusCallbackRunlevel:
+                    reporter.log('Reached new run level %s after %dms' %
+                                 (self.eGAStatusCallbackRunlevel, base.timestampMilli() - tsStart));
+                    if eRunLevel == self.eGAStatusCallbackRunlevel:
                         fRc = True;
                         break;
                     self.fGAStatusCallbackFired = False;
             if fRc:
-                reporter.log('Guest Additions run level reached after %dms' % (base.timestampMilli() - tsStart));
+                reporter.log('Final Guest Additions run level reached after %dms' % (base.timestampMilli() - tsStart));
             else:
                 reporter.error('Guest Additions run level not reached');
@@ -278,4 +281,6 @@
             # cleanup.
             oConsoleCallbacks.unregister();
+        else:
+            reporter.error('Registering derived event handler failed');
 
         if not fRc:
@@ -295,4 +300,5 @@
                            (oTestVm.sKind, oTestVm.sVmName,));
             fRc = False;
+        fRc = True;
 
         #
@@ -308,19 +314,18 @@
                 return (False, oTxsSession);
 
+            # Wait for the GAs to come up.
+            reporter.testStart('IGuest::additionsRunLevel');
+            fRc = self.testIGuest_additionsRunLevel(oSession, oTestVm, oGuest);
+            reporter.testDone();
+
             # Check the additionsVersion attribute. It must not be empty.
             reporter.testStart('IGuest::additionsVersion');
             fRc = self.testIGuest_additionsVersion(oGuest);
             reporter.testDone();
-            if not fRc:
-                return (False, oTxsSession);
-
-            # Wait for the GAs to come up.
-            reporter.testStart('IGuest::additionsRunLevel');
-            fRc = self.testIGuest_additionsRunLevel(oSession, oTestVm, oGuest);
+
+            # Check Guest Additions facilities
+            reporter.testStart('IGuest::getFacilityStatus');
+            fRc = self.testIGuest_getFacilityStatus(oTestVm, oGuest);
             reporter.testDone();
-            if not fRc:
-                return (False, oTxsSession);
-
-            ## @todo test IAdditionsFacilities.
 
         return (fRc, oTxsSession);
@@ -471,4 +476,19 @@
         return (fRc, oTxsSession);
 
+    def testIGuest_additionsRunLevel(self, oSession, oTestVm, oGuest):
+        """
+        Do run level tests.
+        """
+        if oTestVm.isWindows():
+            if oTestVm.isLoggedOntoDesktop():
+                eExpectedRunLevel = vboxcon.AdditionsRunLevelType_Desktop;
+            else:
+                eExpectedRunLevel = vboxcon.AdditionsRunLevelType_Userland;
+        else:
+            ## @todo VBoxClient does not have facility statuses implemented yet.
+            eExpectedRunLevel = vboxcon.AdditionsRunLevelType_Userland;
+
+        return self.waitForGuestAdditionsRunLevel(oSession, oGuest, 60 * 1000, eExpectedRunLevel);
+
     def testIGuest_additionsVersion(self, oGuest):
         """
@@ -498,14 +518,76 @@
         return True;
 
-    def testIGuest_additionsRunLevel(self, oSession, oTestVm, oGuest):
-        """
-        Do run level tests.
-        """
-        if oTestVm.isLoggedOntoDesktop():
-            eExpectedRunLevel = vboxcon.AdditionsRunLevelType_Desktop;
+    def checkFacilityStatus(self, oGuest, eFacilityType, sDesc, fMustSucceed = True):
+        """
+        Prints the current status of a Guest Additions facility.
+
+        Return success status.
+        """
+
+        fRc = True;
+
+        try:
+            eStatus, _ = oGuest.getFacilityStatus(eFacilityType);
+            reporter.log3('%s -> %s' % (sDesc, eStatus,));
+        except:
+            if fMustSucceed:
+                reporter.errorXcpt('Getting facility status for %s failed' % (eFacilityType,));
+                fRc = False;
         else:
-            eExpectedRunLevel = vboxcon.AdditionsRunLevelType_Userland;
-
-        return self.waitForGuestAdditionsRunLevel(oSession, oGuest, 5 * 60 * 1000, eExpectedRunLevel);
+            if eStatus == vboxcon.AdditionsFacilityStatus_Inactive:
+                sStatus = "INACTIVE";
+            elif eStatus == vboxcon.AdditionsFacilityStatus_Paused:
+                sStatus = "PAUSED";
+            elif eStatus == vboxcon.AdditionsFacilityStatus_PreInit:
+                sStatus = "PREINIT";
+            elif eStatus == vboxcon.AdditionsFacilityStatus_Init:
+                sStatus = "INIT";
+            elif eStatus == vboxcon.AdditionsFacilityStatus_Active:
+                sStatus = "ACTIVE";
+            elif eStatus == vboxcon.AdditionsFacilityStatus_Terminating:
+                sStatus = "TERMINATING";
+                fRc = not fMustSucceed;
+            elif eStatus == vboxcon.AdditionsFacilityStatus_Terminated:
+                sStatus = "TERMINATED";
+                fRc = not fMustSucceed;
+            elif eStatus == vboxcon.AdditionsFacilityStatus_Failed:
+                sStatus = "FAILED";
+                fRc = not fMustSucceed;
+            else:
+                sStatus = "UNKNOWN";
+                fRc = not fMustSucceed;
+
+        reporter.log('Guest Additions facility "%s": %s' % (sDesc, sStatus));
+        if      fMustSucceed \
+        and not fRc:
+            reporter.error('Guest Additions facility "%s" did not report expected status (is "%s")' % (sDesc, sStatus));
+
+        return fRc;
+
+    def testIGuest_getFacilityStatus(self, oTestVm, oGuest):
+        """
+        Checks Guest Additions facilities for their status.
+
+        Returns success status.
+        """
+
+        reporter.testStart('Status VBoxGuest Driver');
+        fRc = self.checkFacilityStatus(oGuest, vboxcon.AdditionsFacilityType_VBoxGuestDriver, "VBoxGuest Driver");
+        reporter.testDone();
+
+        reporter.testStart('Status VBoxService');
+        fRc = self.checkFacilityStatus(oGuest, vboxcon.AdditionsFacilityType_VBoxService,     "VBoxService") and fRc;
+        reporter.testDone();
+
+        if oTestVm.isWindows():
+            if oTestVm.isLoggedOntoDesktop():
+                ## @todo VBoxClient does not have facility statuses implemented yet.
+                reporter.testStart('Status VBoxTray / VBoxClient');
+                fRc = self.checkFacilityStatus(oGuest, vboxcon.AdditionsFacilityType_VBoxTrayClient,
+                                               "VBoxTray / VBoxClient") and fRc;
+                reporter.testDone();
+        ## @todo Add more.
+
+        return fRc;
 
     def testGuestProperties(self, oSession, oTxsSession, oTestVm):
