Index: /trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py	(revision 95020)
+++ /trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py	(revision 95021)
@@ -594,4 +594,8 @@
 
     def actionExecute(self):
+        # Make sure vboxapi has been imported so we can execute the driver without going thru
+        # a former configuring step.
+        if not self.importVBoxApi():
+            return False;
         if not self._detectPaths():
             return False;
@@ -634,6 +638,6 @@
             self.sExeSuff = '.exe' if utils.getHostOs() in [ 'win', 'dos', 'os2' ] else '';
 
-        self._testRunUnitTestsSet(r'^tst*', 'testcase');
-        self._testRunUnitTestsSet(r'^tst*', '.');
+        self._testRunUnitTestsSet(oTestVm, r'^tst*', 'testcase');
+        self._testRunUnitTestsSet(oTestVm, r'^tst*', '.');
 
         fRc = self.cFailed == 0;
@@ -806,5 +810,5 @@
         or self.oTxsSession is None:
             return;
-        sStringExp = self.txsExpandString(self.oSession, self.oTxsSession, sString);
+        sStringExp = self.oTxsSession.syncExpandString(sString);
         if not sStringExp:
             return;
@@ -821,7 +825,7 @@
         if self.sMode.startswith('remote'):
             self._logExpandString(sPath);
-            fRc = self.txsIsDir(self.oSession, self.oTxsSession, sPath, fIgnoreErrors = True);
+            fRc = self.oTxsSession.syncIsDir(sPath, fIgnoreErrors = True);
             if not fRc:
-                fRc = self.txsIsFile(self.oSession, self.oTxsSession, sPath, fIgnoreErrors = True);
+                fRc = self.oTxsSession.syncIsFile(sPath, fIgnoreErrors = True);
         else:
             fRc = os.path.exists(sPath);
@@ -837,5 +841,5 @@
         fRc = True;
         if self.sMode.startswith('remote'):
-            fRc = self.txsMkDirPath(self.oSession, self.oTxsSession, sPath, fMode = 0o755);
+            fRc = self.oTxsSession.syncMkDirPath(sPath, fMode = 0o755);
         else:
             if utils.getHostOs() in [ 'win', 'os2' ]:
@@ -843,7 +847,7 @@
             else:
                 fRc = self._sudoExecuteSync(['/bin/mkdir', '-p', '-m', '0755', sPath]);
-        if fRc is not True:
-            raise Exception('Failed to create dir "%s".' % (sPath,));
-        return True;
+        if not fRc:
+            reporter.log('Failed to create dir "%s".' % (sPath,));
+        return fRc;
 
     def _wrapCopyFile(self, sSrc, sDst, iMode):
@@ -859,9 +863,9 @@
             self._logExpandString(sDst);
             if self.sMode == 'remote-exec':
-                self.txsCopyFile(self.oSession, self.oTxsSession, sSrc, sDst, iMode);
+                self.oTxsSession.syncCopyFile(sSrc, sDst, iMode);
             else:
-                fRc = self.txsUploadFile(self.oSession, self.oTxsSession, sSrc, sDst);
+                fRc = self.oTxsSession.syncUploadFile(sSrc, sDst);
                 if fRc:
-                    self.oTxsSession.syncChMod(sDst, iMode);
+                    fRc = self.oTxsSession.syncChMod(sDst, iMode);
         else:
             if utils.getHostOs() in [ 'win', 'os2' ]:
@@ -874,7 +878,7 @@
                     if fRc is not True:
                         raise Exception('Failed to chmod "%s".' % (sDst,));
-        if fRc is not True:
-            raise Exception('Failed to copy "%s" to "%s".' % (sSrc, sDst,));
-        return True;
+        if not fRc:
+            reporter.log('Failed to copy "%s" to "%s".' % (sSrc, sDst,));
+        return fRc;
 
     def _wrapDeleteFile(self, sPath):
@@ -887,6 +891,6 @@
         fRc = True;
         if self.sMode.startswith('remote'):
-            if self.txsIsFile(self.oSession, self.oTxsSession, sPath):
-                fRc = self.txsRmFile(self.oSession, self.oTxsSession, sPath);
+            if self.oTxsSession.syncIsFile(sPath):
+                fRc = self.oTxsSession.syncRmFile(sPath, fIgnoreErrors = True);
         else:
             if os.path.exists(sPath):
@@ -895,7 +899,7 @@
                 else:
                     fRc = self._sudoExecuteSync(['/bin/rm', sPath]);
