Commit 8b1bc88c authored by Kees Cook's avatar Kees Cook

selftests/seccomp: Rename XFAIL to SKIP

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: default avatarKees Cook <keescook@chromium.org>
parent b3a9e3b9
...@@ -52,6 +52,11 @@ ...@@ -52,6 +52,11 @@
#include "../kselftest_harness.h" #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 #ifndef PR_SET_PTRACER
# define PR_SET_PTRACER 0x59616d61 # define PR_SET_PTRACER 0x59616d61
#endif #endif
...@@ -3068,7 +3073,7 @@ TEST(get_metadata) ...@@ -3068,7 +3073,7 @@ TEST(get_metadata)
/* Only real root can get metadata. */ /* Only real root can get metadata. */
if (geteuid()) { if (geteuid()) {
XFAIL(return, "get_metadata requires real root"); SKIP(return, "get_metadata requires real root");
return; return;
} }
...@@ -3111,7 +3116,7 @@ TEST(get_metadata) ...@@ -3111,7 +3116,7 @@ TEST(get_metadata)
ret = ptrace(PTRACE_SECCOMP_GET_METADATA, pid, sizeof(md), &md); ret = ptrace(PTRACE_SECCOMP_GET_METADATA, pid, sizeof(md), &md);
EXPECT_EQ(sizeof(md), ret) { EXPECT_EQ(sizeof(md), ret) {
if (errno == EINVAL) 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); EXPECT_EQ(md.flags, SECCOMP_FILTER_FLAG_LOG);
...@@ -3672,7 +3677,7 @@ TEST(user_notification_continue) ...@@ -3672,7 +3677,7 @@ TEST(user_notification_continue)
resp.val = 0; resp.val = 0;
EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_SEND, &resp), 0) { EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_SEND, &resp), 0) {
if (errno == EINVAL) 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: skip:
...@@ -3680,7 +3685,7 @@ TEST(user_notification_continue) ...@@ -3680,7 +3685,7 @@ TEST(user_notification_continue)
EXPECT_EQ(true, WIFEXITED(status)); EXPECT_EQ(true, WIFEXITED(status));
EXPECT_EQ(0, WEXITSTATUS(status)) { EXPECT_EQ(0, WEXITSTATUS(status)) {
if (WEXITSTATUS(status) == 2) { if (WEXITSTATUS(status) == 2) {
XFAIL(return, "Kernel does not support kcmp() syscall"); SKIP(return, "Kernel does not support kcmp() syscall");
return; return;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment