Skip to content

Commit f7528e4

Browse files
AsphalttMartin KaFai Lau
authored andcommitted
selftests/bpf: Skip timer_interrupt case when bpf_timer is not supported
Like commit fbdd61c ("selftests/bpf: Skip timer cases when bpf_timer is not supported"), 'timer_interrupt' test case should be skipped if verifier rejects bpf_timer with returning -EOPNOTSUPP. cd tools/testing/selftests/bpf ./test_progs -t timer 461 timer_interrupt:SKIP Summary: 6/0 PASSED, 7 SKIPPED, 0 FAILED Signed-off-by: Leon Hwang <leon.hwang@linux.dev> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch.msgid.link/20250915121657.28084-1-leon.hwang@linux.dev
1 parent 32d3766 commit f7528e4

File tree

1 file changed

+4
-0
lines changed
  • tools/testing/selftests/bpf/prog_tests

1 file changed

+4
-0
lines changed

tools/testing/selftests/bpf/prog_tests/timer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ void test_timer_interrupt(void)
108108
LIBBPF_OPTS(bpf_test_run_opts, opts);
109109

110110
skel = timer_interrupt__open_and_load();
111+
if (!skel && errno == EOPNOTSUPP) {
112+
test__skip();
113+
return;
114+
}
111115
if (!ASSERT_OK_PTR(skel, "timer_interrupt__open_and_load"))
112116
return;
113117

0 commit comments

Comments
 (0)