Commit c94188c
selftests/bpf: Use ASSERT_OK to skip ENOTSUPP
There are so many "ENOTSUPP" (-524) errors when running BPF selftests
on a Loongarch platform since lacking BPF trampoline on Loongarch:
'''
test_d_path_basic:PASS:setup 0 nsec
libbpf: prog 'prog_stat': failed to attach: unknown error (-524)
libbpf: prog 'prog_stat': failed to auto-attach: -524
test_d_path_basic:FAIL:setup attach failed: -524
torvalds#77/1 d_path/basic:FAIL
torvalds#77/2 d_path/check_rdonly_mem:OK
torvalds#77/3 d_path/check_alloc_mem:OK
torvalds#77 d_path:FAIL
... ...
test_module_attach:PASS:skel_open 0 nsec
test_module_attach:PASS:set_attach_target 0 nsec
test_module_attach:PASS:set_attach_target_explicit 0 nsec
test_module_attach:PASS:skel_load 0 nsec
libbpf: prog 'handle_fentry': failed to attach: unknown error (-524)
libbpf: prog 'handle_fentry': failed to auto-attach: -524
test_module_attach:FAIL:skel_attach skeleton attach failed: -524
torvalds#167 module_attach:FAIL
... ...
ringbuf_subtest:PASS:skel_open 0 nsec
ringbuf_subtest:PASS:skel_load 0 nsec
ringbuf_subtest:PASS:rw_cons_pos 0 nsec
ringbuf_subtest:PASS:rw_extend 0 nsec
ringbuf_subtest:PASS:exec_cons_pos_protect 0 nsec
ringbuf_subtest:PASS:unmap_rw 0 nsec
ringbuf_subtest:PASS:wr_prod_pos 0 nsec
ringbuf_subtest:PASS:wr_prod_pos_err 0 nsec
ringbuf_subtest:PASS:wr_data_page_one 0 nsec
ringbuf_subtest:PASS:wr_data_page_one_err 0 nsec
ringbuf_subtest:PASS:wr_data_page_two 0 nsec
ringbuf_subtest:PASS:wr_data_page_all 0 nsec
ringbuf_subtest:PASS:ro_prod_pos 0 nsec
ringbuf_subtest:PASS:write_protect 0 nsec
ringbuf_subtest:PASS:exec_protect 0 nsec
ringbuf_subtest:PASS:ro_remap 0 nsec
ringbuf_subtest:PASS:unmap_ro 0 nsec
ringbuf_subtest:PASS:ro_prod_pos 0 nsec
ringbuf_subtest:PASS:write_protect 0 nsec
ringbuf_subtest:PASS:exec_protect 0 nsec
ringbuf_subtest:PASS:ro_remap 0 nsec
ringbuf_subtest:PASS:unmap_ro 0 nsec
ringbuf_subtest:PASS:ringbuf_create 0 nsec
ringbuf_subtest:FAIL:skel_attach skeleton attachment failed: -1
torvalds#277/1 ringbuf/ringbuf:FAIL
torvalds#277/2 ringbuf/ringbuf_n:SKIP
torvalds#277/3 ringbuf/ringbuf_map_key:SKIP
torvalds#277 ringbuf:FAIL
... ...
test_test_bprm_opts:PASS:skel_load 0 nsec
libbpf: prog 'secure_exec': failed to attach: unknown error (-524)
libbpf: prog 'secure_exec': failed to auto-attach: -524
test_test_bprm_opts:FAIL:attach attach failed: -524
torvalds#382 test_bprm_opts:FAIL
... ...
test_test_ima:PASS:skel_load 0 nsec
test_test_ima:PASS:ringbuf 0 nsec
libbpf: prog 'bprm_committed_creds': failed to attach: \
unknown error (-524)
libbpf: prog 'bprm_committed_creds': failed to auto-attach: -524
test_test_ima:FAIL:attach attach failed: -524
torvalds#384 test_ima:FAIL
... ...
test_trace_ext:PASS:setup 0 nsec
test_trace_ext:PASS:setup 0 nsec
test_trace_ext:PASS:setup 0 nsec
test_trace_ext:PASS:setup 0 nsec
libbpf: prog 'test_pkt_md_access_new': failed to attach: \
unknown error (-524)
libbpf: prog 'test_pkt_md_access_new': failed to auto-attach: -524
test_trace_ext:FAIL:setup freplace/test_pkt_md_access attach failed: -524
torvalds#397 trace_ext:FAIL
'''
This patch uses ASSERT_OK() instead of CHECK() to skip these "ENOTSUPP"
errors. With this change, the new output of these selftests look like:
'''
torvalds#77/1 d_path/basic:SKIP
torvalds#77/2 d_path/check_rdonly_mem:OK
torvalds#77/3 d_path/check_alloc_mem:OK
torvalds#77 d_path:OK (SKIP: 1/3)
... ...
torvalds#167 module_attach:SKIP
... ...
torvalds#277/1 ringbuf/ringbuf:SKIP
torvalds#277/2 ringbuf/ringbuf_n:SKIP
torvalds#277/3 ringbuf/ringbuf_map_key:SKIP
torvalds#277 ringbuf:SKIP
... ...
torvalds#382 test_bprm_opts:SKIP
... ...
torvalds#384 test_ima:SKIP
... ...
torvalds#397 trace_ext:SKIP
'''
Signed-off-by: Geliang Tang <[email protected]>1 parent acbf1b8 commit c94188c
File tree
6 files changed
+6
-6
lines changed- tools/testing/selftests/bpf/prog_tests
6 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
0 commit comments