You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/10/07 20:11:59 UTC

mesos git commit: Fixed the failed LinuxFilesystemIsolatorTests.

Repository: mesos
Updated Branches:
  refs/heads/master 0f97117ba -> e7a5e3db0


Fixed the failed LinuxFilesystemIsolatorTests.


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e7a5e3db
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e7a5e3db
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e7a5e3db

Branch: refs/heads/master
Commit: e7a5e3db0e2ff287ceb37bd79740c75b4796e0cd
Parents: 0f97117
Author: Jie Yu <yu...@gmail.com>
Authored: Fri Oct 7 13:11:20 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri Oct 7 13:11:52 2016 -0700

----------------------------------------------------------------------
 .../linux_filesystem_isolator_tests.cpp         | 25 +++++++++++++-------
 1 file changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e7a5e3db/src/tests/containerizer/linux_filesystem_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/linux_filesystem_isolator_tests.cpp b/src/tests/containerizer/linux_filesystem_isolator_tests.cpp
index b522037..aa200c1 100644
--- a/src/tests/containerizer/linux_filesystem_isolator_tests.cpp
+++ b/src/tests/containerizer/linux_filesystem_isolator_tests.cpp
@@ -39,6 +39,7 @@
 #include "slave/containerizer/mesos/isolators/filesystem/linux.hpp"
 
 #include "tests/cluster.hpp"
+#include "tests/environment.hpp"
 #include "tests/mesos.hpp"
 
 #include "tests/containerizer/docker_archive.hpp"
@@ -730,19 +731,22 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_MultipleContainers)
 // already a shared mount in its own peer group.
 TEST_F(LinuxFilesystemIsolatorTest, ROOT_WorkDirMountNotNeeded)
 {
+  Try<string> directory = environment->mkdtemp();
+  ASSERT_SOME(directory);
+
   // Make 'sandbox' a shared mount in its own peer group.
   ASSERT_SOME(os::shell(
       "mount --bind %s %s && "
       "mount --make-private %s &&"
       "mount --make-shared %s",
-      sandbox->c_str(),
-      sandbox->c_str(),
-      sandbox->c_str(),
-      sandbox->c_str()));
+      directory->c_str(),
+      directory->c_str(),
+      directory->c_str(),
+      directory->c_str()));
 
   // Slave's working directory is under 'sandbox'.
   slave::Flags flags = CreateSlaveFlags();
-  flags.work_dir = path::join(sandbox.get(), "slave");
+  flags.work_dir = path::join(directory.get(), "slave");
 
   ASSERT_SOME(os::mkdir(flags.work_dir));
 
@@ -771,16 +775,19 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_WorkDirMountNotNeeded)
 // shared mount in its own peer group.
 TEST_F(LinuxFilesystemIsolatorTest, ROOT_WorkDirMountNeeded)
 {
+  Try<string> directory = environment->mkdtemp();
+  ASSERT_SOME(directory);
+
   // Make 'sandbox' a private mount.
   ASSERT_SOME(os::shell(
       "mount --bind %s %s && "
       "mount --make-private %s",
-      sandbox->c_str(),
-      sandbox->c_str(),
-      sandbox->c_str()));
+      directory->c_str(),
+      directory->c_str(),
+      directory->c_str()));
 
   slave::Flags flags = CreateSlaveFlags();
-  flags.work_dir = path::join(sandbox.get(), "slave");
+  flags.work_dir = path::join(directory.get(), "slave");
 
   ASSERT_SOME(os::mkdir(flags.work_dir));