selftests/bpf: Skip spin lock failure test on s390x
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Fri, 18 Nov 2022 18:59:38 +0000 (00:29 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 18 Nov 2022 20:17:54 +0000 (12:17 -0800)
Instead of adding the whole test to DENYLIST.s390x, which also has
success test cases that should be run, just skip over failure test
cases in case the JIT does not support kfuncs.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20221118185938.2139616-3-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/spin_lock.c

index 72282e92a78a22d66fdd340589eb4b897cf58166..d9270bd3d92075d20cec2321a9dea53739240e1c 100644 (file)
@@ -68,6 +68,12 @@ static void test_spin_lock_fail_prog(const char *prog_name, const char *err_msg)
        if (!ASSERT_ERR(ret, "test_spin_lock_fail__load must fail"))
                goto end;
 
+       /* Skip check if JIT does not support kfuncs */
+       if (strstr(log_buf, "JIT does not support calling kernel function")) {
+               test__skip();
+               goto end;
+       }
+
        if (!ASSERT_OK_PTR(strstr(log_buf, err_msg), "expected error message")) {
                fprintf(stderr, "Expected: %s\n", err_msg);
                fprintf(stderr, "Verifier: %s\n", log_buf);