Index: trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
===================================================================
--- trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 79327)
+++ trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 79328)
@@ -64,4 +64,6 @@
     """
     Class for handling a guest process input/output stream.
+
+    @todo write stdout/stderr tests.
     """
     def appendStream(self, stream, convertTo = '<b'):
@@ -72,17 +74,4 @@
         self.extend(struct.pack(convertTo, stream));
 
-class tdCtxTest(object):
-    """
-    Provides the actual test environment.
-    Should be kept as generic as possible.
-    """
-    def __init__(self, oSession, oTxsSession, oTestVm): # pylint: disable=unused-argument
-        ## The desired Main API result.
-        self.fRc = False;
-        ## IGuest reference.
-        self.oGuest      = oSession.o.console.guest; ## @todo may throw shit
-        self.oSession    = oSession;
-        self.oTxsSession = oTxsSession;
-        self.oTestVm     = oTestVm;
 
 class tdCtxCreds(object):
@@ -121,9 +110,8 @@
     """
     def __init__(self):
-        self.oTest  = None;
-        self.oCreds = None;
-        self.timeoutMS = 30 * 1000; # 30s timeout
-        ## IGuestSession reference or None.
-        self.oGuestSession = None;
+        self.oGuest    = None;      ##< IGuest.
+        self.oCreds    = None       ##< type: tdCtxCreds
+        self.timeoutMS = 30 * 1000; ##< 30s timeout
+        self.oGuestSession = None;  ##< IGuestSession reference or None.
 
     def setEnvironment(self, oSession, oTxsSession, oTestVm):
@@ -131,9 +119,16 @@
         Sets the test environment required for this test.
         """
-        self.oTest = tdCtxTest(oSession, oTxsSession, oTestVm);
+        _ = oTxsSession;
+
+        try:
+            self.oGuest = oSession.o.console.guest;
+        except:
+            reporter.errorXcpt();
+
         if self.oCreds is None:
             self.oCreds = tdCtxCreds();
         self.oCreds.applyDefaultsIfNotSet(oTestVm);
-        return self.oTest;
+
+        return True;
 
     def uploadLogData(self, oTstDrv, aData, sFileName, sDesc):
@@ -162,8 +157,8 @@
             reporter.log('Creating session "%s" ...' % (sName,));
             try:
-                self.oGuestSession = self.oTest.oGuest.createSession(self.oCreds.sUser,
-                                                                     self.oCreds.sPassword,
-                                                                     self.oCreds.sDomain,
-                                                                     sName);
+                self.oGuestSession = self.oGuest.createSession(self.oCreds.sUser,
+                                                               self.oCreds.sPassword,
+                                                               self.oCreds.sDomain,
+                                                               sName);
             except:
                 # Just log, don't assume an error here (will be done in the main loop then).
@@ -832,8 +827,8 @@
         opened guest sessions of a VM.
         """
-        if self.oTest.oGuest is None:
+        if self.oGuest is None:
             return 0;
         try:
-            aoSession = oVBoxMgr.getArray(self.oTest.oGuest, 'sessions')
+            aoSession = oVBoxMgr.getArray(self.oGuest, 'sessions')
         except:
             reporter.errorXcpt('sSessionName: %s' % (self.sSessionName,));
@@ -2366,5 +2361,5 @@
             # Try check that none of the remaining sessions got closed.
             try:
-                aoGuestSessions = self.oTstDrv.oVBoxMgr.getArray(atTests[0][0].oTest.oGuest, 'sessions');
+                aoGuestSessions = self.oTstDrv.oVBoxMgr.getArray(atTests[0][0].oGuest, 'sessions');
             except:
                 return (reporter.errorXcpt('i=%d/%d' % (i, cMaxGuestSessions,)), oTxsSession);
@@ -4801,5 +4796,5 @@
                 break;
             try:
-                oCurProgress = oCurTest.oTest.oGuest.updateGuestAdditions(oCurTest.sSrc, oCurTest.asArgs, oCurTest.fFlags);
+                oCurProgress = oCurTest.oGuest.updateGuestAdditions(oCurTest.sSrc, oCurTest.asArgs, oCurTest.fFlags);
                 if oCurProgress is not None:
                     oProgress = vboxwrappers.ProgressWrapper(oCurProgress, self.oTstDrv.oVBoxMgr, self.oTstDrv, "gctrlUpGA");
