Skip to content

Commit 8b1bc88

Browse files
committed
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: Kees Cook <[email protected]>
1 parent b3a9e3b commit 8b1bc88

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tools/testing/selftests/seccomp/seccomp_bpf.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252

5353
#include "../kselftest_harness.h"
5454

55+
/* Attempt to de-conflict with the selftests tree. */
56+
#ifndef SKIP
57+
#define SKIP(s, ...) XFAIL(s, ##__VA_ARGS__)
58+
#endif
59+
5560
#ifndef PR_SET_PTRACER
5661
# define PR_SET_PTRACER 0x59616d61
5762
#endif
@@ -3068,7 +3073,7 @@ TEST(get_metadata)
30683073

30693074
/* Only real root can get metadata. */
30703075
if (geteuid()) {
3071-
XFAIL(return, "get_metadata requires real root");
3076+
SKIP(return, "get_metadata requires real root");
30723077
return;
30733078
}
30743079

@@ -3111,7 +3116,7 @@ TEST(get_metadata)
31113116
ret = ptrace(PTRACE_SECCOMP_GET_METADATA, pid, sizeof(md), &md);
31123117
EXPECT_EQ(sizeof(md), ret) {
31133118
if (errno == EINVAL)
3114-
XFAIL(goto skip, "Kernel does not support PTRACE_SECCOMP_GET_METADATA (missing CONFIG_CHECKPOINT_RESTORE?)");
3119+
SKIP(goto skip, "Kernel does not support PTRACE_SECCOMP_GET_METADATA (missing CONFIG_CHECKPOINT_RESTORE?)");
31153120
}
31163121

31173122
EXPECT_EQ(md.flags, SECCOMP_FILTER_FLAG_LOG);
@@ -3672,15 +3677,15 @@ TEST(user_notification_continue)
36723677
resp.val = 0;
36733678
EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_SEND, &resp), 0) {
36743679
if (errno == EINVAL)
3675-
XFAIL(goto skip, "Kernel does not support SECCOMP_USER_NOTIF_FLAG_CONTINUE");
3680+
SKIP(goto skip, "Kernel does not support SECCOMP_USER_NOTIF_FLAG_CONTINUE");
36763681
}
36773682

36783683
skip:
36793684
EXPECT_EQ(waitpid(pid, &status, 0), pid);
36803685
EXPECT_EQ(true, WIFEXITED(status));
36813686
EXPECT_EQ(0, WEXITSTATUS(status)) {
36823687
if (WEXITSTATUS(status) == 2) {
3683-
XFAIL(return, "Kernel does not support kcmp() syscall");
3688+
SKIP(return, "Kernel does not support kcmp() syscall");
36843689
return;
36853690
}
36863691
}

0 commit comments

Comments
 (0)