-        if fRc is not True:
-            raise Exception('Failed to remove "%s".' % (sPath,));
-        return True;
+        if not fRc:
+            reporter.log('Failed to remove "%s".' % (sPath,));
+        return fRc;
 
     def _wrapRemoveDir(self, sPath):
@@ -908,6 +912,6 @@
         fRc = True;
         if self.sMode.startswith('remote'):
-            if self.txsIsDir(self.oSession, self.oTxsSession, sPath):
-                fRc = self.txsRmDir(self.oSession, self.oTxsSession, sPath);
+            if self.oTxsSession.syncIsDir(sPath):
+                fRc = self.oTxsSession.syncRmDir(sPath, fIgnoreErrors = True);
         else:
             if os.path.exists(sPath):
@@ -916,7 +920,7 @@
                 else:
                     fRc = self._sudoExecuteSync(['/bin/rmdir', sPath]);
-        if fRc is not True:
-            raise Exception('Failed to remove "%s".' % (sPath,));
-        return True;
+        if not fRc:
+            reporter.log('Failed to remove "%s".' % (sPath,));
+        return fRc;
 
     def _envSet(self, sName, sValue):
@@ -929,5 +933,5 @@
         return True;
 
-    def _executeTestCase(self, sName, sFullPath, sTestCaseSubDir, oDevNull): # pylint: disable=too-many-locals,too-many-statements
+    def _executeTestCase(self, oTestVm, sName, sFullPath, sTestCaseSubDir, oDevNull): # pylint: disable=too-many-locals,too-many-statements
         """
         Executes a test case.
@@ -975,5 +979,10 @@
 
             sDst = os.path.join(sDstDir, os.path.basename(sFullPath) + self.sExeSuff);
-            self._wrapCopyFile(sSrc, sDst, 0o755);
+            fModeExe  = 0;
+            fModeDeps = 0;
+            if not oTestVm.isWindows(): ## @todo NT4 does not like the chmod. Investigate this!
+                fModeExe  = 0o755;
+                fModeDeps = 0o644;
+            self._wrapCopyFile(sSrc, sDst, fModeExe);
             asFilesToRemove.append(sDst);
 
@@ -986,5 +995,5 @@
                         if self._wrapPathExists(sSrc):
                             sDst = os.path.join(sDstDir, os.path.basename(sSrc));
-                            self._wrapCopyFile(sSrc, sDst, 0o644);
+                            self._wrapCopyFile(sSrc, sDst, fModeDeps);
                             asFilesToRemove.append(sDst);
 
@@ -994,5 +1003,5 @@
                 if os.path.exists(sSrc):
                     sDst = os.path.join(sDstDir, os.path.basename(sSrc));
-                    self._wrapCopyFile(sSrc, sDst, 0o644);
+                    self._wrapCopyFile(sSrc, sDst, fModeDeps);
                     asFilesToRemove.append(sDst);
 
@@ -1004,5 +1013,5 @@
                     if os.path.exists(sSrc):
                         sDst = os.path.join(sDstDir, os.path.basename(sSrc));
-                        self._wrapCopyFile(sSrc, sDst, 0o644);
+                        self._wrapCopyFile(sSrc, sDst, fModeDeps);
                         asFilesToRemove.append(sDst);
 
@@ -1043,6 +1052,6 @@
         if not self.fDryRun:
             if fCopyToRemote:
-                fRc = self.txsRunTest(self.oTxsSession, sName, 30 * 60 * 1000, asArgs[0], asArgs, self.asEnv, \
-                                        fCheckSessionStatus = True);
+                fRc = self.txsRunTest(self.oTxsSession, sName, cMsTimeout = 30 * 60 * 1000, sExecName = asArgs[0], \
+                                      asArgs = asArgs, asAddEnv = self.asEnv, fCheckSessionStatus = True);
                 if fRc:
                     iRc = 0;
@@ -1123,5 +1132,5 @@
         return fSkipped;
 
-    def _testRunUnitTestsSet(self, sTestCasePattern, sTestCaseSubDir):
+    def _testRunUnitTestsSet(self, oTestVm, sTestCasePattern, sTestCaseSubDir):
         """
         Run subset of the unit tests set.
@@ -1203,5 +1212,5 @@
                 reporter.testStart(sName);
                 try:
-                    fSkipped = self._executeTestCase(sName, sFullPath, sTestCaseSubDir, oDevNull);
+                    fSkipped = self._executeTestCase(oTestVm, sName, sFullPath, sTestCaseSubDir, oDevNull);
                 except:
                     reporter.errorXcpt('!*!');
