You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gi...@apache.org on 2017/08/15 04:31:17 UTC
[6/8] mesos git commit: Fixed a bug in the test
`NamespacesIsolatorTest`.
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/fc15de91
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fc15de91
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fc15de91
Branch: refs/heads/1.4.x
Commit: fc15de9187292ee47bc21d32689a016784128890
Parents: ad8f27d
Author: Qian Zhang <zh...@gmail.com>
Authored: Sun Aug 13 19:51:58 2017 -0700
Committer: Gilbert Song <so...@gmail.com>
Committed: Mon Aug 14 21:30:45 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/fc15de91/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";