VirtualBox

Changeset 79330 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Jun 25, 2019 2:53:44 PM (6 years ago)
Author:
vboxsync
Message:

ValKit/tdAddGuestCtrl.py: Cleanups. bugref:9320

File:
1 edited

Legend:

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

    r79328 r79330  
    109109          were installed and running on the guest to be tested.
    110110    """
    111     def __init__(self):
     111    def __init__(self, oCreds = None):
    112112        self.oGuest    = None;      ##< IGuest.
    113         self.oCreds    = None       ##< type: tdCtxCreds
     113        self.oCreds    = oCreds     ##< type: tdCtxCreds
    114114        self.timeoutMS = 30 * 1000; ##< 30s timeout
    115115        self.oGuestSession = None;  ##< IGuestSession reference or None.
     
    224224    Test for copying files from the guest to the host.
    225225    """
    226     def __init__(self, sSrc = "", sDst = "", sUser = None, sPassword = None, fFlags = None, oSrc = None):
    227         tdTestGuestCtrlBase.__init__(self);
    228         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     226    def __init__(self, sSrc = "", sDst = "", oCreds = None, fFlags = None, oSrc = None):
     227        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    229228        self.sSrc = sSrc;
    230229        self.sDst = sDst;
     
    236235class tdTestCopyFromDir(tdTestCopyFrom):
    237236
    238     def __init__(self, sSrc = "", sDst = "", sUser = None, sPassword = None, fFlags = None, oSrc = None, fIntoDst = False):
    239         tdTestCopyFrom.__init__(self, sSrc, sDst, sUser, sPassword, fFlags, oSrc);
     237    def __init__(self, sSrc = "", sDst = "", oCreds = None, fFlags = None, oSrc = None, fIntoDst = False):
     238        tdTestCopyFrom.__init__(self, sSrc, sDst, oCreds, fFlags, oSrc);
    240239        self.fIntoDst = fIntoDst; # hint to the verification code that sDst == oSrc, rather than sDst+oSrc.sNAme == oSrc.
    241240
     
    267266    Test for copying files from the host to the guest.
    268267    """
    269     def __init__(self, sSrc = "", sDst = "", sUser = None, sPassword = None, fFlags = None):
    270         tdTestGuestCtrlBase.__init__(self);
    271         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     268    def __init__(self, sSrc = "", sDst = "", oCreds = None, fFlags = None):
     269        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    272270        self.sSrc = sSrc;
    273271        self.sDst = sDst;
     
    284282    Test for directoryCreate call.
    285283    """
    286     def __init__(self, sDirectory = "", sUser = None, sPassword = None, fMode = 0, fFlags = None):
    287         tdTestGuestCtrlBase.__init__(self);
    288         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     284    def __init__(self, sDirectory = "", oCreds = None, fMode = 0, fFlags = None):
     285        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    289286        self.sDirectory = sDirectory;
    290287        self.fMode = fMode;
     
    295292    Test for the directoryCreateTemp call.
    296293    """
    297     def __init__(self, sDirectory = "", sTemplate = "", sUser = None, sPassword = None, fMode = 0, fSecure = False):
    298         tdTestGuestCtrlBase.__init__(self);
    299         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     294    def __init__(self, sDirectory = "", sTemplate = "", oCreds = None, fMode = 0, fSecure = False):
     295        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    300296        self.sDirectory = sDirectory;
    301297        self.sTemplate = sTemplate;
     
    307303    Test for the directoryOpen call.
    308304    """
    309     def __init__(self, sDirectory = "", sUser = None, sPassword = None, sFilter = "", fFlags = None):
    310         tdTestGuestCtrlBase.__init__(self);
    311         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     305    def __init__(self, sDirectory = "", oCreds = None, sFilter = "", fFlags = None):
     306        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    312307        self.sDirectory = sDirectory;
    313308        self.sFilter = sFilter;
     
    318313    Test for the opening, reading and closing a certain directory.
    319314    """
    320     def __init__(self, sDirectory = "", sUser = None, sPassword = None,
    321                  sFilter = "", fFlags = None):
    322         tdTestDirOpen.__init__(self, sDirectory, sUser, sPassword, sFilter, fFlags);
     315    def __init__(self, sDirectory = "", oCreds = None, sFilter = "", fFlags = None):
     316        tdTestDirOpen.__init__(self, sDirectory, oCreds, sFilter, fFlags);
    323317
    324318class tdTestExec(tdTestGuestCtrlBase):
     
    328322    """
    329323    def __init__(self, sCmd = "", asArgs = None, aEnv = None, fFlags = None,             # pylint: disable=too-many-arguments
    330                  timeoutMS = 5 * 60 * 1000, sUser = None, sPassword = None, sDomain = None, fWaitForExit = True):
    331         tdTestGuestCtrlBase.__init__(self);
    332         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain);
     324                 timeoutMS = 5 * 60 * 1000, oCreds = None, fWaitForExit = True):
     325        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    333326        self.sCmd = sCmd;
    334327        self.asArgs = asArgs if asArgs is not None else [sCmd,];
     
    347340    Test for the file exists API call (fileExists).
    348341    """
    349     def __init__(self, sFile = "", sUser = None, sPassword = None):
    350         tdTestGuestCtrlBase.__init__(self);
    351         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     342    def __init__(self, sFile = "", oCreds = None):
     343        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    352344        self.sFile = sFile;
    353345
     
    356348    Test querying guest file information.
    357349    """
    358     def __init__(self, sFile = "", sUser = None, sPassword = None):
    359         tdTestGuestCtrlBase.__init__(self);
    360         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     350    def __init__(self, sFile = "", oCreds = None):
     351        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    361352        self.sFile = sFile;
    362353
     
    365356    Removal base.
    366357    """
    367     def __init__(self, sPath, fRcExpect = True, sUser = None, sPassword = None):
    368         tdTestGuestCtrlBase.__init__(self);
    369         self.oCreds    = tdCtxCreds(sUser, sPassword, sDomain = None);
     358    def __init__(self, sPath, fRcExpect = True, oCreds = None):
     359        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    370360        self.sPath     = sPath;
    371361        self.fRcExpect = fRcExpect;
     
    392382    Remove a single file.
    393383    """
    394     def __init__(self, sPath, fRcExpect = True, sUser = None, sPassword = None):
    395         tdTestRemoveBase.__init__(self, sPath, fRcExpect, sUser, sPassword);
     384    def __init__(self, sPath, fRcExpect = True, oCreds = None):
     385        tdTestRemoveBase.__init__(self, sPath, fRcExpect, oCreds);
    396386
    397387    def execute(self, oSubTstDrv):
     
    414404    Remove a single directory if empty.
    415405    """
    416     def __init__(self, sPath, fRcExpect = True, sUser = None, sPassword = None):
    417         tdTestRemoveBase.__init__(self, sPath, fRcExpect, sUser, sPassword);
     406    def __init__(self, sPath, fRcExpect = True, oCreds = None):
     407        tdTestRemoveBase.__init__(self, sPath, fRcExpect, oCreds);
    418408
    419409    def execute(self, oSubTstDrv):
     
    434424    Recursively remove a directory tree.
    435425    """
    436     def __init__(self, sPath, afFlags = None, fRcExpect = True, fNotExist = False, sUser = None, sPassword = None):
    437         tdTestRemoveBase.__init__(self, sPath, fRcExpect, sUser, sPassword);
     426    def __init__(self, sPath, afFlags = None, fRcExpect = True, fNotExist = False, oCreds = None):
     427        tdTestRemoveBase.__init__(self, sPath, fRcExpect, oCreds = None);
    438428        self.afFlags = afFlags if afFlags is not None else [];
    439429        self.fNotExist = fNotExist; # Hack for the ContentOnly scenario where the dir does not exist.
     
    479469    Test querying guest file information.
    480470    """
    481     def __init__(self, sFile = "", sUser = None, sPassword = None, cbSize = 0, eFileType = 0):
    482         tdTestGuestCtrlBase.__init__(self);
    483         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     471    def __init__(self, sFile = "", oCreds = None, cbSize = 0, eFileType = 0):
     472        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    484473        self.sFile = sFile;
    485474        self.cbSize = cbSize;
     
    490479    Test for the IGuestFile object.
    491480    """
    492     def __init__(self, sFile = "", sUser = None, sPassword = None):
    493         tdTestGuestCtrlBase.__init__(self);
    494         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     481    def __init__(self, sFile = "", oCreds = None):
     482        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    495483        self.sFile = sFile;
    496484
     
    499487    Test for the file size query API call (fileQuerySize).
    500488    """
    501     def __init__(self, sFile = "", sUser = None, sPassword = None):
    502         tdTestGuestCtrlBase.__init__(self);
    503         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = None);
     489    def __init__(self, sFile = "", oCreds = None):
     490        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    504491        self.sFile = sFile;
    505492
     
    509496    """
    510497    def __init__(self, sFile = "", eAccessMode = None, eAction = None, eSharing = None,
    511                  fCreationMode = 0o660, sUser = None, sPassword = None):
    512         tdTestGuestCtrlBase.__init__(self);
    513         self.oCreds         = tdCtxCreds(sUser, sPassword, sDomain = None);
     498                 fCreationMode = 0o660, oCreds = None):
     499        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    514500        self.sFile          = sFile;
    515501        self.eAccessMode    = eAccessMode if eAccessMode is not None else vboxcon.FileAccessMode_ReadOnly;
     
    570556    """
    571557    def __init__(self, sFile = "", eAccessMode = None, eAction = None, eSharing = None,
    572                  fCreationMode = 0o660, cbOpenExpected = 0, sUser = None, sPassword = None):
    573         tdTestFileOpen.__init__(self, sFile, eAccessMode, eAction, eSharing, fCreationMode, sUser, sPassword);
     558                 fCreationMode = 0o660, cbOpenExpected = 0, oCreds = None):
     559        tdTestFileOpen.__init__(self, sFile, eAccessMode, eAction, eSharing, fCreationMode, oCreds);
    574560        self.cbOpenExpected = cbOpenExpected;
    575561
     
    624610    """
    625611    def __init__(self, sFile = "", eAccessMode = None, eAction = None, eSharing = None, # pylint: disable=too-many-arguments
    626                  fCreationMode = 0o660, atChunks = None, fUseAtApi = False, abContent = None, sUser = None, sPassword = None):
     612                 fCreationMode = 0o660, atChunks = None, fUseAtApi = False, abContent = None, oCreds = None):
    627613        tdTestFileOpen.__init__(self, sFile, eAccessMode if eAccessMode is not None else vboxcon.FileAccessMode_WriteOnly,
    628                                 eAction, eSharing, fCreationMode, sUser, sPassword);
     614                                eAction, eSharing, fCreationMode, oCreds);
    629615        assert atChunks is not None;
    630616        self.atChunks  = atChunks   # type: list(tuple(int,bytearray))
     
    767753    Opens the file and checks the content using the read API.
    768754    """
    769     def __init__(self, sFile = "", eSharing = None, abContent = None, cbContentExpected = None, sUser = None, sPassword = None):
    770         tdTestFileOpen.__init__(self, sFile = sFile, eSharing = eSharing, sUser = sUser, sPassword = sPassword);
     755    def __init__(self, sFile = "", eSharing = None, abContent = None, cbContentExpected = None, oCreds = None):
     756        tdTestFileOpen.__init__(self, sFile = sFile, eSharing = eSharing, oCreds = oCreds);
    771757        self.abContent = abContent  # type: bytearray
    772758        self.cbContentExpected = cbContentExpected;
     
    818804    """
    819805    def __init__(self, sUser = None, sPassword = None, sDomain = None, sSessionName = ""):
    820         tdTestGuestCtrlBase.__init__(self);
     806        tdTestGuestCtrlBase.__init__(self, oCreds = tdCtxCreds(sUser, sPassword, sDomain));
    821807        self.sSessionName = sSessionName;
    822         self.oCreds       = tdCtxCreds(sUser, sPassword, sDomain);
    823808
    824809    def getSessionCount(self, oVBoxMgr):
     
    12641249    Test updating the Guest Additions inside the guest.
    12651250    """
    1266     def __init__(self, sSrc = "", asArgs = None, fFlags = None,
    1267                  sUser = None, sPassword = None, sDomain = None):
    1268         tdTestGuestCtrlBase.__init__(self);
    1269         self.oCreds = tdCtxCreds(sUser, sPassword, sDomain);
     1251    def __init__(self, sSrc = "", asArgs = None, fFlags = None, oCreds = None):
     1252        tdTestGuestCtrlBase.__init__(self, oCreds = oCreds);
    12701253        self.sSrc = sSrc;
    12711254        self.asArgs = asArgs;
Note: See TracChangeset for help on using the changeset viewer.

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