From: Tom Hromatka Date: Tue, 23 Mar 2021 16:09:29 +0000 (+0000) Subject: ftests/consts: Add parser option to skip a test X-Git-Tag: v2.0.3~11^2^2~21^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7259400c06941891eabf010152bbc0ed299fba26;p=thirdparty%2Flibcgroup.git ftests/consts: Add parser option to skip a test 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 --- diff --git a/ftests/ftests.py b/ftests/ftests.py index db18dc99..13127611 100755 --- a/ftests/ftests.py +++ b/ftests/ftests.py @@ -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