Repository: mesos Updated Branches: refs/heads/master 2fe2bb26a -> 2e3a5b134
Fixed a bug in the test `NamespacesIsolatorTest`. In this test, we used the command `stat -c %i` to get the current process's pid/ipc namespace inode, that is not correct since `/proc/self/ns/pid` and `/proc/self/ns/ipc` are symbol links, we should get the inode that the link references rather than the link itself. So we need to add a `-L` option in the `stat` command. Review: https://reviews.apache.org/r/61463/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c5685834 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c5685834 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c5685834 Branch: refs/heads/master Commit: c568583408be47d5990c163b3d8ef0f3ca3993e0 Parents: 36f11dd Author: Qian Zhang <zhq527...@gmail.com> Authored: Sun Aug 13 19:51:58 2017 -0700 Committer: Gilbert Song <songzihao1...@gmail.com> Committed: Mon Aug 14 15:40:31 2017 -0700 ---------------------------------------------------------------------- src/tests/containerizer/isolator_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/c5685834/src/tests/containerizer/isolator_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/containerizer/isolator_tests.cpp b/src/tests/containerizer/isolator_tests.cpp index f3c541c..a390038 100644 --- a/src/tests/containerizer/isolator_tests.cpp +++ b/src/tests/containerizer/isolator_tests.cpp @@ -109,7 +109,7 @@ TEST_F(NamespacesIsolatorTest, ROOT_PidNamespace) // Write the command's pid namespace inode and init name to files. const string command = - "stat -c %i /proc/self/ns/pid > ns && (cat /proc/1/comm > init)"; + "stat -Lc %i /proc/self/ns/pid > ns && (cat /proc/1/comm > init)"; process::Future<bool> launch = containerizer.get()->launch( containerId, @@ -173,7 +173,7 @@ TEST_F(NamespacesIsolatorTest, ROOT_IPCNamespace) ASSERT_NE(hostShmmax.get(), shmmaxValue); const string command = - "stat -c %i /proc/self/ns/ipc > ns;" + "stat -Lc %i /proc/self/ns/ipc > ns;" "echo " + stringify(shmmaxValue) + " > /proc/sys/kernel/shmmax;" "cp /proc/sys/kernel/shmmax shmmax";