Thread (16 messages) flat view 16 messages, 3 authors, 2020-02-25

Re: [PATCH bpf-next v2 5/5] selftests/bpf: Add test for "bpftool feature" command

From: Michal Rostecki <hidden>
Date: 2020-02-25 13:25:37
Also in: bpf, linux-kselftest, lkml

On 2/21/20 12:28 PM, Quentin Monnet wrote:>> +    def
test_feature_macros(self):
quoted
+        expected_patterns = [
+            b"/\*\*\* System call availability \*\*\*/",
+            b"#define HAVE_BPF_SYSCALL",
+            b"/\*\*\* eBPF program types \*\*\*/",
+            b"#define HAVE.*PROG_TYPE",
+            b"/\*\*\* eBPF map types \*\*\*/",
+            b"#define HAVE.*MAP_TYPE",
+            b"/\*\*\* eBPF helper functions \*\*\*/",
+            b"#define HAVE.*HELPER",
+            b"/\*\*\* eBPF misc features \*\*\*/",
+        ]
+
+        res = bpftool(["feature", "probe", "macros"])
+        for pattern in expected_patterns:
+            self.assertRegex(res, pattern)
Could we have (or did I miss it?) a test that compares the output of
probes _with_ "full" and _without_ it, to make sure that the only lines
that differ are about "bpf_trace_prink" or "bpf_probe_write_user"? Could
help determine if we filter out too many elements by mistake.

Thanks,
Quentin
Good idea, I will add that test in v3.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help