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/05/05 19:25:10 UTC
[1/4] mesos git commit: Removed "__linux__" marco in filesystem
isolator tests.
Repository: mesos
Updated Branches:
refs/heads/master 466a960d5 -> 906f7d722
Removed "__linux__" marco in filesystem isolator tests.
Review: https://reviews.apache.org/r/44425/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3dd8ef1d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3dd8ef1d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3dd8ef1d
Branch: refs/heads/master
Commit: 3dd8ef1d08e91b49628151c9dc78faae43b90aa6
Parents: 466a960
Author: Guangya Liu <gy...@gmail.com>
Authored: Thu May 5 12:21:11 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu May 5 12:22:27 2016 -0700
----------------------------------------------------------------------
.../containerizer/filesystem_isolator_tests.cpp | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3dd8ef1d/src/tests/containerizer/filesystem_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/filesystem_isolator_tests.cpp b/src/tests/containerizer/filesystem_isolator_tests.cpp
index 84ee944..acde788 100644
--- a/src/tests/containerizer/filesystem_isolator_tests.cpp
+++ b/src/tests/containerizer/filesystem_isolator_tests.cpp
@@ -33,23 +33,16 @@
#include <stout/path.hpp>
#include <stout/uuid.hpp>
-#ifdef __linux__
#include "linux/fs.hpp"
-#endif
#include "slave/paths.hpp"
-#ifdef __linux__
+#include "slave/containerizer/mesos/containerizer.hpp"
#include "slave/containerizer/mesos/linux_launcher.hpp"
#include "slave/containerizer/mesos/isolators/filesystem/linux.hpp"
-#endif
-
-#include "slave/containerizer/mesos/containerizer.hpp"
-
#include "slave/containerizer/mesos/provisioner/backend.hpp"
#include "slave/containerizer/mesos/provisioner/paths.hpp"
-
#include "slave/containerizer/mesos/provisioner/backends/copy.hpp"
#include "tests/flags.hpp"
@@ -58,7 +51,10 @@
#include "tests/containerizer/rootfs.hpp"
#include "tests/containerizer/store.hpp"
-using namespace process;
+using process::Future;
+using process::Owned;
+using process::PID;
+using process::Shared;
using std::string;
using std::vector;
@@ -68,10 +64,8 @@ using mesos::internal::master::Master;
using mesos::internal::slave::Backend;
using mesos::internal::slave::Fetcher;
using mesos::internal::slave::Launcher;
-#ifdef __linux__
using mesos::internal::slave::LinuxFilesystemIsolatorProcess;
using mesos::internal::slave::LinuxLauncher;
-#endif
using mesos::internal::slave::MesosContainerizer;
using mesos::internal::slave::MesosContainerizerProcess;
using mesos::internal::slave::Provisioner;
@@ -88,7 +82,6 @@ namespace mesos {
namespace internal {
namespace tests {
-#ifdef __linux__
class LinuxFilesystemIsolatorTest : public MesosTest
{
protected:
@@ -1552,8 +1545,6 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_VolumeUsageExceedsSandboxQuota)
driver.join();
}
-#endif // __linux__
-
} // namespace tests {
} // namespace internal {
} // namespace mesos {
[3/4] mesos git commit: Updated indent when creating MockScheduler.
Posted by ji...@apache.org.
Updated indent when creating MockScheduler.
Review: https://reviews.apache.org/r/44390/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3cd98b01
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3cd98b01
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3cd98b01
Branch: refs/heads/master
Commit: 3cd98b01881f6da8cecef0dbf95e8b119ec295a2
Parents: cde03e1
Author: Guangya Liu <gy...@gmail.com>
Authored: Thu May 5 12:23:58 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu May 5 12:23:58 2016 -0700
----------------------------------------------------------------------
.../containerizer/filesystem_isolator_tests.cpp | 28 ++++++++++++++++----
1 file changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3cd98b01/src/tests/containerizer/filesystem_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/filesystem_isolator_tests.cpp b/src/tests/containerizer/filesystem_isolator_tests.cpp
index b5739ba..cf80aec 100644
--- a/src/tests/containerizer/filesystem_isolator_tests.cpp
+++ b/src/tests/containerizer/filesystem_isolator_tests.cpp
@@ -304,8 +304,12 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystemCommandExecutor)
ASSERT_SOME(slave);
MockScheduler sched;
+
MesosSchedulerDriver driver(
- &sched, DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+ &sched,
+ DEFAULT_FRAMEWORK_INFO,
+ master.get()->pid,
+ DEFAULT_CREDENTIAL);
Future<FrameworkID> frameworkId;
EXPECT_CALL(sched, registered(&driver, _, _))
@@ -382,8 +386,12 @@ TEST_F(LinuxFilesystemIsolatorTest,
ASSERT_SOME(slave);
MockScheduler sched;
+
MesosSchedulerDriver driver(
- &sched, DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+ &sched,
+ DEFAULT_FRAMEWORK_INFO,
+ master.get()->pid,
+ DEFAULT_CREDENTIAL);
Future<FrameworkID> frameworkId;
EXPECT_CALL(sched, registered(&driver, _, _))
@@ -487,7 +495,10 @@ TEST_F(LinuxFilesystemIsolatorTest,
frameworkInfo.set_role("role1");
MesosSchedulerDriver driver(
- &sched, frameworkInfo, master.get()->pid, DEFAULT_CREDENTIAL);
+ &sched,
+ frameworkInfo,
+ master.get()->pid,
+ DEFAULT_CREDENTIAL);
Future<FrameworkID> frameworkId;
EXPECT_CALL(sched, registered(&driver, _, _))
@@ -614,7 +625,10 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_RecoverOrphanedPersistentVolume)
frameworkInfo.set_checkpoint(true);
MesosSchedulerDriver driver(
- &sched, frameworkInfo, master.get()->pid, DEFAULT_CREDENTIAL);
+ &sched,
+ frameworkInfo,
+ master.get()->pid,
+ DEFAULT_CREDENTIAL);
Future<FrameworkID> frameworkId;
EXPECT_CALL(sched, registered(&driver, _, _))
@@ -1468,8 +1482,12 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_VolumeUsageExceedsSandboxQuota)
ASSERT_SOME(slave);
MockScheduler sched;
+
MesosSchedulerDriver driver(
- &sched, frameworkInfo, master.get()->pid, DEFAULT_CREDENTIAL);
+ &sched,
+ frameworkInfo,
+ master.get()->pid,
+ DEFAULT_CREDENTIAL);
Future<FrameworkID> frameworkId;
EXPECT_CALL(sched, registered(&driver, _, _))
[4/4] mesos git commit: Replaced ".get().xxx" with "->xxx" in
filesystem isolator tests.
Posted by ji...@apache.org.
Replaced ".get().xxx" with "->xxx" in filesystem isolator tests.
Review: https://reviews.apache.org/r/44160/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/906f7d72
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/906f7d72
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/906f7d72
Branch: refs/heads/master
Commit: 906f7d7220086daca9ddc7217936324de0cc4742
Parents: 3cd98b0
Author: Guangya Liu <gy...@gmail.com>
Authored: Thu May 5 12:24:55 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu May 5 12:24:55 2016 -0700
----------------------------------------------------------------------
.../containerizer/filesystem_isolator_tests.cpp | 34 ++++++++++----------
1 file changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/906f7d72/src/tests/containerizer/filesystem_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/filesystem_isolator_tests.cpp b/src/tests/containerizer/filesystem_isolator_tests.cpp
index cf80aec..4293416 100644
--- a/src/tests/containerizer/filesystem_isolator_tests.cpp
+++ b/src/tests/containerizer/filesystem_isolator_tests.cpp
@@ -325,7 +325,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystemCommandExecutor)
AWAIT_READY(frameworkId);
AWAIT_READY(offers);
- ASSERT_NE(0u, offers.get().size());
+ ASSERT_NE(0u, offers->size());
const Offer& offer = offers.get()[0];
@@ -341,7 +341,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystemCommandExecutor)
containerInfo.set_type(ContainerInfo::MESOS);
task.mutable_container()->CopyFrom(containerInfo);
- driver.launchTasks(offers.get()[0].id(), {task});
+ driver.launchTasks(offer.id(), {task});
Future<TaskStatus> statusRunning;
Future<TaskStatus> statusFinished;
@@ -352,9 +352,9 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystemCommandExecutor)
// Need to wait for Rootfs copying.
AWAIT_READY_FOR(statusRunning, Seconds(60));
- EXPECT_EQ(TASK_RUNNING, statusRunning.get().state());
+ EXPECT_EQ(TASK_RUNNING, statusRunning->state());
AWAIT_READY(statusFinished);
- EXPECT_EQ(TASK_FINISHED, statusFinished.get().state());
+ EXPECT_EQ(TASK_FINISHED, statusFinished->state());
driver.stop();
driver.join();
@@ -407,7 +407,7 @@ TEST_F(LinuxFilesystemIsolatorTest,
AWAIT_READY(frameworkId);
AWAIT_READY(offers);
- ASSERT_NE(0u, offers.get().size());
+ ASSERT_NE(0u, offers->size());
const Offer& offer = offers.get()[0];
@@ -443,7 +443,7 @@ TEST_F(LinuxFilesystemIsolatorTest,
createVolumeFromHostPath("relative_dir", dir2, Volume::RW));
task.mutable_container()->CopyFrom(containerInfo);
- driver.launchTasks(offers.get()[0].id(), {task});
+ driver.launchTasks(offer.id(), {task});
Future<TaskStatus> statusRunning;
Future<TaskStatus> statusFinished;
@@ -453,9 +453,9 @@ TEST_F(LinuxFilesystemIsolatorTest,
.WillOnce(FutureArg<1>(&statusFinished));
AWAIT_READY(statusRunning);
- EXPECT_EQ(TASK_RUNNING, statusRunning.get().state());
+ EXPECT_EQ(TASK_RUNNING, statusRunning->state());
AWAIT_READY(statusFinished);
- EXPECT_EQ(TASK_FINISHED, statusFinished.get().state());
+ EXPECT_EQ(TASK_FINISHED, statusFinished->state());
driver.stop();
driver.join();
@@ -514,7 +514,7 @@ TEST_F(LinuxFilesystemIsolatorTest,
AWAIT_READY(frameworkId);
AWAIT_READY(offers);
- ASSERT_NE(0u, offers.get().size());
+ ASSERT_NE(0u, offers->size());
Offer offer = offers.get()[0];
@@ -562,9 +562,9 @@ TEST_F(LinuxFilesystemIsolatorTest,
.WillOnce(FutureArg<1>(&statusFinished));
AWAIT_READY(statusRunning);
- EXPECT_EQ(TASK_RUNNING, statusRunning.get().state());
+ EXPECT_EQ(TASK_RUNNING, statusRunning->state());
AWAIT_READY(statusFinished);
- EXPECT_EQ(TASK_FINISHED, statusFinished.get().state());
+ EXPECT_EQ(TASK_FINISHED, statusFinished->state());
// NOTE: The command executor's id is the same as the task id.
ExecutorID executorId;
@@ -644,7 +644,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_RecoverOrphanedPersistentVolume)
AWAIT_READY(frameworkId);
AWAIT_READY(offers);
- EXPECT_FALSE(offers.get().empty());
+ EXPECT_FALSE(offers->empty());
Offer offer = offers.get()[0];
@@ -1503,7 +1503,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_VolumeUsageExceedsSandboxQuota)
AWAIT_READY(frameworkId);
AWAIT_READY(offers);
- ASSERT_NE(0u, offers.get().size());
+ ASSERT_NE(0u, offers->size());
// We request a sandbox (1MB) that is smaller than the persistent
// volume (4MB) and attempt to create a file in that volume that is
@@ -1536,12 +1536,12 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_VolumeUsageExceedsSandboxQuota)
LAUNCH({task})});
AWAIT_READY(statusRunning);
- EXPECT_EQ(task.task_id(), statusRunning.get().task_id());
- EXPECT_EQ(TASK_RUNNING, statusRunning.get().state());
+ EXPECT_EQ(task.task_id(), statusRunning->task_id());
+ EXPECT_EQ(TASK_RUNNING, statusRunning->state());
AWAIT_READY(statusFinished);
- EXPECT_EQ(task.task_id(), statusFinished.get().task_id());
- EXPECT_EQ(TASK_FINISHED, statusFinished.get().state());
+ EXPECT_EQ(task.task_id(), statusFinished->task_id());
+ EXPECT_EQ(TASK_FINISHED, statusFinished->state());
driver.stop();
driver.join();
[2/4] mesos git commit: Removed unused variables from filesystem
isolator test.
Posted by ji...@apache.org.
Removed unused variables from filesystem isolator test.
Review: https://reviews.apache.org/r/41439/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cde03e17
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cde03e17
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cde03e17
Branch: refs/heads/master
Commit: cde03e17fde1e9ba6b69c807e6e561668d2cf086
Parents: 3dd8ef1
Author: Guangya Liu <gy...@gmail.com>
Authored: Thu May 5 12:23:06 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu May 5 12:23:06 2016 -0700
----------------------------------------------------------------------
.../containerizer/filesystem_isolator_tests.cpp | 16 ----------------
1 file changed, 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/cde03e17/src/tests/containerizer/filesystem_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/filesystem_isolator_tests.cpp b/src/tests/containerizer/filesystem_isolator_tests.cpp
index acde788..b5739ba 100644
--- a/src/tests/containerizer/filesystem_isolator_tests.cpp
+++ b/src/tests/containerizer/filesystem_isolator_tests.cpp
@@ -291,9 +291,6 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystemCommandExecutor)
slave::Flags flags = CreateSlaveFlags();
flags.image_provisioner_backend = "copy";
- ContainerID containerId;
- containerId.set_value(UUID::random().toString());
-
Try<Owned<MesosContainerizer>> containerizer = createContainerizer(
flags,
{{"test_image", path::join(os::getcwd(), "test_image")}});
@@ -328,8 +325,6 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystemCommandExecutor)
const Offer& offer = offers.get()[0];
- SlaveID slaveId = offer.slave_id();
-
TaskInfo task = createTask(
offer.slave_id(),
offer.resources(),
@@ -374,9 +369,6 @@ TEST_F(LinuxFilesystemIsolatorTest,
slave::Flags flags = CreateSlaveFlags();
flags.image_provisioner_backend = "copy";
- ContainerID containerId;
- containerId.set_value(UUID::random().toString());
-
Try<Owned<MesosContainerizer>> containerizer = createContainerizer(
flags,
{{"test_image", path::join(os::getcwd(), "test_image")}});
@@ -411,8 +403,6 @@ TEST_F(LinuxFilesystemIsolatorTest,
const Offer& offer = offers.get()[0];
- SlaveID slaveId = offer.slave_id();
-
// Preparing two volumes:
// - host_path: dir1, container_path: /tmp
// - host_path: dir2, container_path: relative_dir
@@ -480,9 +470,6 @@ TEST_F(LinuxFilesystemIsolatorTest,
// within the slave work_dir and thus not retrievable.
flags.work_dir = os::getcwd();
- ContainerID containerId;
- containerId.set_value(UUID::random().toString());
-
Try<Owned<MesosContainerizer>> containerizer = createContainerizer(
flags,
{{"test_image", path::join(os::getcwd(), "test_image")}});
@@ -609,9 +596,6 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_RecoverOrphanedPersistentVolume)
flags.resources = "cpus:2;mem:1024;disk(role1):1024";
flags.isolation = "posix/disk,filesystem/linux";
- ContainerID containerId;
- containerId.set_value(UUID::random().toString());
-
Try<Owned<MesosContainerizer>> containerizer = createContainerizer(
flags,
{{"test_image", path::join(os::getcwd(), "test_image")}});