Skip to contentSkip to conversation

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

PATCH Applied Leon Hwang 2 participants 2 messages Sep 15, 2025

Subsystems (3)
lore
Share & tools
lore

Leon Hwang

author
#0 lore raw

PATCH 1/1 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

---
 tools/testing/selftests/bpf/prog_tests/timer.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/testing/selftests/bpf/prog_tests/timer.c +4 -0
index 86425939527c8..34f9ccce26029 100644
@@ -108,6 +108,10 @@ void test_timer_interrupt(void)
 	LIBBPF_OPTS(bpf_test_run_opts, opts);
 
 	skel = timer_interrupt__open_and_load();
+	if (!skel && errno == EOPNOTSUPP) {
+		test__skip();
+		return;
+	}
 	if (!ASSERT_OK_PTR(skel, "timer_interrupt__open_and_load"))
 		return;
 
Signature · 1 line
2.50.1
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:

Quoted 10 lines · On Mon, 15 Sep 2025 20:16:57 +0800 you wrote:

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

[...]

Here is the summary with links:
- [bpf-next] selftests/bpf: Skip timer_interrupt case when bpf_timer is not supported

    https://git.kernel.org/bpf/bpf-next/c/f7528e441213

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html