Fix container cgroup detection in isolator tests.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/67c994d1 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/67c994d1 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/67c994d1 Branch: refs/heads/master Commit: 67c994d1a432e590295d3471993c1dc3a59ebd70 Parents: d975e45 Author: Timothy Chen <[email protected]> Authored: Wed Jul 15 12:56:53 2015 -0700 Committer: Timothy Chen <[email protected]> Committed: Wed Jul 15 14:26:32 2015 -0700 ---------------------------------------------------------------------- src/tests/isolator_tests.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/67c994d1/src/tests/isolator_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/isolator_tests.cpp b/src/tests/isolator_tests.cpp index b63a9cc..a3ed071 100644 --- a/src/tests/isolator_tests.cpp +++ b/src/tests/isolator_tests.cpp @@ -1237,9 +1237,9 @@ TYPED_TEST(UserCgroupIsolatorTest, ROOT_CGROUPS_UserCgroup) AWAIT_READY(isolator.get()->isolate(containerId, pid)); // Get the container's cgroups from /proc/$PID/cgroup. We're only - // interested in the non-root cgroups, i.e., we exclude those with - // paths "/", e.g., only cpu and cpuacct from this example: - // 6:blkio:/ + // interested in the cgroups path that is setup by the isolator, + // which sets up cgroup under /mesos. + // 6:blkio:/user.slice // 5:perf_event:/ // 4:memory:/ // 3:freezer:/ @@ -1249,7 +1249,7 @@ TYPED_TEST(UserCgroupIsolatorTest, ROOT_CGROUPS_UserCgroup) ostringstream output; Try<int> status = os::shell( &output, - "grep -v '/$' /proc/" + + "grep '/mesos' /proc/" + stringify(pid) + "/cgroup | awk -F ':' '{print $2$3}'");
