Skip to content

Commit

Permalink
selftests/seccomp: Rename XFAIL to SKIP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kees Cook committed Jul 10, 2020
1 parent b3a9e3b commit 8b1bc88
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tools/testing/selftests/seccomp/seccomp_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@

#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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -3672,15 +3677,15 @@ 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:
EXPECT_EQ(waitpid(pid, &status, 0), pid);
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;
}
}
Expand Down

0 comments on commit 8b1bc88

Please sign in to comment.