File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
tools/testing/selftests/seccomp Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3709,7 +3709,12 @@ TEST(user_notification_sibling_pid_ns)
3709
3709
ASSERT_GE (pid , 0 );
3710
3710
3711
3711
if (pid == 0 ) {
3712
- ASSERT_EQ (unshare (CLONE_NEWPID ), 0 );
3712
+ ASSERT_EQ (unshare (CLONE_NEWPID ), 0 ) {
3713
+ if (errno == EPERM )
3714
+ SKIP (return , "CLONE_NEWPID requires CAP_SYS_ADMIN" );
3715
+ else if (errno == EINVAL )
3716
+ SKIP (return , "CLONE_NEWPID is invalid (missing CONFIG_PID_NS?)" );
3717
+ }
3713
3718
3714
3719
pid2 = fork ();
3715
3720
ASSERT_GE (pid2 , 0 );
@@ -3727,6 +3732,8 @@ TEST(user_notification_sibling_pid_ns)
3727
3732
ASSERT_EQ (unshare (CLONE_NEWPID ), 0 ) {
3728
3733
if (errno == EPERM )
3729
3734
SKIP (return , "CLONE_NEWPID requires CAP_SYS_ADMIN" );
3735
+ else if (errno == EINVAL )
3736
+ SKIP (return , "CLONE_NEWPID is invalid (missing CONFIG_PID_NS?)" );
3730
3737
}
3731
3738
ASSERT_EQ (errno , 0 );
3732
3739
You can’t perform that action at this time.
0 commit comments