VirtualBox

Ignore:
Timestamp:
Mar 4, 2019 10:27:45 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
129156
Message:

Guest Control/Validation Kit: Saved *a lot* of code by unifying the test credentials code: Unless not specified otherwise, tests will now use the default set of (guest) credentials.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r77550 r77551  
    9191        self.fRc = False;
    9292        ## IGuest reference.
    93         self.oGuest = oSession.o.console.guest;
    94         # Rest not used (yet).
     93        self.oGuest      = oSession.o.console.guest;
     94        self.oSesison    = oSession;
     95        self.oTxsSesison = oTxsSession;
     96        self.oTestVm     = oTestVm;
    9597
    9698class tdCtxCreds(object):
     
    98100    Provides credentials to pass to the guest.
    99101    """
    100     def __init__(self, sUser = None, sPassword = None, sDomain = None, oTestVm = None):
    101         # If no user is specified, select the default user and
    102         # password for the given test VM.
    103         if sUser is None:
    104             assert sPassword is None;
    105             assert sDomain is None;
    106             assert oTestVm is not None;
    107 
    108             ## @todo fix this so all VMs have several usable test users with the same passwords (or none).
    109             if oTestVm.isWindows():
    110                 sUser = 'Administrator';
     102    def __init__(self, sUser = None, sPassword = None, sDomain = None):
     103        self.sUser     = sUser;
     104        self.sPassword = sPassword;
     105        self.sDomain   = sDomain;
     106
     107    def applyDefaultsIfNotSet(self, oTestVm):
     108        """
     109        Applies credential defaults, based on the test VM (guest OS), if
     110        no credentials were set yet.
     111        """
     112        self.oTestVm = oTestVm;
     113        assert self.oTestVm is not None;
     114
     115        if self.sUser is None:
     116            if self.oTestVm.isWindows():
     117                self.sUser = 'Administrator';
    111118            else:
    112                 sUser = 'vbox';
    113             sPassword = 'password';
    114             sDomain   = '';
    115 
    116         self.sUser     = sUser;
    117         self.sPassword = sPassword if sPassword is not None else '';
    118         self.sDomain   = sDomain if sDomain is not None else '';
     119                self.sUser = 'vbox';
     120
     121        if self.sPassword is None:
     122            self.sPassword = 'password';
     123
     124        if self.sDomain is None:
     125            self.sDomain   = '';
    119126
    120127class tdTestGuestCtrlBase(object):
     
    136143        """
    137144        self.oTest = tdCtxTest(oSession, oTxsSession, oTestVm);
     145        self.oCreds.applyDefaultsIfNotSet(oTestVm);
    138146        return self.oTest;
    139147
     
    226234    Test for copying files from the guest to the host.
    227235    """
    228     def __init__(self, sSrc = "", sDst = "", sUser = "", sPassword = "", aFlags = None):
     236    def __init__(self, sSrc = "", sDst = "", sUser = None, sPassword = None, aFlags = None):
    229237        tdTestGuestCtrlBase.__init__(self);
    230         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     238        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    231239        self.sSrc = sSrc;
    232240        self.sDst = sDst;
     
    237245    Test for copying files from the host to the guest.
    238246    """
    239     def __init__(self, sSrc = "", sDst = "", sUser = "", sPassword = "", aFlags = None):
     247    def __init__(self, sSrc = "", sDst = "", sUser = None, sPassword = None, aFlags = None):
    240248        tdTestGuestCtrlBase.__init__(self);
    241         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     249        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    242250        self.sSrc = sSrc;
    243251        self.sDst = sDst;
     
    248256    Test for directoryCreate call.
    249257    """
    250     def __init__(self, sDirectory = "", sUser = "", sPassword = "", fMode = 0, aFlags = None):
     258    def __init__(self, sDirectory = "", sUser = None, sPassword = None, fMode = 0, aFlags = None):
    251259        tdTestGuestCtrlBase.__init__(self);
    252         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     260        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    253261        self.sDirectory = sDirectory;
    254262        self.fMode = fMode;
     
    259267    Test for the directoryCreateTemp call.
    260268    """
    261     def __init__(self, sDirectory = "", sTemplate = "", sUser = "", sPassword = "", fMode = 0, fSecure = False):
     269    def __init__(self, sDirectory = "", sTemplate = "", sUser = None, sPassword = None, fMode = 0, fSecure = False):
    262270        tdTestGuestCtrlBase.__init__(self);
    263         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     271        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    264272        self.sDirectory = sDirectory;
    265273        self.sTemplate = sTemplate;
     
    271279    Test for the directoryOpen call.
    272280    """
    273     def __init__(self, sDirectory = "", sUser = "", sPassword = "",
     281    def __init__(self, sDirectory = "", sUser = None, sPassword = None,
    274282                 sFilter = "", aFlags = None):
    275283        tdTestGuestCtrlBase.__init__(self);
    276         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     284        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    277285        self.sDirectory = sDirectory;
    278286        self.sFilter = sFilter;
     
    283291    Test for the opening, reading and closing a certain directory.
    284292    """
    285     def __init__(self, sDirectory = "", sUser = "", sPassword = "",
     293    def __init__(self, sDirectory = "", sUser = None, sPassword = None,
    286294                 sFilter = "", aFlags = None):
    287295        tdTestDirOpen.__init__(self, sDirectory, sUser, sPassword, sFilter, aFlags);
     
    294302    def __init__(self, sCmd = "", aArgs = None, aEnv = None, \
    295303                 aFlags = None, timeoutMS = 5 * 60 * 1000, \
    296                  sUser = "", sPassword = "", sDomain = "", \
     304                 sUser = None, sPassword = None, sDomain = None, \
    297305                 fWaitForExit = True):
    298306        tdTestGuestCtrlBase.__init__(self);
     
    314322    Test for the file exists API call (fileExists).
    315323    """
    316     def __init__(self, sFile = "", sUser = "", sPassword = ""):
     324    def __init__(self, sFile = "", sUser = None, sPassword = None):
    317325        tdTestGuestCtrlBase.__init__(self);
    318         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     326        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    319327        self.sFile = sFile;
    320328
     
    323331    Test querying guest file information.
    324332    """
    325     def __init__(self, sFile = "", sUser = "", sPassword = ""):
     333    def __init__(self, sFile = "", sUser = None, sPassword = None):
    326334        tdTestGuestCtrlBase.__init__(self);
    327         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     335        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    328336        self.sFile = sFile;
    329337
     
    332340    Test querying guest file information.
    333341    """
    334     def __init__(self, sFile = "", sUser = "", sPassword = "", cbSize = 0, eFileType = 0):
     342    def __init__(self, sFile = "", sUser = None, sPassword = None, cbSize = 0, eFileType = 0):
    335343        tdTestGuestCtrlBase.__init__(self);
    336         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     344        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    337345        self.sFile = sFile;
    338346        self.cbSize = cbSize;
     
    343351    Test for the IGuestFile object.
    344352    """
    345     def __init__(self, sFile = "", sUser = "", sPassword = ""):
     353    def __init__(self, sFile = "", sUser = None, sPassword = None):
    346354        tdTestGuestCtrlBase.__init__(self);
    347         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     355        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    348356        self.sFile = sFile;
    349357
     
    352360    Test for the file size query API call (fileQuerySize).
    353361    """
    354     def __init__(self, sFile = "", sUser = "", sPassword = ""):
     362    def __init__(self, sFile = "", sUser = None, sPassword = None):
    355363        tdTestGuestCtrlBase.__init__(self);
    356         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     364        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    357365        self.sFile = sFile;
    358366
     
    361369    Tests reading from guest files.
    362370    """
    363     def __init__(self, sFile = "", sUser = "", sPassword = "",
     371    def __init__(self, sFile = "", sUser = None, sPassword = None,
    364372                 sOpenMode = "r", sDisposition = "",
    365373                 sSharingMode = "",
     
    367375                 aBuf = None):
    368376        tdTestGuestCtrlBase.__init__(self);
    369         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
     377        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
    370378        self.sFile = sFile;
    371379        self.sOpenMode = sOpenMode;
     
    403411    Test the guest session handling.
    404412    """
    405     def __init__(self, sUser = "", sPassword = "", sDomain = "", \
     413    def __init__(self, sUser = None, sPassword = None, sDomain = None, \
    406414                 sSessionName = ""):
    407415        tdTestGuestCtrlBase.__init__(self);
     
    437445        #
    438446        assert self.enmUser is None; # For later.
    439         self.oCreds = tdCtxCreds(oTestVm = oTestVm);
     447        self.oCreds = tdCtxCreds();
    440448        self.setEnvironment(oVmSession, oTxsSession, oTestVm);
    441449        reporter.log2('%s: %s steps' % (sMsgPrefix, len(self.aoSteps),));
     
    849857    """
    850858    def __init__(self, sSrc = "", aArgs = None, aFlags = None,
    851                  sUser = "", sPassword = "", sDomain = ""):
     859                 sUser = None, sPassword = None, sDomain = None):
    852860        tdTestGuestCtrlBase.__init__(self);
    853861        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain);
     
    14781486        """
    14791487
    1480         if oTestVm.isWindows():
    1481             sUser = "Administrator";
    1482         else:
    1483             sUser = "vbox";
    1484         sPassword = "password";
    1485 
    14861488        aaTests = [
    14871489            # Invalid parameters.
    1488             [ tdTestSession(),
    1489               tdTestResultSession(fRc = False) ],
    1490             [ tdTestSession(sUser = ''),
    1491               tdTestResultSession(fRc = False) ],
    1492             [ tdTestSession(sPassword = 'bar'),
    1493               tdTestResultSession(fRc = False) ],
    1494             [ tdTestSession(sDomain = 'boo'),
    1495               tdTestResultSession(fRc = False) ],
    1496             [ tdTestSession(sPassword = 'bar', sDomain = 'boo'),
    1497               tdTestResultSession(fRc = False) ],
     1490            [ tdTestSession(sUser = ''), tdTestResultSession() ],
     1491            [ tdTestSession(sPassword = 'bar'), tdTestResultSession() ],
     1492            [ tdTestSession(sDomain = 'boo'),tdTestResultSession() ],
     1493            [ tdTestSession(sPassword = 'bar', sDomain = 'boo'), tdTestResultSession() ],
    14981494            # User account without a passwort - forbidden.
    1499             [ tdTestSession(sUser = sUser),
    1500               tdTestResultSession(fRc = False) ],
     1495            [ tdTestSession(sPassword = "" ), tdTestResultSession() ],
    15011496            # Wrong credentials.
    15021497            # Note: On Guest Additions < 4.3 this always succeeds because these don't
    15031498            #       support creating dedicated sessions. Instead, guest process creation
    15041499            #       then will fail. See note below.
    1505             [ tdTestSession(sUser = 'foo', sPassword = 'bar', sDomain = 'boo'),
    1506               tdTestResultSession(fRc = False) ],
     1500            [ tdTestSession(sUser = 'foo', sPassword = 'bar', sDomain = 'boo'), tdTestResultSession() ],
    15071501            # Correct credentials.
    1508             [ tdTestSession(sUser = sUser, sPassword = sPassword),
     1502            [ tdTestSession(),
    15091503              tdTestResultSession(fRc = True, cNumSessions = 1) ]
    15101504        ];
     
    15581552        reporter.log2('Opening multiple guest tsessions at once ...');
    15591553        for i in range(iMaxGuestSessions + 1):
    1560             multiSession[i] = tdTestSession(sUser = sUser, sPassword = sPassword, sSessionName = 'MultiSession #%d' % (i,));
     1554            multiSession[i] = tdTestSession(sSessionName = 'MultiSession #%d' % (i,));
    15611555            multiSession[i].setEnvironment(oSession, oTxsSession, oTestVm);
    15621556            curSessionCount = multiSession[i].getSessionCount(self.oTstDrv.oVBoxMgr);
     
    16291623
    16301624        if oTestVm.isWindows():
    1631             sUser = "Administrator";
    1632             sPassword = "password";
    1633             sDomain = "";
    16341625            sFile = "C:\\windows\\system32\\kernel32.dll";
    16351626        elif oTestVm.isLinux():
    1636             sUser = "vbox";
    1637             sPassword = "password";
    1638             sDomain = "";
    16391627            sFile = "/bin/sh";
     1628
     1629        # Use credential defaults.
     1630        oCreds = tdCtxCreds();
     1631        oCreds.applyDefaultsIfNotSet(oTestVm);
    16401632
    16411633        # Number of stale guest files to create.
     
    16451637        try:
    16461638            oGuest = oSession.o.console.guest;
    1647             oGuestSession = oGuest.createSession(sUser, sPassword, sDomain, \
    1648                                                  "testGuestCtrlSessionFileRefs");
     1639            oGuestSession = oGuest.createSession(oCreds.sUser, oCreds.sPassword, oCreds.sDomain, "testGuestCtrlSessionFileRefs");
    16491640            fWaitFor = [ vboxcon.GuestSessionWaitForFlag_Start ];
    16501641            waitResult = oGuestSession.waitForArray(fWaitFor, 30 * 1000);
     
    17691760
    17701761        if oTestVm.isWindows():
    1771             sUser = "Administrator";
    17721762            sCmd = "C:\\windows\\system32\\cmd.exe";
    17731763        elif oTestVm.isLinux():
    1774             sUser = "vbox";
    17751764            sCmd = "/bin/sh";
    1776         sPassword = "password";
    1777         sDomain = "";
    17781765        aArgs = [sCmd,];
     1766
     1767        # Use credential defaults.
     1768        oCreds = tdCtxCreds();
     1769        oCreds.applyDefaultsIfNotSet(oTestVm);
    17791770
    17801771        # Number of stale guest processes to create.
     
    17841775        try:
    17851776            oGuest = oSession.o.console.guest;
    1786             oGuestSession = oGuest.createSession(sUser, sPassword, sDomain, \
    1787                                                  "testGuestCtrlSessionProcRefs");
     1777            oGuestSession = oGuest.createSession(oCreds.sUser, oCreds.sPassword, oCreds.sDomain, "testGuestCtrlSessionProcRefs");
    17881778            fWaitFor = [ vboxcon.GuestSessionWaitForFlag_Start ];
    17891779            waitResult = oGuestSession.waitForArray(fWaitFor, 30 * 1000);
     
    19271917
    19281918        if oTestVm.isWindows():
    1929             sUser = "Administrator";
    1930         else:
    1931             sUser = "vbox";
    1932         sPassword = "password";
    1933 
    1934         if oTestVm.isWindows():
    19351919            sImageOut = "C:\\windows\\system32\\cmd.exe";
    19361920        else:
    1937             sImageOut = "/bin/sh";
     1921            sImageOut = "/bin/ls";
    19381922
    19391923        aaInvalid = [
    19401924            # Invalid parameters.
    1941             [ tdTestExec(sUser = sUser, sPassword = sPassword),
    1942               tdTestResultExec(fRc = False) ],
     1925            [ tdTestExec(), tdTestResultExec() ],
    19431926            # Non-existent / invalid image.
    1944             [ tdTestExec(sCmd = "non-existent", sUser = sUser, sPassword = sPassword),
    1945               tdTestResultExec(fRc = False) ],
    1946             [ tdTestExec(sCmd = "non-existent2", sUser = sUser, sPassword = sPassword, fWaitForExit = True),
    1947               tdTestResultExec(fRc = False) ],
     1927            [ tdTestExec(sCmd = "non-existent"), tdTestResultExec() ],
     1928            [ tdTestExec(sCmd = "non-existent2"), tdTestResultExec() ],
    19481929            # Use an invalid format string.
    1949             [ tdTestExec(sCmd = "%$%%%&", sUser = sUser, sPassword = sPassword),
    1950               tdTestResultExec(fRc = False) ],
     1930            [ tdTestExec(sCmd = "%$%%%&"), tdTestResultExec() ],
    19511931            # More stuff.
    1952             [ tdTestExec(sCmd = u"ƒ‰‹ˆ÷‹¸", sUser = sUser, sPassword = sPassword),
    1953               tdTestResultExec(fRc = False) ],
    1954             [ tdTestExec(sCmd = "???://!!!", sUser = sUser, sPassword = sPassword),
    1955               tdTestResultExec(fRc = False) ],
    1956             [ tdTestExec(sCmd = "<>!\\", sUser = sUser, sPassword = sPassword),
    1957               tdTestResultExec(fRc = False) ]
     1932            [ tdTestExec(sCmd = u"ƒ‰‹ˆ÷‹¸"), tdTestResultExec() ],
     1933            [ tdTestExec(sCmd = "???://!!!"), tdTestResultExec() ],
     1934            [ tdTestExec(sCmd = "<>!\\"), tdTestResultExec() ],
    19581935            # Enable as soon as ERROR_BAD_DEVICE is implemented.
    1959             #[ tdTestExec(sCmd = "CON", sUser = sUser, sPassword = sPassword),
    1960             #  tdTestResultExec(fRc = False) ]
     1936            #[ tdTestExec(sCmd = "CON", tdTestResultExec() ],
    19611937        ];
    19621938
     
    19651941            aaExec = [
    19661942                # Basic executon.
    1967                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32' ],
    1968                              sUser = sUser, sPassword = sPassword),
     1943                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32' ]),
    19691944                  tdTestResultExec(fRc = True) ],
    1970                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32\\kernel32.dll' ],
    1971                              sUser = sUser, sPassword = sPassword),
     1945                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32\\kernel32.dll' ]),
    19721946                  tdTestResultExec(fRc = True) ],
    1973                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32\\nonexist.dll' ],
    1974                              sUser = sUser, sPassword = sPassword),
     1947                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32\\nonexist.dll' ]),
    19751948                  tdTestResultExec(fRc = True, iExitCode = 1) ],
    1976                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', '/wrongparam' ],
    1977                              sUser = sUser, sPassword = sPassword),
     1949                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', '/wrongparam' ]),
    19781950                  tdTestResultExec(fRc = True, iExitCode = 1) ],
    19791951                # Paths with spaces.
    19801952                ## @todo Get path of installed Guest Additions. Later.
    1981                 [ tdTestExec(sCmd = sVBoxControl, aArgs = [ sVBoxControl, 'version' ],
    1982                              sUser = sUser, sPassword = sPassword),
     1953                [ tdTestExec(sCmd = sVBoxControl, aArgs = [ sVBoxControl, 'version' ]),
    19831954                  tdTestResultExec(fRc = True) ],
    19841955                # StdOut.
    1985                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32' ],
    1986                              sUser = sUser, sPassword = sPassword),
     1956                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32' ]),
    19871957                  tdTestResultExec(fRc = True) ],
    1988                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'stdout-non-existing' ],
    1989                              sUser = sUser, sPassword = sPassword),
     1958                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'stdout-non-existing' ]),
    19901959                  tdTestResultExec(fRc = True, iExitCode = 1) ],
    19911960                # StdErr.
    1992                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32' ],
    1993                              sUser = sUser, sPassword = sPassword),
     1961                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32' ]),
    19941962                  tdTestResultExec(fRc = True) ],
    1995                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'stderr-non-existing' ],
    1996                              sUser = sUser, sPassword = sPassword),
     1963                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'stderr-non-existing' ]),
    19971964                  tdTestResultExec(fRc = True, iExitCode = 1) ],
    19981965                # StdOut + StdErr.
    1999                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32' ],
    2000                              sUser = sUser, sPassword = sPassword),
     1966                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'c:\\windows\\system32' ]),
    20011967                  tdTestResultExec(fRc = True) ],
    2002                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'stdouterr-non-existing' ],
    2003                              sUser = sUser, sPassword = sPassword),
     1968                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'dir', '/S', 'stdouterr-non-existing' ]),
    20041969                  tdTestResultExec(fRc = True, iExitCode = 1) ]
    20051970                # FIXME: Failing tests.
    20061971                # Environment variables.
    20071972                # [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'set', 'TEST_NONEXIST' ],
    2008                 #              sUser = sUser, sPassword = sPassword),
    20091973                #   tdTestResultExec(fRc = True, iExitCode = 1) ]
    20101974                # [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'set', 'windir' ],
    2011                 #              sUser = sUser, sPassword = sPassword,
    20121975                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    20131976                #   tdTestResultExec(fRc = True, sBuf = 'windir=C:\\WINDOWS\r\n') ],
    20141977                # [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'set', 'TEST_FOO' ],
    2015                 #              sUser = sUser, sPassword = sPassword,
    20161978                #              aEnv = [ 'TEST_FOO=BAR' ],
    20171979                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    20181980                #   tdTestResultExec(fRc = True, sBuf = 'TEST_FOO=BAR\r\n') ],
    20191981                # [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'set', 'TEST_FOO' ],
    2020                 #              sUser = sUser, sPassword = sPassword,
    20211982                #              aEnv = [ 'TEST_FOO=BAR', 'TEST_BAZ=BAR' ],
    20221983                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
     
    20301991            aaExec = [
    20311992                # Basic executon.
    2032                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls', '/R', 'etc' ],
    2033                              sUser = sUser, sPassword = sPassword),
     1993                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-R', '/etc' ]),
     1994                  tdTestResultExec(fRc = True, iExitCode = 1) ],
     1995                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/bin/sh' ]),
    20341996                  tdTestResultExec(fRc = True) ],
    2035                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls /bin/sh' ],
    2036                              sUser = sUser, sPassword = sPassword),
    2037                   tdTestResultExec(fRc = True) ],
    2038                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '--wrong-parameter' ],
    2039                              sUser = sUser, sPassword = sPassword),
     1997                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '--wrong-parameter' ]),
    20401998                  tdTestResultExec(fRc = True, iExitCode = 2) ],
    2041                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls /non/existent' ],
    2042                              sUser = sUser, sPassword = sPassword),
    2043                   tdTestResultExec(fRc = True, iExitCode = 2) ],
    2044                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls /bin/sh /wrongparam' ],
    2045                              sUser = sUser, sPassword = sPassword),
     1999                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/non/existent' ]),
    20462000                  tdTestResultExec(fRc = True, iExitCode = 2) ],
    20472001                # Paths with spaces.
    20482002                ## @todo Get path of installed Guest Additions. Later.
    2049                 [ tdTestExec(sCmd = sVBoxControl, aArgs = [ sVBoxControl, 'version' ],
    2050                              sUser = sUser, sPassword = sPassword),
     2003                [ tdTestExec(sCmd = sVBoxControl, aArgs = [ sVBoxControl, 'version' ]),
    20512004                  tdTestResultExec(fRc = True) ],
    20522005                # StdOut.
    2053                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls /etc' ],
    2054                              sUser = sUser, sPassword = sPassword),
     2006                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/etc' ]),
    20552007                  tdTestResultExec(fRc = True) ],
    2056                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls stdout-non-existing' ],
    2057                              sUser = sUser, sPassword = sPassword),
     2008                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, 'stdout-non-existing' ]),
    20582009                  tdTestResultExec(fRc = True, iExitCode = 2) ],
    20592010                # StdErr.
    2060                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls /etc' ],
    2061                              sUser = sUser, sPassword = sPassword),
     2011                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/etc' ]),
    20622012                  tdTestResultExec(fRc = True) ],
    2063                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls stderr-non-existing' ],
    2064                              sUser = sUser, sPassword = sPassword),
     2013                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, 'stderr-non-existing' ]),
    20652014                  tdTestResultExec(fRc = True, iExitCode = 2) ],
    20662015                # StdOut + StdErr.
    2067                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls /etc' ],
    2068                              sUser = sUser, sPassword = sPassword),
     2016                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/etc' ]),
    20692017                  tdTestResultExec(fRc = True) ],
    2070                 [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '-c', 'ls stdouterr-non-existing' ],
    2071                              sUser = sUser, sPassword = sPassword),
     2018                [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, 'stdouterr-non-existing' ]),
    20722019                  tdTestResultExec(fRc = True, iExitCode = 2) ]
    20732020                # FIXME: Failing tests.
    20742021                # Environment variables.
    20752022                # [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'set', 'TEST_NONEXIST' ],
    2076                 #              sUser = sUser, sPassword = sPassword),
    20772023                #   tdTestResultExec(fRc = True, iExitCode = 1) ]
    20782024                # [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'set', 'windir' ],
    2079                 #              sUser = sUser, sPassword = sPassword,
     2025                #
    20802026                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    20812027                #   tdTestResultExec(fRc = True, sBuf = 'windir=C:\\WINDOWS\r\n') ],
    20822028                # [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'set', 'TEST_FOO' ],
    2083                 #              sUser = sUser, sPassword = sPassword,
    20842029                #              aEnv = [ 'TEST_FOO=BAR' ],
    20852030                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    20862031                #   tdTestResultExec(fRc = True, sBuf = 'TEST_FOO=BAR\r\n') ],
    20872032                # [ tdTestExec(sCmd = sImageOut, aArgs = [ sImageOut, '/C', 'set', 'TEST_FOO' ],
    2088                 #              sUser = sUser, sPassword = sPassword,
    20892033                #              aEnv = [ 'TEST_FOO=BAR', 'TEST_BAZ=BAR' ],
    20902034                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
     
    20942038                ## @todo Add task which gets killed at some random time while letting the guest output something.
    20952039            ];
    2096         else:
    2097             reporter.log('No OS-specific tests for non-Windows yet!');
    20982040
    20992041        # Build up the final test array for the first batch.
     
    21252067            if fRc is False:
    21262068                break;
     2069
     2070        reporter.log('Execution of all tests done, checking for stale sessions');
    21272071
    21282072        # No sessions left?
     
    21822126            reporter.logXcpt('Could not create one session:');
    21832127
     2128        reporter.log('Execution of all tests done, checking for stale sessions again');
     2129
    21842130        # No sessions left?
    21852131        if fRc is True:
     
    21972143
    21982144        if oTestVm.isWindows():
    2199             sUser = "Administrator";
    2200         else:
    2201             sUser = "vbox";
    2202         sPassword = "password";
    2203 
    2204         if oTestVm.isWindows():
    22052145            sImage = "C:\\windows\\system32\\cmd.exe";
    22062146        else:
     
    22112151            aaTests.extend([
    22122152                # Simple.
    2213                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'wrongcommand' ],
    2214                              sUser = sUser, sPassword = sPassword),
     2153                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'wrongcommand' ]),
    22152154                  tdTestResultExec(fRc = True, iExitCode = 1) ],
    2216                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'exit', '22' ],
    2217                              sUser = sUser, sPassword = sPassword),
     2155                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'exit', '22' ]),
    22182156                  tdTestResultExec(fRc = True, iExitCode = 22) ],
    2219                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'set', 'ERRORLEVEL=234' ],
    2220                              sUser = sUser, sPassword = sPassword),
     2157                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'set', 'ERRORLEVEL=234' ]),
    22212158                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2222                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'echo', '%WINDIR%' ],
    2223                              sUser = sUser, sPassword = sPassword),
     2159                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'echo', '%WINDIR%' ]),
    22242160                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2225                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'set', 'ERRORLEVEL=0' ],
    2226                              sUser = sUser, sPassword = sPassword),
     2161                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'set', 'ERRORLEVEL=0' ]),
    22272162                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2228                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\windows\\system32' ],
    2229                              sUser = sUser, sPassword = sPassword),
     2163                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\windows\\system32' ]),
    22302164                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2231                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\windows\\system32\\kernel32.dll' ],
    2232                              sUser = sUser, sPassword = sPassword),
     2165                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\windows\\system32\\kernel32.dll' ]),
    22332166                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2234                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-file' ],
    2235                              sUser = sUser, sPassword = sPassword),
     2167                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-file' ]),
    22362168                  tdTestResultExec(fRc = True, iExitCode = 1) ],
    2237                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-dir\\' ],
    2238                              sUser = sUser, sPassword = sPassword),
     2169                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-dir\\' ]),
    22392170                  tdTestResultExec(fRc = True, iExitCode = 1) ]
    22402171                # FIXME: Failing tests.
    22412172                # With stdout.
    22422173                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\windows\\system32' ],
    2243                 #              sUser = sUser, sPassword = sPassword, aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut ]),
     2174                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut ]),
    22442175                #   tdTestResultExec(fRc = True, iExitCode = 0) ],
    22452176                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-file' ],
    2246                 #              sUser = sUser, sPassword = sPassword, aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut ]),
     2177                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut ]),
    22472178                #   tdTestResultExec(fRc = True, iExitCode = 1) ],
    22482179                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-dir\\' ],
    2249                 #              sUser = sUser, sPassword = sPassword, aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut ]),
     2180                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut ]),
    22502181                #   tdTestResultExec(fRc = True, iExitCode = 1) ],
    22512182                # With stderr.
    22522183                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\windows\\system32' ],
    2253                 #              sUser = sUser, sPassword = sPassword, aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdErr ]),
     2184                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    22542185                #   tdTestResultExec(fRc = True, iExitCode = 0) ],
    22552186                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-file' ],
    2256                 #              sUser = sUser, sPassword = sPassword, aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdErr ]),
     2187                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    22572188                #   tdTestResultExec(fRc = True, iExitCode = 1) ],
    22582189                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-dir\\' ],
    2259                 #              sUser = sUser, sPassword = sPassword, aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdErr ]),
     2190                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    22602191                #   tdTestResultExec(fRc = True, iExitCode = 1) ],
    22612192                # With stdout/stderr.
    22622193                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\windows\\system32' ],
    2263                 #              sUser = sUser, sPassword = sPassword,
    22642194                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    22652195                #   tdTestResultExec(fRc = True, iExitCode = 0) ],
    22662196                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-file' ],
    2267                 #              sUser = sUser, sPassword = sPassword,
    22682197                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    22692198                #   tdTestResultExec(fRc = True, iExitCode = 1) ],
    22702199                # [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '/C', 'dir', 'c:\\nonexisting-dir\\' ],
    2271                 #              sUser = sUser, sPassword = sPassword,
    22722200                #              aFlags = [ vboxcon.ProcessCreateFlag_WaitForStdOut, vboxcon.ProcessCreateFlag_WaitForStdErr ]),
    22732201                #   tdTestResultExec(fRc = True, iExitCode = 1) ]
     
    22772205            aaTests.extend([
    22782206                # Simple.
    2279                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'wrongcommand' ],
    2280                              sUser = sUser, sPassword = sPassword),
     2207                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'wrongcommand' ]),
    22812208                  tdTestResultExec(fRc = True, iExitCode = 127) ],
    2282                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'exit 22' ],
    2283                              sUser = sUser, sPassword = sPassword),
     2209                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'exit 22' ]),
    22842210                  tdTestResultExec(fRc = True, iExitCode = 22) ],
    2285                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'echo $PWD' ],
    2286                              sUser = sUser, sPassword = sPassword),
     2211                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'echo $PWD' ]),
    22872212                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2288                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'export MY_ERRORLEVEL=0' ],
    2289                              sUser = sUser, sPassword = sPassword),
     2213                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'export MY_ERRORLEVEL=0' ]),
    22902214                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2291                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'ls /etc' ],
    2292                              sUser = sUser, sPassword = sPassword),
     2215                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'ls /etc' ]),
    22932216                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2294                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'ls /bin/sh' ],
    2295                              sUser = sUser, sPassword = sPassword),
     2217                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'ls /bin/sh' ]),
    22962218                  tdTestResultExec(fRc = True, iExitCode = 0) ],
    2297                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'ls /non/existing/file' ],
    2298                              sUser = sUser, sPassword = sPassword),
     2219                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'ls /non/existing/file' ]),
    22992220                  tdTestResultExec(fRc = True, iExitCode = 2) ],
    2300                 [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'ls /non/existing/dir/' ],
    2301                              sUser = sUser, sPassword = sPassword),
     2221                [ tdTestExec(sCmd = sImage, aArgs = [ sImage, '-c', 'ls /non/existing/dir/' ]),
    23022222                  tdTestResultExec(fRc = True, iExitCode = 2) ]
    23032223            ]);
     
    23252245
    23262246        if oTestVm.isWindows():
    2327             sUser = "Administrator";
    2328         else:
    2329             sUser = "vbox";
    2330         sPassword = "password";
    2331         sDomain   = "";
    2332 
    2333         if oTestVm.isWindows():
    23342247            sImage = "C:\\windows\\system32\\cmd.exe";
    23352248        else:
    23362249            sImage = "/bin/sh";
    23372250
     2251        # Use credential defaults.
     2252        oCreds = tdCtxCreds();
     2253        oCreds.applyDefaultsIfNotSet(oTestVm);
     2254
    23382255        fRc = True;
    23392256        try:
    23402257            oGuest = oSession.o.console.guest;
    2341             oGuestSession = oGuest.createSession(sUser, sPassword, sDomain, "testGuestCtrlExecTimeout");
     2258            oGuestSession = oGuest.createSession(oCreds.sUser, oCreds.sPassword, oCreds.sDomain, "testGuestCtrlExecTimeout");
    23422259            oGuestSession.waitForArray([ vboxcon.GuestSessionWaitForFlag_Start ], 30 * 1000);
    23432260            # Create a process which never terminates and should timeout when
     
    24142331
    24152332        if oTestVm.isWindows():
    2416             sUser = "Administrator";
    2417         else:
    2418             sUser = "vbox";
    2419         sPassword = "password";
    2420 
    2421         if oTestVm.isWindows():
    24222333            sScratch  = "C:\\Temp\\vboxtest\\testGuestCtrlDirCreate\\";
    24232334        else:
     
    24272338        aaTests.extend([
    24282339            # Invalid stuff.
    2429             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword, sDirectory = '' ),
    2430               tdTestResult(fRc = False) ],
     2340            [ tdTestDirCreate(sDirectory = '' ), tdTestResult() ],
    24312341            # More unusual stuff.
    2432             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword, sDirectory = '..\\..\\' ),
    2433               tdTestResult(fRc = False) ],
    2434             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword, sDirectory = '../../' ),
    2435               tdTestResult(fRc = False) ],
    2436             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword, sDirectory = 'z:\\' ),
    2437               tdTestResult(fRc = False) ],
    2438             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword, sDirectory = '\\\\uncrulez\\foo' ),
    2439               tdTestResult(fRc = False) ],
     2342            [ tdTestDirCreate(sDirectory = '..\\..\\' ), tdTestResult() ],
     2343            [ tdTestDirCreate(sDirectory = '../../' ), tdTestResult() ],
     2344            [ tdTestDirCreate(sDirectory = 'z:\\' ), tdTestResult() ],
     2345            [ tdTestDirCreate(sDirectory = '\\\\uncrulez\\foo' ), tdTestResult() ],
    24402346            # Creating directories.
    2441             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword, sDirectory = sScratch ),
    2442               tdTestResult(fRc = False) ],
    2443             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword, sDirectory = os.path.join(sScratch, 'foo\\bar\\baz'),
    2444                                 aFlags = [ vboxcon.DirectoryCreateFlag_Parents ] ),
     2347            [ tdTestDirCreate(sDirectory = sScratch ), tdTestResult() ],
     2348            [ tdTestDirCreate(sDirectory = os.path.join(sScratch, 'foo\\bar\\baz'),
     2349                              aFlags = [ vboxcon.DirectoryCreateFlag_Parents ] ),
    24452350              tdTestResult(fRc = True) ],
    2446             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword, sDirectory = os.path.join(sScratch, 'foo\\bar\\baz'),
    2447                                 aFlags = [ vboxcon.DirectoryCreateFlag_Parents ] ),
     2351            [ tdTestDirCreate(sDirectory = os.path.join(sScratch, 'foo\\bar\\baz'),
     2352                              aFlags = [ vboxcon.DirectoryCreateFlag_Parents ] ),
    24482353              tdTestResult(fRc = True) ],
    24492354            # Long (+ random) stuff.
    2450             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword,
    2451                                 sDirectory = os.path.join(sScratch,
     2355            [ tdTestDirCreate(sDirectory = os.path.join(sScratch,
    24522356                                                        "".join(random.choice(string.ascii_lowercase) for i in range(32))) ),
    24532357              tdTestResult(fRc = True) ],
    2454             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword,
    2455                                 sDirectory = os.path.join(sScratch,
     2358            [ tdTestDirCreate(sDirectory = os.path.join(sScratch,
    24562359                                                        "".join(random.choice(string.ascii_lowercase) for i in range(128))) ),
    24572360              tdTestResult(fRc = True) ],
    24582361            # Following two should fail on Windows (paths too long). Both should timeout.
    2459             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword,
    2460                                 sDirectory = os.path.join(sScratch,
     2362            [ tdTestDirCreate(sDirectory = os.path.join(sScratch,
    24612363                                                        "".join(random.choice(string.ascii_lowercase) for i in range(255))) ),
    24622364              tdTestResult(fRc = not oTestVm.isWindows()) ],
    2463             [ tdTestDirCreate(sUser = sUser, sPassword = sPassword,
    2464                                 sDirectory = os.path.join(sScratch,
    2465                                                         "".join(random.choice(string.ascii_lowercase) for i in range(255)))
    2466                                 ),
     2365            [ tdTestDirCreate(sDirectory = os.path.join(sScratch,
     2366                                                        "".join(random.choice(string.ascii_lowercase) for i in range(255))) ),
    24672367              tdTestResult(fRc = not oTestVm.isWindows()) ]
    24682368        ]);
     
    24922392        """
    24932393
    2494         if oTestVm.isWindows():
    2495             sUser = "Administrator";
    2496         else:
    2497             sUser = "vbox";
    2498         sPassword = "password";
    2499 
    25002394        aaTests = [];
    25012395        if oTestVm.isWindows():
    25022396            aaTests.extend([
    25032397                # Invalid stuff.
    2504                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sDirectory = ''),
    2505                   tdTestResult(fRc = False) ],
    2506                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sDirectory = 'C:\\Windows',
    2507                                       fMode = 1234),
    2508                   tdTestResult(fRc = False) ],
    2509                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = '',
    2510                                       sDirectory = 'C:\\Windows', fMode = 1234),
    2511                   tdTestResult(fRc = False) ],
    2512                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'xXx',
    2513                                       sDirectory = 'C:\\Windows', fMode = 0o700),
    2514                   tdTestResult(fRc = False) ],
    2515                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'xxx',
    2516                                       sDirectory = 'C:\\Windows', fMode = 0o700),
    2517                   tdTestResult(fRc = False) ],
     2398                [ tdTestDirCreateTemp(sDirectory = ''), tdTestResult() ],
     2399                [ tdTestDirCreateTemp(sDirectory = 'C:\\Windows', fMode = 1234), tdTestResult() ],
     2400                [ tdTestDirCreateTemp(sTemplate = '', sDirectory = 'C:\\Windows', fMode = 1234), tdTestResult() ],
     2401                [ tdTestDirCreateTemp(sTemplate = 'xXx', sDirectory = 'C:\\Windows', fMode = 0o700), tdTestResult() ],
     2402                [ tdTestDirCreateTemp(sTemplate = 'xxx', sDirectory = 'C:\\Windows', fMode = 0o700), tdTestResult() ],
    25182403                # More unusual stuff.
    2519                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'foo',
    2520                                       sDirectory = 'z:\\'),
    2521                   tdTestResult(fRc = False) ],
    2522                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'foo',
    2523                                       sDirectory = '\\\\uncrulez\\foo'),
    2524                   tdTestResult(fRc = False) ],
     2404                [ tdTestDirCreateTemp(sTemplate = 'foo', sDirectory = 'z:\\'), tdTestResult() ],
     2405                [ tdTestDirCreateTemp(sTemplate = 'foo', sDirectory = '\\\\uncrulez\\foo'), tdTestResult() ],
    25252406                # Non-existing stuff.
    2526                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'bar',
    2527                                       sDirectory = 'c:\\Apps\\nonexisting\\foo'),
    2528                   tdTestResult(fRc = False) ],
     2407                [ tdTestDirCreateTemp(sTemplate = 'bar', sDirectory = 'c:\\Apps\\nonexisting\\foo'), tdTestResult() ],
    25292408                # FIXME: Failing test. Non Windows path
    2530                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'bar',
    2531                 #                       sDirectory = '/tmp/non/existing'),
    2532                 #   tdTestResult(fRc = False) ]
     2409                # [ tdTestDirCreateTemp(sTemplate = 'bar', sDirectory = '/tmp/non/existing'), tdTestResult() ]
    25332410            ]);
    25342411        elif oTestVm.isLinux():
    25352412            aaTests.extend([
    25362413                # Invalid stuff.
    2537                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sDirectory = ''),
    2538                   tdTestResult(fRc = False) ],
    2539                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sDirectory = '/etc',
    2540                                       fMode = 1234),
    2541                   tdTestResult(fRc = False) ],
    2542                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = '',
    2543                                       sDirectory = '/etc', fMode = 1234),
    2544                   tdTestResult(fRc = False) ],
    2545                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'xXx',
    2546                                       sDirectory = '/etc', fMode = 0o700),
    2547                   tdTestResult(fRc = False) ],
    2548                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'xxx',
    2549                                       sDirectory = '/etc', fMode = 0o700),
    2550                   tdTestResult(fRc = False) ],
     2414                [ tdTestDirCreateTemp(sDirectory = ''), tdTestResult() ],
     2415                [ tdTestDirCreateTemp(sDirectory = '/etc', fMode = 1234) ],
     2416                [ tdTestDirCreateTemp(sTemplate = '', sDirectory = '/etc', fMode = 1234), tdTestResult() ],
     2417                [ tdTestDirCreateTemp(sTemplate = 'xXx', sDirectory = '/etc', fMode = 0o700), tdTestResult() ],
     2418                [ tdTestDirCreateTemp(sTemplate = 'xxx', sDirectory = '/etc', fMode = 0o700), tdTestResult() ],
    25512419                # More unusual stuff.
    2552                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'foo',
    2553                                       sDirectory = 'z:\\'),
    2554                   tdTestResult(fRc = False) ],
    2555                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'foo',
    2556                                       sDirectory = '\\\\uncrulez\\foo'),
    2557                   tdTestResult(fRc = False) ],
     2420                [ tdTestDirCreateTemp(sTemplate = 'foo', sDirectory = 'z:\\'), tdTestResult() ],
     2421                [ tdTestDirCreateTemp(sTemplate = 'foo', sDirectory = '\\\\uncrulez\\foo'), tdTestResult() ],
    25582422                # Non-existing stuff.
    2559                 [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'bar',
    2560                                       sDirectory = '/non/existing'),
    2561                   tdTestResult(fRc = False) ]
     2423                [ tdTestDirCreateTemp(sTemplate = 'bar', sDirectory = '/non/existing'), tdTestResult() ],
    25622424            ]);
    25632425
     
    25652427            # aaTests.extend([
    25662428                # Non-secure variants.
    2567                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2429                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    25682430                #                       sDirectory = sScratch),
    25692431                #   tdTestResult(fRc = True) ],
    2570                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2432                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    25712433                #                       sDirectory = sScratch),
    25722434                #   tdTestResult(fRc = True) ],
    2573                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'X',
     2435                # [ tdTestDirCreateTemp(sTemplate = 'X',
    25742436                #                       sDirectory = sScratch),
    25752437                #   tdTestResult(fRc = True) ],
    2576                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'X',
     2438                # [ tdTestDirCreateTemp(sTemplate = 'X',
    25772439                #                       sDirectory = sScratch),
    25782440                #   tdTestResult(fRc = True) ],
    2579                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2441                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    25802442                #                       sDirectory = sScratch,
    25812443                #                       fMode = 0o700),
    25822444                #   tdTestResult(fRc = True) ],
    2583                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2445                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    25842446                #                     sDirectory = sScratch,
    25852447                #                     fMode = 0o700),
    25862448                #   tdTestResult(fRc = True) ],
    2587                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2449                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    25882450                #                       sDirectory = sScratch,
    25892451                #                       fMode = 0o755),
    25902452                #   tdTestResult(fRc = True) ],
    2591                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2453                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    25922454                #                       sDirectory = sScratch,
    25932455                #                       fMode = 0o755),
    25942456                #   tdTestResult(fRc = True) ],
    25952457                # Secure variants.
    2596                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2458                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    25972459                #                       sDirectory = sScratch, fSecure = True),
    25982460                #   tdTestResult(fRc = True) ],
    2599                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2461                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    26002462                #                       sDirectory = sScratch, fSecure = True),
    26012463                #   tdTestResult(fRc = True) ],
    2602                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2464                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    26032465                #                       sDirectory = sScratch, fSecure = True),
    26042466                #   tdTestResult(fRc = True) ],
    2605                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2467                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    26062468                #                       sDirectory = sScratch, fSecure = True),
    26072469                #   tdTestResult(fRc = True) ],
    2608                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2470                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    26092471                #                       sDirectory = sScratch,
    26102472                #                       fSecure = True, fMode = 0o700),
    26112473                #   tdTestResult(fRc = True) ],
    2612                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2474                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    26132475                #                       sDirectory = sScratch,
    26142476                #                       fSecure = True, fMode = 0o700),
    26152477                #   tdTestResult(fRc = True) ],
    2616                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2478                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    26172479                #                       sDirectory = sScratch,
    26182480                #                       fSecure = True, fMode = 0o755),
    26192481                #   tdTestResult(fRc = True) ],
    2620                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = 'XXX',
     2482                # [ tdTestDirCreateTemp(sTemplate = 'XXX',
    26212483                #                       sDirectory = sScratch,
    26222484                #                       fSecure = True, fMode = 0o755),
    26232485                #   tdTestResult(fRc = True) ],
    26242486                # Random stuff.
    2625                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword,
     2487                # [ tdTestDirCreateTemp(
    26262488                #                       sTemplate = "XXX-".join(random.choice(string.ascii_lowercase) for i in range(32)),
    26272489                #                       sDirectory = sScratch,
    26282490                #                       fSecure = True, fMode = 0o755),
    26292491                #   tdTestResult(fRc = True) ],
    2630                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = "".join('X' for i in range(32)),
     2492                # [ tdTestDirCreateTemp(sTemplate = "".join('X' for i in range(32)),
    26312493                #                       sDirectory = sScratch,
    26322494                #                       fSecure = True, fMode = 0o755),
    26332495                #   tdTestResult(fRc = True) ],
    2634                 # [ tdTestDirCreateTemp(sUser = sUser, sPassword = sPassword, sTemplate = "".join('X' for i in range(128)),
     2496                # [ tdTestDirCreateTemp(sTemplate = "".join('X' for i in range(128)),
    26352497                #                       sDirectory = sScratch,
    26362498                #                       fSecure = True, fMode = 0o755),
     
    26782540        """
    26792541
    2680         if oTestVm.isWindows():
    2681             sUser = "Administrator";
    2682         else:
    2683             sUser = "vbox";
    2684         sPassword = "password";
    2685 
    26862542        aaTests = [];
    26872543        if oTestVm.isWindows():
    26882544            aaTests.extend([
    26892545                # Invalid stuff.
    2690                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = ''),
    2691                   tdTestResultDirRead(fRc = False) ],
    2692                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = 'C:\\Windows', aFlags = [ 1234 ]),
    2693                   tdTestResultDirRead(fRc = False) ],
    2694                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = 'C:\\Windows', sFilter = '*.foo'),
    2695                   tdTestResultDirRead(fRc = False) ],
     2546                [ tdTestDirRead(sDirectory = ''), tdTestResultDirRead(fRc = False) ],
     2547                [ tdTestDirRead(sDirectory = 'C:\\Windows', aFlags = [ 1234 ]), tdTestResultDirRead() ],
     2548                [ tdTestDirRead(sDirectory = 'C:\\Windows', sFilter = '*.foo'), tdTestResultDirRead() ],
    26962549                # More unusual stuff.
    2697                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = 'z:\\'),
    2698                   tdTestResultDirRead(fRc = False) ],
    2699                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = '\\\\uncrulez\\foo'),
    2700                   tdTestResultDirRead(fRc = False) ],
     2550                [ tdTestDirRead(sDirectory = 'z:\\'), tdTestResultDirRead() ],
     2551                [ tdTestDirRead(sDirectory = '\\\\uncrulez\\foo'), tdTestResultDirRead() ],
    27012552                # Non-existing stuff.
    2702                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = 'c:\\Apps\\nonexisting'),
    2703                   tdTestResultDirRead(fRc = False) ],
    2704                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = 'c:\\Apps\\testDirRead'),
    2705                   tdTestResultDirRead(fRc = False) ]
     2553                [ tdTestDirRead(sDirectory = 'c:\\Apps\\nonexisting'), tdTestResultDirRead() ],
     2554                [ tdTestDirRead(sDirectory = 'c:\\Apps\\testDirRead'), tdTestResultDirRead() ]
    27062555            ]);
    27072556
     
    27092558                aaTests.extend([
    27102559                    # Reading directories.
    2711                     [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = '../../Windows/Media'),
     2560                    [ tdTestDirRead(sDirectory = '../../Windows/Media'),
    27122561                      tdTestResultDirRead(fRc = True, numFiles = 38) ],
    2713                     [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = 'c:\\Windows\\Help'),
     2562                    [ tdTestDirRead(sDirectory = 'c:\\Windows\\Help'),
    27142563                      tdTestResultDirRead(fRc = True, numDirs = 13, numFiles = 574) ],
    2715                     [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = 'c:\\Windows\\Web'),
     2564                    [ tdTestDirRead(sDirectory = 'c:\\Windows\\Web'),
    27162565                      tdTestResultDirRead(fRc = True, numDirs = 3, numFiles = 49) ]
    27172566                ]);
     
    27192568            aaTests.extend([
    27202569                # Invalid stuff.
    2721                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = ''),
    2722                   tdTestResultDirRead(fRc = False) ],
    2723                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = '/etc', aFlags = [ 1234 ]),
    2724                   tdTestResultDirRead(fRc = False) ],
    2725                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = '/etc', sFilter = '*.foo'),
    2726                   tdTestResultDirRead(fRc = False) ],
     2570                [ tdTestDirRead(sDirectory = ''), tdTestResultDirRead() ],
     2571                [ tdTestDirRead(sDirectory = '/etc', aFlags = [ 1234 ]), tdTestResultDirRead() ],
     2572                [ tdTestDirRead(sDirectory = '/etc', sFilter = '*.foo'), tdTestResultDirRead() ],
    27272573                # More unusual stuff.
    2728                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = 'z:/'),
    2729                   tdTestResultDirRead(fRc = False) ],
    2730                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = '\\\\uncrulez\\foo'),
    2731                   tdTestResultDirRead(fRc = False) ],
     2574                [ tdTestDirRead(sDirectory = 'z:/'), tdTestResultDirRead() ],
     2575                [ tdTestDirRead(sDirectory = '\\\\uncrulez\\foo'), tdTestResultDirRead() ],
    27322576                # Non-existing stuff.
    2733                 [ tdTestDirRead(sUser = sUser, sPassword = sPassword, sDirectory = '/etc/non/existing'),
    2734                   tdTestResultDirRead(fRc = False) ]
     2577                [ tdTestDirRead(sDirectory = '/etc/non/existing'), tdTestResultDirRead() ]
    27352578            ]);
    27362579
     
    27682611
    27692612        if oTestVm.isWindows():
    2770             sUser = "Administrator";
    27712613            sFileToDelete = "c:\\Windows\\Media\\chord.wav";
    27722614        else:
    2773             sUser = "vbox";
    27742615            sFileToDelete = "/home/vbox/.profile";
    2775         sPassword = "password";
    27762616
    27772617        aaTests = [];
     
    27792619            aaTests.extend([
    27802620                # Invalid stuff.
    2781                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = ''),
    2782                   tdTestResult(fRc = False) ],
    2783                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows'),
    2784                   tdTestResult(fRc = False) ],
     2621                [ tdTestFileRemove(sFile = ''), tdTestResult() ],
     2622                [ tdTestFileRemove(sFile = 'C:\\Windows'), tdTestResult() ],
    27852623                # More unusual stuff.
    2786                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'z:\\'),
    2787                   tdTestResult(fRc = False) ],
    2788                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = '\\\\uncrulez\\foo'),
    2789                   tdTestResult(fRc = False) ],
     2624                [ tdTestFileRemove(sFile = 'z:\\'), tdTestResult() ],
     2625                [ tdTestFileRemove(sFile = '\\\\uncrulez\\foo'), tdTestResult() ],
    27902626                # Non-existing stuff.
    2791                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Apps\\nonexisting'),
    2792                   tdTestResult(fRc = False) ],
     2627                [ tdTestFileRemove(sFile = 'c:\\Apps\\nonexisting'), tdTestResult() ],
    27932628                # Try to delete system files.
    2794                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'c:\\pagefile.sys'),
    2795                   tdTestResult(fRc = False) ],
    2796                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Windows\\kernel32.sys'),
    2797                   tdTestResult(fRc = False) ]
     2629                [ tdTestFileRemove(sFile = 'c:\\pagefile.sys'), tdTestResult() ],
     2630                [ tdTestFileRemove(sFile = 'c:\\Windows\\kernel32.sys'), tdTestResult() ]
    27982631            ]);
    27992632
     
    28012634                aaTests.extend([
    28022635                    # Try delete some unimportant media stuff.
    2803                     [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Windows\\Media\\chimes.wav'),
    2804                       tdTestResult(fRc = True) ],
     2636                    [ tdTestFileRemove(sFile = 'c:\\Windows\\Media\\chimes.wav'), tdTestResult(fRc = True) ],
    28052637                    # Second attempt should fail.
    2806                     [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Windows\\Media\\chimes.wav'),
    2807                       tdTestResult(fRc = False) ]
     2638                    [ tdTestFileRemove(sFile = 'c:\\Windows\\Media\\chimes.wav'), tdTestResult() ]
    28082639                ]);
    28092640        elif oTestVm.isLinux():
    28102641            aaTests.extend([
    28112642                # Invalid stuff.
    2812                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = ''),
    2813                   tdTestResult(fRc = False) ],
    2814                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows'),
    2815                   tdTestResult(fRc = False) ],
     2643                [ tdTestFileRemove(sFile = ''), tdTestResult() ],
     2644                [ tdTestFileRemove(sFile = 'C:\\Windows'), tdTestResult() ],
    28162645                # More unusual stuff.
    2817                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = 'z:/'),
    2818                   tdTestResult(fRc = False) ],
    2819                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = '//uncrulez/foo'),
    2820                   tdTestResult(fRc = False) ],
     2646                [ tdTestFileRemove(sFile = 'z:/'), tdTestResult() ],
     2647                [ tdTestFileRemove(sFile = '//uncrulez/foo'), tdTestResult() ],
    28212648                # Non-existing stuff.
    2822                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = '/non/existing'),
    2823                   tdTestResult(fRc = False) ],
     2649                [ tdTestFileRemove(sFile = '/non/existing'), tdTestResult() ],
    28242650                # Try to delete system files.
    2825                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = '/etc'),
    2826                   tdTestResult(fRc = False) ],
    2827                 [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = '/bin/sh'),
    2828                   tdTestResult(fRc = False) ]
     2651                [ tdTestFileRemove(sFile = '/etc'), tdTestResult() ],
     2652                [ tdTestFileRemove(sFile = '/bin/sh'), tdTestResult() ]
    28292653            ]);
    28302654
    28312655        aaTests.extend([
    28322656            # Try delete some unimportant stuff.
    2833             [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = sFileToDelete),
    2834                 tdTestResult(fRc = True) ],
     2657            [ tdTestFileRemove(sFile = sFileToDelete), tdTestResult(fRc = True) ],
    28352658            # Second attempt should fail.
    2836             [ tdTestFileRemove(sUser = sUser, sPassword = sPassword, sFile = sFileToDelete),
    2837                 tdTestResult(fRc = False) ]
     2659            [ tdTestFileRemove(sFile = sFileToDelete), tdTestResult() ]
    28382660        ]);
    28392661
     
    29532775        """
    29542776
    2955         if oTestVm.isWindows():
    2956             sUser = "Administrator";
    2957         else:
    2958             sUser = "vbox";
    2959         sPassword = "password";
    2960 
    29612777        if oTxsSession.syncMkDir('${SCRATCH}/testGuestCtrlFileRead') is False:
    29622778            reporter.error('Could not create scratch directory on guest');
     
    29662782        aaTests.extend([
    29672783            # Invalid stuff.
    2968             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, cbToReadWrite = 0),
    2969               tdTestResultFileReadWrite(fRc = False) ],
    2970             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = ''),
    2971               tdTestResultFileReadWrite(fRc = False) ],
    2972             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'non-existing.file'),
    2973               tdTestResultFileReadWrite(fRc = False) ],
     2784            [ tdTestFileReadWrite(cbToReadWrite = 0), tdTestResultFileReadWrite() ],
     2785            [ tdTestFileReadWrite(sFile = ''), tdTestResultFileReadWrite() ],
     2786            [ tdTestFileReadWrite(sFile = 'non-existing.file'), tdTestResultFileReadWrite() ],
    29742787            # Wrong open mode.
    2975             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'non-existing.file', \
    2976                                   sOpenMode = 'rt', sDisposition = 'oe'),
    2977               tdTestResultFileReadWrite(fRc = False) ],
    2978             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '\\\\uncrulez\\non-existing.file', \
    2979                                   sOpenMode = 'tr', sDisposition = 'oe'),
    2980               tdTestResultFileReadWrite(fRc = False) ],
    2981             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '../../non-existing.file', \
    2982                                   sOpenMode = 'wr', sDisposition = 'oe'),
    2983               tdTestResultFileReadWrite(fRc = False) ],
     2788            [ tdTestFileReadWrite(sFile = 'non-existing.file', sOpenMode = 'rt', sDisposition = 'oe'),
     2789              tdTestResultFileReadWrite() ],
     2790            [ tdTestFileReadWrite(sFile = '\\\\uncrulez\\non-existing.file', sOpenMode = 'tr', sDisposition = 'oe'),
     2791              tdTestResultFileReadWrite() ],
     2792            [ tdTestFileReadWrite(sFile = '../../non-existing.file', sOpenMode = 'wr', sDisposition = 'oe'),
     2793              tdTestResultFileReadWrite() ],
    29842794            # Wrong disposition.
    2985             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'non-existing.file', \
    2986                                   sOpenMode = 'r', sDisposition = 'e'),
    2987               tdTestResultFileReadWrite(fRc = False) ],
    2988             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '\\\\uncrulez\\non-existing.file', \
    2989                                   sOpenMode = 'r', sDisposition = 'o'),
    2990               tdTestResultFileReadWrite(fRc = False) ],
    2991             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '../../non-existing.file', \
    2992                                   sOpenMode = 'r', sDisposition = 'c'),
    2993               tdTestResultFileReadWrite(fRc = False) ],
     2795            [ tdTestFileReadWrite(sFile = 'non-existing.file', sOpenMode = 'r', sDisposition = 'e'),
     2796              tdTestResultFileReadWrite() ],
     2797            [ tdTestFileReadWrite(sFile = '\\\\uncrulez\\non-existing.file', sOpenMode = 'r', sDisposition = 'o'),
     2798              tdTestResultFileReadWrite() ],
     2799            [ tdTestFileReadWrite(sFile = '../../non-existing.file', sOpenMode = 'r', sDisposition = 'c'),
     2800              tdTestResultFileReadWrite() ],
    29942801            # Opening non-existing file when it should exist.
    2995             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'non-existing.file', \
    2996                                   sOpenMode = 'r', sDisposition = 'oe'),
    2997               tdTestResultFileReadWrite(fRc = False) ],
    2998             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '\\\\uncrulez\\non-existing.file', \
    2999                                   sOpenMode = 'r', sDisposition = 'oe'),
    3000               tdTestResultFileReadWrite(fRc = False) ],
    3001             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '../../non-existing.file', \
    3002                                   sOpenMode = 'r', sDisposition = 'oe'),
    3003               tdTestResultFileReadWrite(fRc = False) ]
     2802            [ tdTestFileReadWrite(sFile = 'non-existing.file', sOpenMode = 'r', sDisposition = 'oe'),
     2803              tdTestResultFileReadWrite() ],
     2804            [ tdTestFileReadWrite(sFile = '\\\\uncrulez\\non-existing.file', sOpenMode = 'r', sDisposition = 'oe'),
     2805              tdTestResultFileReadWrite() ],
     2806            [ tdTestFileReadWrite(sFile = '../../non-existing.file', sOpenMode = 'r', sDisposition = 'oe'),
     2807              tdTestResultFileReadWrite() ]
    30042808        ]);
    30052809
     
    30072811            aaTests.extend([
    30082812                # Create a file which must not exist (but it hopefully does).
    3009                 [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows\\System32\\calc.exe', \
    3010                                       sOpenMode = 'w', sDisposition = 'ce'),
    3011                   tdTestResultFileReadWrite(fRc = False) ],
     2813                [ tdTestFileReadWrite(sFile = 'C:\\Windows\\System32\\calc.exe', sOpenMode = 'w', sDisposition = 'ce'),
     2814                  tdTestResultFileReadWrite() ],
    30122815                # Open a file which must exist.
    3013                 [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows\\System32\\kernel32.dll', \
    3014                                       sOpenMode = 'r', sDisposition = 'oe'),
     2816                [ tdTestFileReadWrite(sFile = 'C:\\Windows\\System32\\kernel32.dll', sOpenMode = 'r', sDisposition = 'oe'),
    30152817                  tdTestResultFileReadWrite(fRc = True) ],
    30162818                # Try truncating a file which already is opened with a different sharing mode (and thus should fail).
    3017                 [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows\\System32\\kernel32.dll', \
    3018                                       sOpenMode = 'w', sDisposition = 'ot'),
    3019                   tdTestResultFileReadWrite(fRc = False) ]
     2819                [ tdTestFileReadWrite(sFile = 'C:\\Windows\\System32\\kernel32.dll', sOpenMode = 'w', sDisposition = 'ot'),
     2820                  tdTestResultFileReadWrite() ]
    30202821            ]);
    30212822
     
    30242825                aaTests.extend([
    30252826                    # Reading from beginning.
    3026                     [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows\\System32\\eula.txt',
     2827                    [ tdTestFileReadWrite(sFile = 'C:\\Windows\\System32\\eula.txt',
    30272828                                        sOpenMode = 'r', sDisposition = 'oe', cbToReadWrite = 33),
    30282829                      tdTestResultFileReadWrite(fRc = True, aBuf = 'Microsoft(r) Windows(r) XP Profes',
    30292830                                                cbProcessed = 33, cbOffset = 33) ],
    30302831                    # Reading from offset.
    3031                     [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows\\System32\\eula.txt',
     2832                    [ tdTestFileReadWrite(sFile = 'C:\\Windows\\System32\\eula.txt',
    30322833                                        sOpenMode = 'r', sDisposition = 'oe', cbOffset = 17769, cbToReadWrite = 31),
    30332834                      tdTestResultFileReadWrite(fRc = True, aBuf = 'only with the HARDWARE. If\x0d\x0a   ',
     
    30372838            aaTests.extend([
    30382839                # Create a file which must not exist (but it hopefully does).
    3039                 [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '/etc/issue', \
    3040                                       sOpenMode = 'w', sDisposition = 'ce'),
    3041                   tdTestResultFileReadWrite(fRc = False) ],
     2840                [ tdTestFileReadWrite(sFile = '/etc/issue', sOpenMode = 'w', sDisposition = 'ce'),
     2841                  tdTestResultFileReadWrite() ],
    30422842                # Open a file which must exist.
    3043                 [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '/etc/issue', \
    3044                                       sOpenMode = 'r', sDisposition = 'oe'),
     2843                [ tdTestFileReadWrite(sFile = '/etc/issue', sOpenMode = 'r', sDisposition = 'oe'),
    30452844                  tdTestResultFileReadWrite(fRc = True) ],
    30462845                # Try truncating a file which already is opened with a different sharing mode (and thus should fail).
    3047                 [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = '/etc/issue', \
    3048                                       sOpenMode = 'w', sDisposition = 'ot'),
    3049                   tdTestResultFileReadWrite(fRc = False) ]
     2846                [ tdTestFileReadWrite(sFile = '/etc/issue', sOpenMode = 'w', sDisposition = 'ot'),
     2847                  tdTestResultFileReadWrite() ]
    30502848            ]);
    30512849
     
    31302928
    31312929        if oTestVm.isWindows():
    3132             sUser = "Administrator";
    3133         else:
    3134             sUser = "vbox";
    3135         sPassword = "password";
    3136 
    3137         if oTestVm.isWindows():
    31382930            sScratch = "C:\\Temp\\vboxtest\\testGuestCtrlFileWrite\\";
    31392931        else:
     
    31502942        aaTests.extend([
    31512943            # Write to a non-existing file.
    3152             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = sScratch + 'testGuestCtrlFileWrite.txt',
     2944            [ tdTestFileReadWrite(sFile = sScratch + 'testGuestCtrlFileWrite.txt',
    31532945                                  sOpenMode = 'w+', sDisposition = 'ce', cbToReadWrite = cScratchBuf,
    31542946                                  aBuf = aScratchBuf),
     
    31602952        aaTests.extend([
    31612953            # Append the same amount of data to the just created file.
    3162             [ tdTestFileReadWrite(sUser = sUser, sPassword = sPassword, sFile = sScratch + 'testGuestCtrlFileWrite.txt',
     2954            [ tdTestFileReadWrite(sFile = sScratch + 'testGuestCtrlFileWrite.txt',
    31632955                                  sOpenMode = 'w+', sDisposition = 'oa', cbToReadWrite = cScratchBuf,
    31642956                                  cbOffset = cScratchBuf, aBuf = aScratchBuf2),
     
    32803072
    32813073        if oTestVm.isWindows():
    3282             sUser = "Administrator";
    32833074            sScratchGst = "C:\\Temp\\vboxtest\\testGuestCtrlCopyTo\\";
    32843075            sScratchGstNotExist = "C:\\does-not-exist\\";
    32853076            sScratchGstInvalid = "?*|invalid-name?*|";
    32863077        else:
    3287             sUser = "vbox";
    32883078            sScratchGst = "/tmp/"; ## @todo Use "${SCRATCH}/testGuestCtrlCopyTo" as soon as TXS CHMOD is implemented.
    32893079            sScratchGstNotExist = "/tmp/does-not-exist/";
    32903080            sScratchGstInvalid = "/";
    3291         sPassword = "password";
    32923081
    32933082        if oTxsSession.syncMkDir('${SCRATCH}/testGuestCtrlCopyTo') is False:
     
    33123101        aaTests.extend([
    33133102            # Destination missing.
    3314             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = ''),
    3315                 tdTestResult(fRc = False) ],
    3316             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = '/placeholder',
    3317                             aFlags = [ 80 ] ),
    3318                 tdTestResult(fRc = False) ],
     3103            [ tdTestCopyTo(sSrc = ''), tdTestResult() ],
     3104            [ tdTestCopyTo(sSrc = '/placeholder', aFlags = [ 80 ] ), tdTestResult() ],
    33193105            # Source missing.
    3320             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sDst = ''),
    3321                 tdTestResult(fRc = False) ],
    3322             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sDst = '/placeholder',
    3323                             aFlags = [ 80 ] ),
    3324                 tdTestResult(fRc = False) ],
     3106            [ tdTestCopyTo(sDst = ''), tdTestResult() ],
     3107            [ tdTestCopyTo(sDst = '/placeholder', aFlags = [ 80 ] ), tdTestResult() ],
    33253108            # Testing DirectoryCopyFlag flags.
    3326             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3327                             sDst = sScratchGstInvalid, aFlags = [ 80 ] ),
    3328                 tdTestResult(fRc = False) ],
     3109            [ tdTestCopyTo(sSrc = sTestFileBig, sDst = sScratchGstInvalid, aFlags = [ 80 ] ), tdTestResult() ],
    33293110            # Testing FileCopyFlag flags.
    3330             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3331                             sDst = sScratchGstInvalid, aFlags = [ 80 ] ),
    3332                 tdTestResult(fRc = False) ],
     3111            [ tdTestCopyTo(sSrc = sTestFileBig, sDst = sScratchGstInvalid, aFlags = [ 80 ] ), tdTestResult() ],
    33333112            # Nothing to copy (source and/or destination is empty).
    3334             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = 'z:\\'),
    3335                 tdTestResult(fRc = False) ],
    3336             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = '\\\\uncrulez\\foo'),
    3337                 tdTestResult(fRc = False) ],
    3338             [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = 'non-exist',
    3339                             sDst = os.path.join(sScratchGst, 'non-exist.dll')),
    3340                 tdTestResult(fRc = False) ]
     3113            [ tdTestCopyTo(sSrc = 'z:\\'), tdTestResult() ],
     3114            [ tdTestCopyTo(sSrc = '\\\\uncrulez\\foo'), tdTestResult() ],
     3115            [ tdTestCopyTo(sSrc = 'non-exist', sDst = os.path.join(sScratchGst, 'non-exist.dll')), tdTestResult() ]
    33413116        ]);
    33423117
     
    33463121        if self.oTstDrv.fpApiVer > 5.2:
    33473122            aaTests.extend([
    3348                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3349                                 sDst = sScratchGstInvalid),
    3350                   tdTestResult(fRc = False) ],
    3351                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3352                                 sDst = sScratchGstNotExist),
    3353                   tdTestResult(fRc = False) ],
    3354                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3355                                 sDst = sScratchGstNotExist),
    3356                   tdTestResult(fRc = False) ],
    3357                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3358                                 sDst = os.path.join(sScratchGstNotExist, 'renamedfile.dll')),
    3359                   tdTestResult(fRc = False) ],
    3360                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3361                                 sDst = os.path.join(sScratchGst, 'HostGABig.dat')),
     3123                [ tdTestCopyTo(sSrc = sTestFileBig, sDst = sScratchGstInvalid), tdTestResult() ],
     3124                [ tdTestCopyTo(sSrc = sTestFileBig, sDst = sScratchGstNotExist), tdTestResult() ],
     3125                [ tdTestCopyTo(sSrc = sTestFileBig, sDst = sScratchGstNotExist), tdTestResult() ],
     3126                [ tdTestCopyTo(sSrc = sTestFileBig, sDst = os.path.join(sScratchGstNotExist, 'renamedfile.dll')),
     3127                  tdTestResult() ],
     3128                [ tdTestCopyTo(sSrc = sTestFileBig, sDst = os.path.join(sScratchGst, 'HostGABig.dat')),
    33623129                  tdTestResult(fRc = True) ],
    3363                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3364                                 sDst = os.path.join(sScratchGst, 'HostGABig.dat')),
     3130                [ tdTestCopyTo(sSrc = sTestFileBig, sDst = os.path.join(sScratchGst, 'HostGABig.dat')),
    33653131                  tdTestResult(fRc = True) ],
    33663132                # Note: Copying files into directories via Main is supported only in versions > 5.2.
    33673133                # Destination is a directory.
    3368                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3369                                 sDst = sScratchGst),
     3134                [ tdTestCopyTo(sSrc = sTestFileBig, sDst = sScratchGst),
    33703135                  tdTestResult(fRc = True) ],
    33713136                # Copy over file again into same directory (overwrite).
    3372                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3373                                 sDst = sScratchGst),
     3137                [ tdTestCopyTo(sSrc = sTestFileBig, sDst = sScratchGst),
    33743138                  tdTestResult(fRc = True) ]
    33753139            ]);
     
    33793143                    # Copy the same file over to the guest, but this time store the file into the former
    33803144                    # file's ADS (Alternate Data Stream). Only works on Windows, of course.
    3381                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    3382                                     sDst = os.path.join(sScratchGst, 'HostGABig.dat:ADS-Test')),
     3145                    [ tdTestCopyTo(sSrc = sTestFileBig, sDst = os.path.join(sScratchGst, 'HostGABig.dat:ADS-Test')),
    33833146                      tdTestResult(fRc = True) ]
    33843147                ]);
     
    33963159                        ## additionally it's not really clear if this fails reliably on all Windows versions, even
    33973160                        ## the old ones like XP with a "proper" administrator.
    3398                         #[ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = os.path.join(sSystemRoot, 'security'),
     3161                        #[ tdTestCopyTo(sSrc = os.path.join(sSystemRoot, 'security'),
    33993162                        #               sDst = sScratchGst, aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]),
    3400                         #  tdTestResult(fRc = False) ],
     3163                        #
    34013164                        # Copying directories with regular files.
    3402                         [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = os.path.join(sSystemRoot, 'Help'),
     3165                        [ tdTestCopyTo(sSrc = os.path.join(sSystemRoot, 'Help'),
    34033166                                       sDst = sScratchGst, aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]),
    34043167                          tdTestResult(fRc = True) ]
     
    34573220
    34583221        if oTestVm.isWindows():
    3459             sUser = "Administrator";
    34603222            sPathSep         = "\\";
    34613223            sSrcDirExisting  = "C:\\Windows\\Web";
    34623224            sSrcFileExisting = "C:\\Windows\\system32\\ole32.dll";
    34633225        else:
    3464             sUser = "vbox";
    34653226            sPathSep         = "/";
    34663227            sSrcDirExisting  = "/bin";
    34673228            sSrcFileExisting = "/etc/issue";
    3468         sPassword = "password";
    34693229
    34703230        sScratchHst = os.path.join(self.oTstDrv.sScratchPath, "testGctrlCopyFrom");
     
    34903250        aaTests.extend([
    34913251            # Destination missing.
    3492             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = ''),
    3493               tdTestResult(fRc = False) ],
    3494             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'Something',
    3495                              aFlags = [ 80 ] ),
    3496               tdTestResult(fRc = False) ],
     3252            [ tdTestCopyFrom(sSrc = ''), tdTestResult() ],
     3253            [ tdTestCopyFrom(sSrc = 'Something', aFlags = [ 80 ] ), tdTestResult() ],
    34973254            # Source missing.
    3498             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sDst = ''),
    3499               tdTestResult(fRc = False) ],
    3500             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sDst = 'Something',
    3501                              aFlags = [ 80 ] ),
    3502               tdTestResult(fRc = False) ],
     3255            [ tdTestCopyFrom(sDst = ''), tdTestResult() ],
     3256            [ tdTestCopyFrom(sDst = 'Something', aFlags = [ 80 ] ), tdTestResult() ],
    35033257            # Testing DirectoryCopyFlag flags.
    3504             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcDirExisting,
    3505                              sDst = sScratchHstInvalid, aFlags = [ 80 ] ),
    3506               tdTestResult(fRc = False) ],
     3258            [ tdTestCopyFrom(sSrc = sSrcDirExisting, sDst = sScratchHstInvalid, aFlags = [ 80 ] ), tdTestResult() ],
    35073259            # Testing FileCopyFlag flags.
    3508             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcFileExisting,
    3509                              sDst = sScratchHstInvalid, aFlags = [ 80 ] ),
    3510               tdTestResult(fRc = False) ],
     3260            [ tdTestCopyFrom(sSrc = sSrcFileExisting, sDst = sScratchHstInvalid, aFlags = [ 80 ] ), tdTestResult() ],
    35113261            # Nothing to copy (sDst is empty / unreachable).
    3512             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'z:\\'),
    3513               tdTestResult(fRc = False) ],
    3514             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = '\\\\uncrulez\\foo'),
    3515               tdTestResult(fRc = False) ],
    3516             [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = 'non-exist',
    3517                              sDst = os.path.join(sScratchHst, 'non-exist')),
    3518               tdTestResult(fRc = False) ]
     3262            [ tdTestCopyFrom(sSrc = 'z:\\'), tdTestResult() ],
     3263            [ tdTestCopyFrom(sSrc = '\\\\uncrulez\\foo'), tdTestResult() ],
     3264            [ tdTestCopyFrom(sSrc = 'non-exist', sDst = os.path.join(sScratchHst, 'non-exist')), tdTestResult() ]
    35193265        ]);
    35203266
     
    35263272            aaTests.extend([
    35273273                # Copying single files.
    3528                 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcFileExisting,
    3529                                     sDst = sScratchHstInvalid),
    3530                   tdTestResult(fRc = False) ],
    3531                 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcFileExisting,
    3532                                  sDst = os.path.join(sScratchHstInvalid, 'tstCopyFrom-renamedfile')),
    3533                   tdTestResult(fRc = False) ],
     3274                [ tdTestCopyFrom(sSrc = sSrcFileExisting, sDst = sScratchHstInvalid), tdTestResult() ],
     3275                [ tdTestCopyFrom(sSrc = sSrcFileExisting, sDst = os.path.join(sScratchHstInvalid, 'tstCopyFrom-renamedfile')),
     3276                  tdTestResult() ],
    35343277                # Copy over file using a different destination name.
    3535                 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcFileExisting,
    3536                                  sDst = os.path.join(sScratchHst, 'tstCopyFrom-renamedfile')),
     3278                [ tdTestCopyFrom(sSrc = sSrcFileExisting, sDst = os.path.join(sScratchHst, 'tstCopyFrom-renamedfile')),
    35373279                  tdTestResult(fRc = True) ],
    35383280                # Copy over same file (and overwrite existing one).
    3539                 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcFileExisting,
    3540                                  sDst = os.path.join(sScratchHst, 'tstCopyFrom-renamedfile')),
     3281                [ tdTestCopyFrom(sSrc = sSrcFileExisting, sDst = os.path.join(sScratchHst, 'tstCopyFrom-renamedfile')),
    35413282                  tdTestResult(fRc = True) ],
    35423283                # Note: Copying files into directories via Main is supported only in versions > 5.2.
    35433284                # Destination is a directory with a trailing slash (should work).
    35443285                # See "cp" syntax.
    3545                 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcFileExisting,
    3546                                  sDst = sScratchHst + "/"),
     3286                [ tdTestCopyFrom(sSrc = sSrcFileExisting, sDst = sScratchHst + "/"),
    35473287                  tdTestResult(fRc = True) ],
    35483288                # Destination is a directory (without a trailing slash, should also work).
    35493289                # See "cp" syntax.
    3550                 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcFileExisting,
    3551                                  sDst = sScratchHst),
     3290                [ tdTestCopyFrom(sSrc = sSrcFileExisting, sDst = sScratchHst),
    35523291                  tdTestResult(fRc = True) ],
    35533292                # Destination is a non-existing directory.
    3554                 [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcFileExisting,
    3555                                  sDst = sScratchHstNotExist),
    3556                   tdTestResult(fRc = False) ]
     3293                [ tdTestCopyFrom(sSrc = sSrcFileExisting, sDst = sScratchHstNotExist), tdTestResult() ]
    35573294            ]);
    35583295
     
    35643301                aaTests.extend([
    35653302                    # Copying entire directories (destination is "<sScratchHst>\Web").
    3566                     [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcDirExisting,
    3567                                      sDst = sScratchHst),
     3303                    [ tdTestCopyFrom(sSrc = sSrcDirExisting, sDst = sScratchHst),
    35683304                      tdTestResult(fRc = True) ],
    35693305                    # Repeat -- this time it should fail, as the destination directory already exists (and
    35703306                    # DirectoryCopyFlag_CopyIntoExisting is not specified).
    3571                     [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcDirExisting,
    3572                                      sDst = sScratchHst),
    3573                       tdTestResult(fRc = False) ],
     3307                    [ tdTestCopyFrom(sSrc = sSrcDirExisting, sDst = sScratchHst), tdTestResult() ],
    35743308                    # Next try with the DirectoryCopyFlag_CopyIntoExisting flag being set.
    3575                     [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcDirExisting,
    3576                                      sDst = sScratchHst, aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]),
     3309                    [ tdTestCopyFrom(sSrc = sSrcDirExisting, sDst = sScratchHst,
     3310                                     aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ] ),
    35773311                      tdTestResult(fRc = True) ],
    35783312                    # Ditto, with trailing slash.
    3579                     [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcDirExisting,
     3313                    [ tdTestCopyFrom(sSrc = sSrcDirExisting,
    35803314                                     sDst = sScratchHst + "/", aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]),
    35813315                      tdTestResult(fRc = True) ],
    35823316                    # Copying contents of directories into a non-existing directory chain on the host which fail.
    3583                     [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcDirExisting + sPathSep,
    3584                                      sDst = sScratchHstNotExistChain,
    3585                                      aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]),
    3586                       tdTestResult(fRc = False) ],
     3317                    [ tdTestCopyFrom(sSrc = sSrcDirExisting + sPathSep, sDst = sScratchHstNotExistChain,
     3318                                     aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]), tdTestResult() ],
    35873319                    # Copying contents of directories into a non-existing directory on the host, which should succeed.
    3588                     [ tdTestCopyFrom(sUser = sUser, sPassword = sPassword, sSrc = sSrcDirExisting + sPathSep,
    3589                                      sDst = sScratchHstNotExist,
    3590                                      aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ]),
     3320                    [ tdTestCopyFrom(sSrc = sSrcDirExisting + sPathSep, sDst = sScratchHstNotExist,
     3321                                     aFlags = [ vboxcon.DirectoryCopyFlag_CopyIntoExisting ] ),
    35913322                      tdTestResult(fRc = True) ]
    35923323                ]);
     
    36533384        """
    36543385
    3655         if oTestVm.isWindows():
    3656             sUser = "Administrator";
    3657         else:
    3658             sUser = "vbox";
    3659         sPassword = "password";
    3660 
    36613386        # Some stupid trickery to guess the location of the iso.
    36623387        sVBoxValidationKitISO = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../VBoxValidationKit.iso'));
     
    36923417            aaTests.extend([
    36933418                # Source is missing.
    3694                 [ tdTestUpdateAdditions(sUser = sUser, sPassword = sPassword, sSrc = ''),
    3695                   tdTestResult(fRc = False) ],
     3419                [ tdTestUpdateAdditions(sSrc = ''), tdTestResult() ],
     3420
    36963421                # Wrong aFlags.
    3697                 [ tdTestUpdateAdditions(sUser = sUser, sPassword = sPassword, sSrc = self.oTstDrv.getGuestAdditionsIso(),
    3698                                         aFlags = [ 1234 ]),
    3699                   tdTestResult(fRc = False) ],
     3422                [ tdTestUpdateAdditions(sSrc = self.oTstDrv.getGuestAdditionsIso(),
     3423                                        aFlags = [ 1234 ]), tdTestResult() ],
     3424
    37003425                # Non-existing .ISO.
    3701                 [ tdTestUpdateAdditions(sUser = sUser, sPassword = sPassword, sSrc = "non-existing.iso"),
    3702                   tdTestResult(fRc = False) ],
     3426                [ tdTestUpdateAdditions(sSrc = "non-existing.iso"), tdTestResult() ],
     3427
    37033428                # Wrong .ISO.
    3704                 [ tdTestUpdateAdditions(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO),
    3705                   tdTestResult(fRc = False) ],
     3429                [ tdTestUpdateAdditions(sSrc = sVBoxValidationKitISO), tdTestResult() ],
     3430
    37063431                # The real thing.
    3707                 [ tdTestUpdateAdditions(sUser = sUser, sPassword = sPassword, sSrc = self.oTstDrv.getGuestAdditionsIso()),
     3432                [ tdTestUpdateAdditions(sSrc = self.oTstDrv.getGuestAdditionsIso()),
    37083433                  tdTestResult(fRc = True) ],
    37093434                # Test the (optional) installer arguments. This will extract the
    37103435                # installer into our guest's scratch directory.
    3711                 [ tdTestUpdateAdditions(sUser = sUser, sPassword = sPassword, sSrc = self.oTstDrv.getGuestAdditionsIso(),
     3436                [ tdTestUpdateAdditions(sSrc = self.oTstDrv.getGuestAdditionsIso(),
    37123437                                        aArgs = [ '/extract', '/D=' + sScratch ]),
    37133438                  tdTestResult(fRc = True) ]
    37143439                # Some debg ISO. Only enable locally.
    3715                 #[ tdTestUpdateAdditions(sUser = sUser, sPassword = sPassword,
     3440                #[ tdTestUpdateAdditions(
    37163441                #                      sSrc = "V:\\Downloads\\VBoxGuestAdditions-r80354.iso"),
    37173442                #  tdTestResult(fRc = True) ]
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette