diff options
-rw-r--r-- | tests/unistd_test.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp index 2a65657..8195ea8 100644 --- a/tests/unistd_test.cpp +++ b/tests/unistd_test.cpp @@ -431,6 +431,10 @@ TEST(unistd, getpid_caching_and_clone) { void* child_stack[1024]; int clone_result = clone(GetPidCachingCloneStartRoutine, &child_stack[1024], CLONE_NEWNS | SIGCHLD, NULL); + if (clone_result == -1 && errno == EPERM && getuid() != 0) { + GTEST_LOG_(INFO) << "This test only works if you have permission to CLONE_NEWNS; try running as root.\n"; + return; + } ASSERT_NE(clone_result, -1); ASSERT_EQ(parent_pid, getpid()); |