Index: trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
===================================================================
--- trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 99279)
+++ trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 99282)
@@ -2289,4 +2289,25 @@
         return fRc;
 
+    def processCreateWrapper(self, oGuestSession, sCmd, asArgs, sCwd, aEnv, afFlags, timeoutMS):
+        """
+        Wrapepr function to deal with different flavors of the IGuestProcess::processCreate call,
+        depending on the API version.
+
+        Returns oProcess object on success, None on failure.
+        """
+        oProcess = None;
+
+        reporter.log2('Executing sCmd=%s, cCwd=%s, afFlags=%s, timeoutMS=%d, asArgs=%s, asEnv=%s'
+                      % (sCmd, sCwd, afFlags, timeoutMS, limitString(asArgs), limitString(aEnv),));
+
+        if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
+            # 7.1 adds a current working directory parameter.
+            oProcess = oGuestSession.processCreate(sCmd, asArgs, sCwd, aEnv, afFlags, timeoutMS);
+        else:
+            oProcess = oGuestSession.processCreate(sCmd,
+                                                   asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
+                                                   aEnv, afFlags, timeoutMS);
+        return oProcess;
+
     def gctrlExecute(self, oTest, oGuestSession, fIsError):                     # pylint: disable=too-many-statements
         """
@@ -2316,17 +2337,8 @@
         # Start the process:
         #
-        reporter.log2('Executing sCmd=%s, cCwd=%s, afFlags=%s, timeoutMS=%d, asArgs=%s, asEnv=%s'
-                      % (oTest.sCmd, oTest.sCwd, oTest.afFlags, oTest.timeoutMS, limitString(oTest.asArgs),
-                         limitString(oTest.aEnv),));
+
         try:
-            if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
-                oProcess = oGuestSession.processCreate(oTest.sCmd,
-                                                       oTest.asArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.asArgs[1:],
-                                                       oTest.sCwd,
-                                                       oTest.aEnv, oTest.afFlags, oTest.timeoutMS);
-            else:
-                oProcess = oGuestSession.processCreate(oTest.sCmd,
-                                                       oTest.asArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.asArgs[1:],
-                                                       oTest.aEnv, oTest.afFlags, oTest.timeoutMS);
+            oProcess = self.processCreateWrapper(oGuestSession, oTest.sCmd, oTest.asArgs, oTest.sCwd,
+                                                 oTest.aEnv, oTest.afFlags, oTest.timeoutMS);
         except:
             reporter.maybeErrXcpt(fIsError, 'type=%s, asArgs=%s' % (type(oTest.asArgs), oTest.asArgs,));
@@ -2889,14 +2901,7 @@
             try:
                 reporter.log2('Starting stale process #%d...' % (i));
-                if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
-                    oGuestSession.processCreate(sShell,
-                                                asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
-                                                "", # Working directory.
-                                                [], # Environment changes.
-                                                [ vboxcon.ProcessCreateFlag_WaitForStdOut ], 30 * 1000);
-                else:
-                    oGuestSession.processCreate(sShell,
-                                                asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], [],
-                                                [ vboxcon.ProcessCreateFlag_WaitForStdOut ], 30 * 1000);
+                self.processCreateWrapper(oGuestSession, sShell, asArgs, "", # Working directory.
+                                          [], # Environment changes.
+                                          [ vboxcon.ProcessCreateFlag_WaitForStdOut ], 30 * 1000);
                 # Note: Not keeping a process reference from the created process above is intentional and part of the test!
 
@@ -2930,11 +2935,7 @@
                 try:
                     reporter.log2('Starting non-stale process #%d...' % (i));
-                    if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
-                        oCurProc = oGuestSession.processCreate(sShell, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
-                                                               "",         # Working directory.
-                                                               [], [], 0); # Infinite timeout.
-                    else:
-                        oCurProc = oGuestSession.processCreate(sShell, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
-                                                               [], [], 0); # Infinite timeout.
+                    oCurProc = self.processCreateWrapper(oGuestSession, sShell, asArgs,
+                                                         "",         # Working directory.
+                                                         [], [], 0); # Infinite timeout.
                     aoProcs.append(oCurProc);
                 except:
@@ -2988,11 +2989,8 @@
                 try:
                     reporter.log2('Starting blocking process #%d...' % (i));
-                    if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
-                        oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
-                                                               "", # Working directory.
-                                                               [],  [], 30 * 1000);
-                    else:
-                        oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
-                                                               [],  [], 30 * 1000);
+                    oCurProc = self.processCreateWrapper(oGuestSession, sCmd, asArgs,
+                                                         "", # Working directory.
+                                                         [],  [], 30 * 1000);
+
                     # Note: Use a timeout in the call above for not letting the stale processes
                     #       hanging around forever.  This can happen if the installed Guest Additions
@@ -3424,14 +3422,7 @@
         afFlags = [];
         try:
-            if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
-                oGuestProcess = oGuestSession.processCreate(sImage,
-                                                            asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
-                                                            "", # Working directory.
-                                                            aEnv, afFlags,
-                                                            30 * 1000);
-            else:
-                oGuestProcess = oGuestSession.processCreate(sImage,
-                                                            asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], aEnv, afFlags,
-                                                            30 * 1000);
+            oGuestProcess = self.processCreateWrapper(oGuestSession, sImage, asArgs,
+                                                      "", # Working directory.
+                                                      aEnv, afFlags, 30 * 1000);
         except:
             fRc = reporter.error('Failed to start shell process (%s)' % (sImage,));
@@ -3547,11 +3538,7 @@
         fRc = True;
         try:
-            if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
-                oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
-                                                          "", # Working directory.
-                                                          [], [], 30 * 1000);
-            else:
-                oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
-                                                          [], [], 30 * 1000);
+            oCurProcess = self.processCreateWrapper(oGuestSession, sShell, [ sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
+                                                    "", # Working directory.
+                                                    [], [], 30 * 1000);
         except:
             fRc = reporter.errorXcpt();
@@ -3590,11 +3577,7 @@
             #
             try:
-                if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
-                    oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
-                                                              "", # Working directory.
-                                                              [], [], 3 * 1000);
-                else:
-                    oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
-                                                              [], [], 3 * 1000);
+                oCurProcess = self.processCreateWrapper(oGuestSession, sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
+                                                        "", # Working directory.
+                                                        [], [], 3 * 1000);
             except:
                 fRc = reporter.errorXcpt();
@@ -5589,7 +5572,7 @@
 
         for _ in xrange(100):
-            oProc = oGuestSession.processCreate(sCmd, asArgs if self.fpApiVer >= 5.0 else asArgs[1:],
-                                                "", # Working directory.
-                                                aEnv, afFlags, 30 * 1000);
+            oProc = self.processCreateWrapper(oGuestSession, sCmd, asArgs if self.fpApiVer >= 5.0 else asArgs[1:],
+                                              "", # Working directory.
+                                              aEnv, afFlags, 30 * 1000);
 
             aWaitFor = [ vboxcon.ProcessWaitForFlag_Terminate ];
