You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
selftests/bpf: Improve by-name subtest selection logic in prog_tests
Improve subtest selection logic when using -t/-a/-d parameters.
In particular, more than one subtest can be specified or a
combination of tests / subtests.
-a send_signal -d send_signal/send_signal_nmi* - runs send_signal
test without nmi tests
-a send_signal/send_signal_nmi*,find_vma - runs two send_signal
subtests and find_vma test
This will allow us to have granular control over which subtests
to disable in the CI system instead of disabling whole tests.
Also, add new selftest to avoid possible regression when
changing prog_test test name selection logic.
Signed-off-by: Mykola Lysenko <[email protected]>
if (CHECK(test_set.cnt!=2, "parse_test_list subtest argument", "Unexpected number of tests in num table %d\n", test_set.cnt))
63
+
goto error;
64
+
if (!ASSERT_OK_PTR(test_set.tests, "tests__initialized"))
65
+
goto error;
66
+
if (CHECK(test_set.tests[0].whole_test, "parse_test_list no subtest argument", "Expected test 0 to be fully runnable"))
67
+
goto error;
68
+
if (CHECK(!test_set.tests[1].whole_test, "parse_test_list no subtest argument", "Expected test 0 to be fully runnable"))
69
+
goto error;
70
+
if (CHECK(strcmp("arg_parsing", test_set.tests[0].name), "parse_test_list subtest argument", "Expected test 0 to be arg_parsing"))
71
+
goto error;
72
+
if (CHECK(test_set.tests[0].subtest_cnt!=1, "parse_test_list subtest number", "Unexpected number of subtests for arg_parsing %d\n", test_set.tests[0].subtest_cnt))
73
+
goto error;
74
+
if (CHECK(strcmp("test_parse_test_list", test_set.tests[0].subtests[0]), "parse_test_list subtest name", "Expected test 0 first subtest to be to be test_parse_test_list"))
75
+
goto error;
76
+
if (CHECK(test_set.tests[1].subtest_cnt!=0, "parse_test_list subtest number", "Unexpected number of subtests for bpf_cookie %d\n", test_set.tests[1].subtest_cnt))
77
+
goto error;
78
+
if (CHECK(strcmp("bpf_cookie", test_set.tests[1].name), "parse_test_list subtest argument", "Expected test 1 to be bpf_cookie"))
0 commit comments