summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/testing_helpers.h
diff options
context:
space:
mode:
authorMykola Lysenko <mykolal@fb.com>2022-04-09 03:17:49 +0300
committerAndrii Nakryiko <andrii@kernel.org>2022-04-11 06:08:20 +0300
commit61ddff373ffa843155eba6a507973b1b78bb5a14 (patch)
treea35a8d89fedb8542d3238d04c98943bc3021743a /tools/testing/selftests/bpf/testing_helpers.h
parent0738599856542bab0ebcd73cab9d8f15bddedcee (diff)
downloadlinux-61ddff373ffa843155eba6a507973b1b78bb5a14.tar.xz
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 -a 'send_signal*' -a find_vma -d send_signal/send_signal_nmi* - runs 2 send_signal test and find_vma test. Disables two send_signal nmi subtests -t send_signal -t find_vma - runs two *send_signal* tests and one *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 <mykolal@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220409001750.529930-1-mykolal@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/testing_helpers.h')
-rw-r--r--tools/testing/selftests/bpf/testing_helpers.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/testing_helpers.h b/tools/testing/selftests/bpf/testing_helpers.h
index f46ebc476ee8..6ec00bf79cb5 100644
--- a/tools/testing/selftests/bpf/testing_helpers.h
+++ b/tools/testing/selftests/bpf/testing_helpers.h
@@ -12,3 +12,11 @@ int bpf_test_load_program(enum bpf_prog_type type, const struct bpf_insn *insns,
size_t insns_cnt, const char *license,
__u32 kern_version, char *log_buf,
size_t log_buf_sz);
+
+/*
+ * below function is exported for testing in prog_test test
+ */
+struct test_filter_set;
+int parse_test_list(const char *s,
+ struct test_filter_set *test_set,
+ bool is_glob_pattern);