Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Skip timer_interrupt case when bpf_timer is not supported

Like commit fbdd61c94bcb ("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

authored by

Leon Hwang and committed by
Martin KaFai Lau
f7528e44 32d37661

+4
+4
tools/testing/selftests/bpf/prog_tests/timer.c
··· 108 108 LIBBPF_OPTS(bpf_test_run_opts, opts); 109 109 110 110 skel = timer_interrupt__open_and_load(); 111 + if (!skel && errno == EOPNOTSUPP) { 112 + test__skip(); 113 + return; 114 + } 111 115 if (!ASSERT_OK_PTR(skel, "timer_interrupt__open_and_load")) 112 116 return; 113 117