VirtualBox

Ignore:
Timestamp:
Oct 25, 2022 7:13:52 AM (2 years ago)
Author:
vboxsync
Message:

ValidationKit/tests/unittests/tdUnitTest1.py: Skip checking for black list / buggy tests list etc. when executing with --only-whitelist. This allows a unit test being black listed AND white listed at the same time, so that it only gets executed when --only-whitelist is being used (but skipped on the rest). Handy for unit tests which require a full-blown OS (e.g. a guest VM) instead of a (test) box which only has minimal dependencies.

Added testcase/tstClipboardMockHGCM, so that it only executes remotely (nested) on the guest VMS for the reasons above.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py

    r96849 r97288  
    133133        'testcase/tstClipboardX11Smoke': '',            # (Old naming, deprecated) Needs X, not available on all test boxes.
    134134        'testcase/tstClipboardGH-X11Smoke': '',         # (New name) Ditto.
     135        'testcase/tstClipboardMockHGCM': '',            # Ditto.
    135136        'tstClipboardQt': '',                           # Is interactive and needs Qt, needed for Qt clipboard bugfixing.
    136137        'testcase/tstClipboardQt': '',                  # In case it moves here.
     
    258259    # White list, which contains tests considered to be safe to execute,
    259260    # even on remote targets (guests).
     261    #
     262    # When --only-whitelist is specified, this is the only list being checked for.
    260263    kdTestCasesWhiteList = {
    261264        'testcase/tstFile': '',
    262265        'testcase/tstFileLock': '',
     266        'testcase/tstClipboardMockHGCM': '',            # Requires X on Linux OSes. Execute on remote targets only (guests).
    263267        'testcase/tstRTLocalIpc': '',
    264268        'testcase/tstRTPathQueryInfo': '',
     
    11921196            if  self.fOnlyWhiteList \
    11931197            and not self._isExcluded(sName, self.kdTestCasesWhiteList):
     1198                # (No testStart/Done or accounting here!)
    11941199                reporter.log('%s: SKIPPED (not in white list)' % (sName,));
    11951200                continue;
     
    12011206                continue;
    12021207
    1203             # Check if the testcase is black listed or buggy before executing it.
    1204             if self._isExcluded(sName, self.kdTestCasesBlackList):
    1205                 # (No testStart/Done or accounting here!)
    1206                 reporter.log('%s: SKIPPED (blacklisted)' % (sName,));
    1207 
    1208             elif self._isExcluded(sName, self.kdTestCasesBuggy):
    1209                 reporter.testStart(sName);
    1210                 reporter.log('%s: Skipping, buggy in general.' % (sName,));
    1211                 reporter.testDone(fSkipped = True);
    1212                 self.cSkipped += 1;
    1213 
    1214             elif self._isExcluded(sName, dTestCasesBuggyForHostOs):
    1215                 reporter.testStart(sName);
    1216                 reporter.log('%s: Skipping, buggy on %s.' % (sName, utils.getHostOs(),));
    1217                 reporter.testDone(fSkipped = True);
    1218                 self.cSkipped += 1;
    1219 
     1208            # When not only processing the white list, do some more checking first.
     1209            if not self.fOnlyWhiteList:
     1210                # Check if the testcase is black listed or buggy before executing it.
     1211                if self._isExcluded(sName, self.kdTestCasesBlackList):
     1212                    # (No testStart/Done or accounting here!)
     1213                    reporter.log('%s: SKIPPED (blacklisted)' % (sName,));
     1214                    continue;
     1215
     1216                elif self._isExcluded(sName, self.kdTestCasesBuggy):
     1217                    reporter.testStart(sName);
     1218                    reporter.log('%s: Skipping, buggy in general.' % (sName,));
     1219                    reporter.testDone(fSkipped = True);
     1220                    self.cSkipped += 1;
     1221                    continue;
     1222
     1223                elif self._isExcluded(sName, dTestCasesBuggyForHostOs):
     1224                    reporter.testStart(sName);
     1225                    reporter.log('%s: Skipping, buggy on %s.' % (sName, utils.getHostOs(),));
     1226                    reporter.testDone(fSkipped = True);
     1227                    self.cSkipped += 1;
     1228                    continue;
    12201229            else:
    1221                 sFullPath = os.path.normpath(os.path.join(self.sUnitTestsPathSrc, os.path.join(sTestCaseSubDir, sFilename)));
    1222                 reporter.testStart(sName);
    1223                 try:
    1224                     fSkipped = self._executeTestCase(oTestVm, sName, sFullPath, sTestCaseSubDir, oDevNull);
    1225                 except:
    1226                     reporter.errorXcpt('!*!');
    1227                     self.cFailed += 1;
    1228                     fSkipped = False;
    1229                 reporter.testDone(fSkipped);
    1230 
     1230                # Passed the white list check already above.
     1231                pass;
     1232
     1233            sFullPath = os.path.normpath(os.path.join(self.sUnitTestsPathSrc, os.path.join(sTestCaseSubDir, sFilename)));
     1234            reporter.testStart(sName);
     1235            try:
     1236                fSkipped = self._executeTestCase(oTestVm, sName, sFullPath, sTestCaseSubDir, oDevNull);
     1237            except:
     1238                reporter.errorXcpt('!*!');
     1239                self.cFailed += 1;
     1240                fSkipped = False;
     1241            reporter.testDone(fSkipped);
    12311242
    12321243
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