Index: /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 55633)
+++ /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 55634)
@@ -340,4 +340,26 @@
         self.aBuf = aBuf;
 
+    def getOpenAction(self):
+        """ Converts string disposition to open action enum. """
+        if self.sDisposition == 'oe': return vboxcon.FileOpenAction_OpenExisting;
+        if self.sDisposition == 'oc': return vboxcon.FileOpenAction_OpenOrCreate;
+        if self.sDisposition == 'ce': return vboxcon.FileOpenAction_CreateNew;
+        if self.sDisposition == 'ca': return vboxcon.FileOpenAction_CreateOrReplace;
+        if self.sDisposition == 'ot': return vboxcon.FileOpenAction_OpenExistingTruncated;
+        if self.sDisposition == 'oa': return vboxcon.FileOpenAction_AppendOrCreate;
+        raise base.GenError(self.sDisposition);
+
+    def getAccessMode(self):
+        """ Converts open mode to access mode enum. """
+        if self.sOpenMode == 'r':  return vboxcon.FileOpenMode_ReadOnly;
+        if self.sOpenMode == 'w':  return vboxcon.FileOpenMode_WriteOnly;
+        if self.sOpenMode == 'w+': return vboxcon.FileOpenMode_ReadWrite;
+        if self.sOpenMode == 'r+': return vboxcon.FileOpenMode_ReadWrite;
+        raise base.GenError(self.sOpenMode);
+
+    def getSharingMode(self):
+        """ Converts the sharing mode. """
+        return vboxcon.FileSharingMode_All;
+
 class tdTestSession(tdTestGuestCtrlBase):
     """
@@ -657,5 +679,8 @@
         try:
             reporter.log2('Copying guest file "%s" to host "%s"' % (sSrc, sDst));
-            curProgress = oGuestSession.copyFrom(sSrc, sDst, aFlags);
+            if self.oTstDrv.fpApiVer >= 5.0:
+                curProgress = oGuestSession.fileCopyFromGuest(sSrc, sDst, aFlags);
+            else:
+                curProgress = oGuestSession.copyFrom(sSrc, sDst, aFlags);
             if curProgress is not None:
                 oProgress = vboxwrappers.ProgressWrapper(curProgress, self.oTstDrv.oVBoxMgr, self, "gctrlCopyFrm");
@@ -684,5 +709,8 @@
         try:
             reporter.log2('Copying host file "%s" to guest "%s"' % (sSrc, sDst));
-            curProgress = oGuestSession.copyTo(sSrc, sDst, aFlags);
+            if self.oTstDrv.fpApiVer >= 5.0:
+                curProgress = oGuestSession.fileCopyToGuest(sSrc, sDst, aFlags);
+            else:
+                curProgress = oGuestSession.copyTo(sSrc, sDst, aFlags);
             if curProgress is not None:
                 oProgress = vboxwrappers.ProgressWrapper(curProgress, self.oTstDrv.oVBoxMgr, self, "gctrlCopyTo");
@@ -865,5 +893,8 @@
             oGuestSession.directoryCreate(oTest.sDirectory, \
                                           oTest.fMode, oTest.aFlags);
-            fDirExists = oGuestSession.directoryExists(oTest.sDirectory);
+            if self.oTstDrv.fpApiVer >= 5.0:
+                fDirExists = oGuestSession.directoryExists(oTest.sDirectory, False);
+            else:
+                fDirExists = oGuestSession.directoryExists(oTest.sDirectory);
             if      fDirExists is False \
                 and oRes.fRc is True:
@@ -1425,5 +1456,8 @@
             for i in range(0, cStaleFiles):
                 try:
-                    oGuestSession.fileOpen(sFile, "r", "oe", 0);
+                    if self.oTstDrv.fpApiVer >= 5.0:
+                        oGuestSession.fileOpen(sFile, vboxcon.FileAccessMode_ReadOnly, vboxcon.FileOpenAction_OpenExisting, 0);
+                    else:
+                        oGuestSession.fileOpen(sFile, "r", "oe", 0);
                     # 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
@@ -1448,5 +1482,9 @@
                 for i in range(0, cStaleFiles):
                     try:
-                        oCurFile = oGuestSession.fileOpen(sFile, "r", "oe", 0);
+                        if self.oTstDrv.fpApiVer >= 5.0:
+                            oCurFile = oGuestSession.fileOpen(sFile, vboxcon.FileAccessMode_ReadOnly,
+                                                              vboxcon.FileOpenAction_OpenExisting, 0);
+                        else:
+                            oCurFile = oGuestSession.fileOpen(sFile, "r", "oe", 0);
                         aaFiles.append(oCurFile);
                     except:
@@ -2335,5 +2373,8 @@
             if sDirTemp  != "":
                 reporter.log2('Temporary directory is: %s' % (sDirTemp,));
-                fExists = curGuestSession.directoryExists(sDirTemp);
+                if self.oTstDrv.fpApiVer >= 5.0:
+                    fExists = curGuestSession.directoryExists(sDirTemp, False);
+                else:
+                    fExists = curGuestSession.directoryExists(sDirTemp);
                 if fExists is False:
                     reporter.error('Test #%d failed: Temporary directory "%s" does not exists' % (i, sDirTemp));
@@ -2479,5 +2520,8 @@
                 break;
             try:
-                curGuestSession.fileRemove(curTest.sFile);
+                if self.oTstDrv.fpApiVer >= 5.0:
+                    curGuestSession.fsObjRemove(curTest.sFile);
+                else:
+                    curGuestSession.fileRemove(curTest.sFile);
             except:
                 if curRes.fRc is True:
@@ -2551,5 +2595,8 @@
             fileObjInfo = None;
             try:
-                fileObjInfo = curGuestSession.fileQueryInfo(curTest.sFile);
+                if self.oTstDrv.fpApiVer >= 5.0:
+                    fileObjInfo = curGuestSession.fsObjQueryInfo(curTest.sFile, True);
+                else:
+                    fileObjInfo = curGuestSession.fileQueryInfo(curTest.sFile);
             except:
                 if curRes.fRc is True:
@@ -2674,6 +2721,10 @@
             try:
                 if curTest.cbOffset > 0:
-                    curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
-                                                         curTest.sSharingMode, curTest.lCreationMode, curTest.cbOffset);
+                    if self.oTstDrv.fpApiVer >= 5.0:
+                        curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(),
+                                                             curTest.getSharingMode(), curTest.lCreationMode, curTest.cbOffset);
+                    else:
+                        curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
+                                                             curTest.sSharingMode, curTest.lCreationMode, curTest.cbOffset);
                     curOffset = long(curFile.offset);
                     resOffset = long(curTest.cbOffset);
@@ -2683,6 +2734,10 @@
                         fRc = False;
                 else:
-                    curFile = curGuestSession.fileOpen(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
-                                                       curTest.lCreationMode);
+                    if self.oTstDrv.fpApiVer >= 5.0:
+                        curFile = curGuestSession.fileOpen(curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(),
+                                                           curTest.lCreationMode);
+                    else:
+                        curFile = curGuestSession.fileOpen(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
+                                                           curTest.lCreationMode);
                 if  fRc \
                 and curTest.cbToReadWrite > 0:
@@ -2779,6 +2834,10 @@
             try:
                 if curTest.cbOffset > 0:
-                    curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
-                                                         curTest.sSharingMode, curTest.lCreationMode, curTest.cbOffset);
+                    if self.oTstDrv.fpApiVer >= 5.0:
+                        curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(),
+                                                             curTest.getSharingMode(), curTest.cbOffset);
+                    else:
+                        curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
+                                                             curTest.sSharingMode, curTest.lCreationMode, curTest.cbOffset);
                     curOffset = long(curFile.offset);
                     resOffset = long(curTest.cbOffset);
@@ -2788,6 +2847,10 @@
                         fRc = False;
                 else:
-                    curFile = curGuestSession.fileOpen(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
-                                                       curTest.lCreationMode);
+                    if self.oTstDrv.fpApiVer >= 5.0:
+                        curFile = curGuestSession.fileOpen(curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(),
+                                                           curTest.lCreationMode);
+                    else:
+                        curFile = curGuestSession.fileOpen(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
+                                                           curTest.lCreationMode);
                 if  fRc \
                 and curTest.cbToReadWrite > 0:
@@ -2804,5 +2867,8 @@
                         # re-read & compare the written data.
                         try:
-                            curFile.seek(-(curTest.cbToReadWrite), vboxcon.FileSeekType_Current);
+                            if self.oTstDrv.fpApiVer >= 5.0:
+                                curFile.seek(-(curTest.cbToReadWrite), vboxcon.FileSeekOrigin_Current);
+                            else:
+                                curFile.seek(-(curTest.cbToReadWrite), vboxcon.FileSeekType_Current);
                         except:
                             reporter.logXcpt('Seeking back to initial write position failed:');
