Skip to contentSkip to conversation

selftests/bpf: Allow prog name matching for tests with __description

PATCH New Kumar Kartikeya Dwivedi 1 participant 1 message Apr 7

Subsystems (3)
lore
Share & tools
lore

Kumar Kartikeya Dwivedi

author maintainer
#0 lore raw

PATCH 1/1 selftests/bpf: Allow prog name matching for tests with __description

For tests that carry a __description tag, allow matching on both the description string and program name for convenience. Before this commit, the description string must be spelt out to filter the tests.

---
 tools/testing/selftests/bpf/progs/bpf_misc.h |  4 +-
 tools/testing/selftests/bpf/test_loader.c    | 46 ++++++++++++++++----
 tools/testing/selftests/bpf/test_progs.c     | 45 +++++++++++++++----
 tools/testing/selftests/bpf/test_progs.h     |  1 +
 4 files changed, 76 insertions(+), 20 deletions(-)
tools/testing/selftests/bpf/progs/bpf_misc.h +2 -2
index 0904fe14ad1d..4b313374c5f1 100644
@@ -103,8 +103,8 @@
  *                   - TEST_DATA_LEN
  * __retval_unpriv   Same, but load program in unprivileged mode.
  *
- * __description     Text to be used instead of a program name for display
- *                   and filtering purposes.
+ * __description     Text to be used for display and as an additional filter
+ *                   alias, while the original program name stays matchable.
  *
  * __log_level       Log level to use for the program, numeric value expected.
  *
tools/testing/selftests/bpf/test_loader.c +37 -9

92 lines not on this page · raw message

tools/testing/selftests/bpf/test_progs.c +36 -9

90 lines not on this page · raw message

tools/testing/selftests/bpf/test_progs.h +1 -0
index eebfc18cdcd2..1a44467f4310 100644
@@ -181,6 +181,7 @@ struct msg {
 extern struct test_env env;
 
 void test__force_log(void);
+bool test__start_subtest_with_desc(const char *name, const char *description);
 bool test__start_subtest(const char *name);
 void test__end_subtest(void);
 void test__skip(void);

--
2.52.0