Repository: mesos Updated Branches: refs/heads/master 4e3e4cadc -> b1a23d6a5
Fixes for NsTest on Ubuntu. Review: https://reviews.apache.org/r/36600 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ff007d6a Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ff007d6a Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ff007d6a Branch: refs/heads/master Commit: ff007d6a4148c9769650ddba5d067343f3834bd0 Parents: 4e3e4ca Author: Benjamin Hindman <[email protected]> Authored: Sun Jul 19 00:53:04 2015 +0000 Committer: Benjamin Hindman <[email protected]> Committed: Sun Jul 19 11:13:15 2015 -0700 ---------------------------------------------------------------------- src/tests/ns_tests.cpp | 7 +++++++ src/tests/setns_test_helper.cpp | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/ff007d6a/src/tests/ns_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/ns_tests.cpp b/src/tests/ns_tests.cpp index 400ce93..bcd0e12 100644 --- a/src/tests/ns_tests.cpp +++ b/src/tests/ns_tests.cpp @@ -92,6 +92,13 @@ TEST(NsTest, ROOT_setns) int flags = 0; foreach (const string& ns, namespaces) { + // Skip 'user' namespace because it causes 'clone' to change us + // from being user 'root' to user 'nobody', but these tests + // require root. See MESOS-3083. + if (ns == "user") { + continue; + } + Try<int> nstype = ns::nstype(ns); ASSERT_SOME(nstype); http://git-wip-us.apache.org/repos/asf/mesos/blob/ff007d6a/src/tests/setns_test_helper.cpp ---------------------------------------------------------------------- diff --git a/src/tests/setns_test_helper.cpp b/src/tests/setns_test_helper.cpp index 87f4d6a..eff1e6e 100644 --- a/src/tests/setns_test_helper.cpp +++ b/src/tests/setns_test_helper.cpp @@ -40,13 +40,17 @@ int SetnsTestHelper::execute() // Note: /proc has not been remounted so we can look up pid 1's // namespaces, even if we're in a separate pid namespace. foreach (const string& ns, namespaces) { - // ns::setns() does not (currently) support pid namespaces so this - // should return an error. if (ns == "pid") { + // ns::setns() does not (currently) support pid namespaces so + // this should return an error. Try<Nothing> setns = ns::setns(1, ns); if (!setns.isError()) { return 1; } + } else if (ns == "user") { + // ns::setns() will also fail with user namespaces, so we skip + // for now. See MESOS-3083. + continue; } else { Try<Nothing> setns = ns::setns(1, ns); if (!setns.isSome()) {
