[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <d623360ac7fdc3d8e1a8bc34e018f1aba6bd7e73.1648516943.git.yang.guang5@zte.com.cn>
Date: Tue, 29 Mar 2022 14:03:59 +0800
From: davidcomponentone@...il.com
To: keescook@...omium.org
Cc: davidcomponentone@...il.com, luto@...capital.net, wad@...omium.org,
shuah@...nel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org,
linux-kselftest@...r.kernel.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
Yang Guang <yang.guang5@....com.cn>
Subject: [PATCH] selftests/seccomp: Add SKIP for failed unshare()
From: Yang Guang <yang.guang5@....com.cn>
Running the seccomp tests under the kernel with "defconfig"
shouldn't fail. Because the CONFIG_USER_NS is not support
in "defconfig". So skip this test case is better.
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
Signed-off-by: David Yang <davidcomponentone@...il.com>
---
tools/testing/selftests/seccomp/seccomp_bpf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 313bb0cbfb1e..e9a61cb2eb88 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -3742,7 +3742,10 @@ TEST(user_notification_fault_recv)
struct seccomp_notif req = {};
struct seccomp_notif_resp resp = {};
- ASSERT_EQ(unshare(CLONE_NEWUSER), 0);
+ ASSERT_EQ(unshare(CLONE_NEWUSER), 0) {
+ if (errno == EINVAL)
+ SKIP(return, "kernel missing CLONE_NEWUSER support");
+ }
listener = user_notif_syscall(__NR_getppid,
SECCOMP_FILTER_FLAG_NEW_LISTENER);
--
2.30.2
Powered by blists - more mailing lists