]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests/consts: Add parser option to skip a test
authorTom Hromatka <tom.hromatka@oracle.com>
Tue, 23 Mar 2021 16:09:29 +0000 (16:09 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 23 Mar 2021 16:58:19 +0000 (16:58 +0000)
Add a flag, '-S' or '--skip', to allow a test number
to be skipped.  This will be used to skip the cgclear test
by default since it's so destructive.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/ftests.py

index db18dc990663ecfcf58cfd00d5ddc84a9743715b..13127611a6c2f56c44129d579ec6162db6cda163 100755 (executable)
@@ -65,6 +65,9 @@ def parse_args():
     parser.add_argument('-N', '--num',
                         help='Test number to run.  If unspecified, all tests are run',
                         required=False, default=consts.TESTS_RUN_ALL, type=int)
+    parser.add_argument('-S', '--skip',
+                        help='Test number to skip.  If unspecified, all tests are run',
+                        required=False, default=consts.TESTS_RUN_ALL, type=int)
     parser.add_argument('-s', '--suite',
                         help='Test suite to run, e.g. cpuset', required=False,
                         default=consts.TESTS_RUN_ALL_SUITES, type=str)
@@ -207,6 +210,10 @@ def run_tests(config):
                config.args.suite == filesuite:
                 if config.args.num == consts.TESTS_RUN_ALL or \
                    config.args.num == filenum_int:
+
+                    if config.args.skip == filenum_int:
+                        continue
+
                     test = __import__(os.path.splitext(filename)[0])
 
                     failure_cause = None