VirtualBox

Ignore:
Timestamp:
Apr 2, 2020 2:40:38 PM (5 years ago)
Author:
vboxsync
Message:

Guest Control/Validation Kit: Enabled more tests (IGuestSession::directoryOpen() API + trying to open directories on Linux as files). bugref:9320

File:
1 edited

Legend:

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

    r83344 r83511  
    17751775        cOthers  = 0;    # Other files.
    17761776
    1777         ##
    1778         ## @todo r=bird: Unlike fileOpen, directoryOpen will not fail if the directory does not exist.
    1779         ##       This is of course a bug in the implementation, as it is documented to return
    1780         ##       VBOX_E_OBJECT_NOT_FOUND or VBOX_E_IPRT_ERROR!
    1781         ##
    1782 
    17831777        # Open the directory:
    1784         #reporter.log2('Directory="%s", filter="%s", afFlags="%s"' % (sCurDir, sFilter, afFlags));
     1778        reporter.log2('Directory="%s", filter="%s", afFlags="%s"' % (sCurDir, sFilter, afFlags));
    17851779        try:
    17861780            oCurDir = oGuestSession.directoryOpen(sCurDir, sFilter, afFlags);
     
    17951789            except Exception as oXcpt:
    17961790                if vbox.ComError.notEqual(oXcpt, vbox.ComError.VBOX_E_OBJECT_NOT_FOUND):
    1797                     ##
    1798                     ## @todo r=bird: Change this to reporter.errorXcpt() once directoryOpen() starts
    1799                     ##       working the way it is documented.
    1800                     ##
    1801                     reporter.maybeErrXcpt(fIsError, 'Error reading directory "%s":' % (sCurDir,)); # See above why 'maybe'.
     1791                    reporter.errorXcpt('Error reading directory "%s":' % (sCurDir,));
    18021792                    fRc = False;
    1803                 #else: reporter.log2('\tNo more directory entries for "%s"' % (sCurDir,));
     1793                else:
     1794                    reporter.log2('\tNo more directory entries for "%s"' % (sCurDir,));
    18041795                break;
    18051796
     
    18161807                                         % (sName, eType, vboxcon.FsObjType_Directory));
    18171808            elif eType == vboxcon.FsObjType_Directory:
    1818                 #reporter.log2('  Directory "%s"' % oFsObjInfo.name);
     1809                reporter.log2('  Directory "%s"' % oFsObjInfo.name);
    18191810                aSubResult = self.gctrlReadDirTree(oTest, oGuestSession, fIsError,
    18201811                                                   oTestVm.pathJoin(sSubDir, sName) if sSubDir else sName);
     
    18241815                cOthers += aSubResult[3];
    18251816            elif eType is vboxcon.FsObjType_File:
    1826                 #reporter.log2('  File "%s"' % oFsObjInfo.name);
     1817                reporter.log2('  File "%s"' % oFsObjInfo.name);
    18271818                cFiles += 1;
    18281819            elif eType is vboxcon.FsObjType_Symlink:
    1829                  #reporter.log2('  Symlink "%s" -- not tested yet' % oFsObjInfo.name);
     1820                reporter.log2('  Symlink "%s" -- not tested yet' % oFsObjInfo.name);
    18301821                cOthers += 1;
    18311822            elif    oTestVm.isWindows() \
     
    37533744            [ tdTestFileOpen(sFile = oTestVm.pathJoin(sTempDir, 'no-such-dir', 'no-such-file')),        tdTestResultFailure() ],
    37543745        ];
    3755         if oTestVm.isWindows() or not self.fSkipKnownBugs: # We can open directories on linux, but we shouldn't, right...
    3756             atTests.extend([
    3757                 # Wrong type:
    3758                 [ tdTestFileOpen(sFile = self.getGuestTempDir(oTestVm)),                                tdTestResultFailure() ],
    3759                 [ tdTestFileOpen(sFile = self.getGuestSystemDir(oTestVm)),                              tdTestResultFailure() ],
    3760             ]);
     3746        atTests.extend([
     3747            # Wrong type:
     3748            [ tdTestFileOpen(sFile = self.getGuestTempDir(oTestVm)),                                tdTestResultFailure() ],
     3749            [ tdTestFileOpen(sFile = self.getGuestSystemDir(oTestVm)),                              tdTestResultFailure() ],
     3750        ]);
    37613751        atTests.extend([
    37623752            # O_EXCL and such:
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