selftests/seccomp: Rename XFAIL to SKIP
authorKees Cook <keescook@chromium.org>
Fri, 10 Jul 2020 16:24:36 +0000 (09:24 -0700)
committerKees Cook <keescook@chromium.org>
Fri, 10 Jul 2020 23:01:42 +0000 (16:01 -0700)
The kselftests will be renaming XFAIL to SKIP in the test harness, and
to avoid painful conflicts, rename XFAIL to SKIP now in a future-proofed
way.

Signed-off-by: Kees Cook <keescook@chromium.org>
tools/testing/selftests/seccomp/seccomp_bpf.c

index c0aa46ce14f6ce088b4c8b288b94aeeaf4e3fcac..d4c8858fde8e77300d9c113bb0e0d50f8c7f744c 100644 (file)
 
 #include "../kselftest_harness.h"
 
+/* Attempt to de-conflict with the selftests tree. */
+#ifndef SKIP
+#define SKIP(s, ...)   XFAIL(s, ##__VA_ARGS__)
+#endif
+
 #ifndef PR_SET_PTRACER
 # define PR_SET_PTRACER 0x59616d61
 #endif
@@ -3068,7 +3073,7 @@ TEST(get_metadata)
 
        /* Only real root can get metadata. */
        if (geteuid()) {
-               XFAIL(return, "get_metadata requires real root");
+               SKIP(return, "get_metadata requires real root");
                return;
        }
 
@@ -3111,7 +3116,7 @@ TEST(get_metadata)
        ret = ptrace(PTRACE_SECCOMP_GET_METADATA, pid, sizeof(md), &md);
        EXPECT_EQ(sizeof(md), ret) {
                if (errno == EINVAL)
-                       XFAIL(goto skip, "Kernel does not support PTRACE_SECCOMP_GET_METADATA (missing CONFIG_CHECKPOINT_RESTORE?)");
+                       SKIP(goto skip, "Kernel does not support PTRACE_SECCOMP_GET_METADATA (missing CONFIG_CHECKPOINT_RESTORE?)");
        }
 
        EXPECT_EQ(md.flags, SECCOMP_FILTER_FLAG_LOG);
@@ -3672,7 +3677,7 @@ TEST(user_notification_continue)
        resp.val = 0;
        EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_SEND, &resp), 0) {
                if (errno == EINVAL)
-                       XFAIL(goto skip, "Kernel does not support SECCOMP_USER_NOTIF_FLAG_CONTINUE");
+                       SKIP(goto skip, "Kernel does not support SECCOMP_USER_NOTIF_FLAG_CONTINUE");
        }
 
 skip:
@@ -3680,7 +3685,7 @@ skip:
        EXPECT_EQ(true, WIFEXITED(status));
        EXPECT_EQ(0, WEXITSTATUS(status)) {
                if (WEXITSTATUS(status) == 2) {
-                       XFAIL(return, "Kernel does not support kcmp() syscall");
+                       SKIP(return, "Kernel does not support kcmp() syscall");
                        return;
                }
        }