From fb5b9bb3bb60b28619708f59c0e140db961f903d Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Tue, 22 Nov 2016 17:18:10 -0800 Subject: [PATCH] Remove CLONE_NEWNS for gettid and getpid cache tests. Using CLONE_NEWNS flag is not related to the tests, and it make the tests unavailable in cts tests. So remove the flag. Bug: http://b/33089743 Test: run CtsBionicTestCases --gtest_filter=unistd*. Change-Id: I4bda39c6a0c41c9973d275202a3a7f7a1e9bbba3 --- tests/unistd_test.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp index b488e8264..f8b35cc02 100644 --- a/tests/unistd_test.cpp +++ b/tests/unistd_test.cpp @@ -530,12 +530,7 @@ TEST(UNISTD_TEST, gettid_caching_and_clone_process_settid) { static int CloneStartRoutine(int (*start_routine)(void*)) { void* child_stack[1024]; - int clone_result = clone(start_routine, &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 clone_result; - } - return clone_result; + return clone(start_routine, &child_stack[1024], SIGCHLD, NULL); } static int GetPidCachingCloneStartRoutine(void*) {