You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2013/03/16 00:51:59 UTC

svn commit: r1457164 [2/2] - in /incubator/mesos/trunk/src: ./ examples/ launcher/ local/ slave/ tests/

Modified: incubator/mesos/trunk/src/tests/master_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/master_tests.cpp?rev=1457164&r1=1457163&r2=1457164&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/master_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/master_tests.cpp Fri Mar 15 23:51:58 2013
@@ -108,9 +108,9 @@ TEST_F(MasterTest, TaskRunning)
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -151,7 +151,7 @@ TEST_F(MasterTest, TaskRunning)
   vector<TaskInfo> tasks;
   tasks.push_back(task);
 
-  EXPECT_CALL(isolationModule,
+  EXPECT_CALL(isolator,
               resourcesChanged(_, _, Resources(offers[0].resources())))
     .WillOnce(Trigger(&resourcesChangedCall));
 
@@ -202,10 +202,10 @@ TEST_F(MasterTest, ShutdownFrameworkWhil
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
   slaveFlags.executor_shutdown_grace_period = Seconds(0.0);
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -245,7 +245,7 @@ TEST_F(MasterTest, ShutdownFrameworkWhil
   vector<TaskInfo> tasks;
   tasks.push_back(task);
 
-  EXPECT_CALL(isolationModule,
+  EXPECT_CALL(isolator,
               resourcesChanged(_, _, Resources(offers[0].resources())))
     .WillOnce(Trigger(&resourcesChangedCall));
 
@@ -299,9 +299,9 @@ TEST_F(MasterTest, KillTask)
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -394,9 +394,9 @@ TEST_F(MasterTest, StatusUpdateAck)
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -482,11 +482,11 @@ TEST_F(MasterTest, RecoverResources)
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
   setSlaveResources("cpus:2;mem:1024;disk:1024;ports:[1-10, 20-30]");
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -576,7 +576,7 @@ TEST_F(MasterTest, RecoverResources)
   driver.declineOffer(offer.id());
 
   // Kill the executor.
-  isolationModule.killExecutor(
+  isolator.killExecutor(
       offer.framework_id(), executorInfo.executor_id());
 
   // Scheduler should get an offer for the complete slave resources.
@@ -636,9 +636,9 @@ TEST_F(MasterTest, FrameworkMessage)
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -774,9 +774,9 @@ TEST_F(MasterTest, MultipleExecutors)
   execs[executorId1] = &exec1;
   execs[executorId2] = &exec2;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -880,9 +880,9 @@ TEST_F(MasterTest, MasterInfo)
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -934,9 +934,9 @@ TEST_F(MasterTest, MasterInfoOnReElectio
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -1035,9 +1035,9 @@ TEST_F(WhitelistTest, WhitelistSlave)
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);
@@ -1103,9 +1103,9 @@ TEST_F(MasterTest, MasterLost)
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(slaveFlags, true, &isolationModule, &files);
+  Slave s(slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);

Modified: incubator/mesos/trunk/src/tests/monitor_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/monitor_tests.cpp?rev=1457164&r1=1457163&r2=1457164&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/monitor_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/monitor_tests.cpp Fri Mar 15 23:51:58 2013
@@ -53,8 +53,8 @@ using std::string;
 // TODO(bmahler): Add additional tests:
 //   1. Check that the data has been published to statistics.
 //   2. Check that metering is occurring on subsequent resource data.
-//   3. Add tests for process based isolation usage.
-//   4. Add tests for cgroups based isolation usage.
+//   3. Add tests for process isolator usage.
+//   4. Add tests for cgroups isolator usage.
 TEST(MonitorTest, WatchUnwatch)
 {
   FrameworkID frameworkId;
@@ -75,15 +75,15 @@ TEST(MonitorTest, WatchUnwatch)
   statistics.set_memory_rss(1024);
 
   std::map<ExecutorID, Executor*> execs;
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  process::spawn(isolationModule);
+  process::spawn(isolator);
 
-  EXPECT_CALL(isolationModule, usage(frameworkId, executorId))
+  EXPECT_CALL(isolator, usage(frameworkId, executorId))
     .WillRepeatedly(Return(statistics));
 
   // Monitor the executor.
-  slave::ResourceMonitor monitor(&isolationModule);
+  slave::ResourceMonitor monitor(&isolator);
   monitor.watch(
       frameworkId,
       executorId,
@@ -125,7 +125,7 @@ TEST(MonitorTest, WatchUnwatch)
           statistics.memory_rss()).get(),
       response);
 
-  // Ensure the monitor stops polling the isolation module.
+  // Ensure the monitor stops polling the isolator.
   monitor.unwatch(frameworkId, executorId);
 
   process::Clock::advance(slave::RESOURCE_MONITORING_INTERVAL.secs());

Modified: incubator/mesos/trunk/src/tests/resource_offers_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/resource_offers_tests.cpp?rev=1457164&r1=1457163&r2=1457164&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/resource_offers_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/resource_offers_tests.cpp Fri Mar 15 23:51:58 2013
@@ -546,9 +546,9 @@ TEST_F(MultipleExecutorsTest, TasksExecu
   map<ExecutorID, Executor*> execs;
   execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-  TestingIsolationModule isolationModule(execs);
+  TestingIsolator isolator(execs);
 
-  Slave s(this->slaveFlags, true, &isolationModule, &files);
+  Slave s(this->slaveFlags, true, &isolator, &files);
   PID<Slave> slave = process::spawn(&s);
 
   BasicMasterDetector detector(master, slave, true);

Modified: incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp?rev=1457164&r1=1457163&r2=1457164&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp Fri Mar 15 23:51:58 2013
@@ -46,10 +46,10 @@
 #include "master/master.hpp"
 
 #ifdef __linux__
-#include "slave/cgroups_isolation_module.hpp"
+#include "slave/cgroups_isolator.hpp"
 #endif
 #include "slave/paths.hpp"
-#include "slave/process_based_isolation_module.hpp"
+#include "slave/process_isolator.hpp"
 #include "slave/reaper.hpp"
 #include "slave/slave.hpp"
 #include "slave/state.hpp"
@@ -72,9 +72,9 @@ using mesos::internal::master::Hierarchi
 using mesos::internal::master::Master;
 
 #ifdef __linux__
-using mesos::internal::slave::CgroupsIsolationModule;
+using mesos::internal::slave::CgroupsIsolator;
 #endif
-using mesos::internal::slave::ProcessBasedIsolationModule;
+using mesos::internal::slave::ProcessIsolator;
 
 using std::map;
 using std::string;
@@ -135,17 +135,17 @@ TEST_F(SlaveStateTest, CheckpointString)
 
 
 template <typename T>
-class SlaveRecoveryTest : public IsolationTest<T>
+class SlaveRecoveryTest : public IsolatorTest<T>
 {
 public:
   static void SetUpTestCase()
   {
-    IsolationTest<T>::SetUpTestCase();
+    IsolatorTest<T>::SetUpTestCase();
   }
 
   virtual void SetUp()
   {
-    IsolationTest<T>::SetUp();
+    IsolatorTest<T>::SetUp();
 
     ASSERT_TRUE(GTEST_IS_THREADSAFE);
 
@@ -170,14 +170,14 @@ public:
     delete m;
     delete a;
 
-    IsolationTest<T>::TearDown();
+    IsolatorTest<T>::TearDown();
   }
 
 protected:
   void startSlave()
   {
-    isolationModule = new T();
-    s = new Slave(this->slaveFlags, true, isolationModule, &files);
+    isolator = new T();
+    s = new Slave(this->slaveFlags, true, isolator, &files);
     slave = process::spawn(s);
     detector = new BasicMasterDetector(master, slave, true);
 
@@ -199,7 +199,7 @@ protected:
     }
     process::wait(slave);
     delete s;
-    delete isolationModule;
+    delete isolator;
 
     running = false;
   }
@@ -207,7 +207,7 @@ protected:
   HierarchicalDRFAllocatorProcess allocator;
   Allocator *a;
   Master* m;
-  IsolationModule* isolationModule;
+  Isolator* isolator;
   Slave* s;
   Files files;
   BasicMasterDetector* detector;
@@ -218,14 +218,13 @@ protected:
 
 
 #ifdef __linux__
-typedef ::testing::Types<ProcessBasedIsolationModule, CgroupsIsolationModule>
-IsolationTypes;
+typedef ::testing::Types<ProcessIsolator, CgroupsIsolator> IsolatorTypes;
 #else
-typedef ::testing::Types<ProcessBasedIsolationModule> IsolationTypes;
+typedef ::testing::Types<ProcessIsolator> IsolatorTypes;
 #endif
 
 
-TYPED_TEST_CASE(SlaveRecoveryTest, IsolationTypes);
+TYPED_TEST_CASE(SlaveRecoveryTest, IsolatorTypes);
 
 
 // Enable checkpointing on the slave and ensure recovery works.

Modified: incubator/mesos/trunk/src/tests/status_update_manager_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/status_update_manager_tests.cpp?rev=1457164&r1=1457163&r2=1457164&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/status_update_manager_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/status_update_manager_tests.cpp Fri Mar 15 23:51:58 2013
@@ -40,7 +40,7 @@
 
 #include "slave/constants.hpp"
 #include "slave/paths.hpp"
-#include "slave/process_based_isolation_module.hpp"
+#include "slave/process_isolator.hpp"
 #include "slave/slave.hpp"
 
 #include "messages/messages.hpp"
@@ -93,9 +93,9 @@ protected:
 
     execs[DEFAULT_EXECUTOR_ID] = &exec;
 
-    isolationModule = new TestingIsolationModule(execs);
+    isolator = new TestingIsolator(execs);
 
-    s = new Slave(flags, true, isolationModule, &files);
+    s = new Slave(flags, true, isolator, &files);
     slave = process::spawn(s);
 
     detector = new BasicMasterDetector(master, slave, true);
@@ -112,7 +112,7 @@ protected:
     process::wait(slave);
     delete s;
 
-    delete isolationModule;
+    delete isolator;
     process::terminate(master);
     process::wait(master);
     delete m;
@@ -139,7 +139,7 @@ protected:
   HierarchicalDRFAllocatorProcess allocator;
   Allocator *a;
   Master* m;
-  TestingIsolationModule* isolationModule;
+  TestingIsolator* isolator;
   Slave* s;
   Files files;
   BasicMasterDetector* detector;

Modified: incubator/mesos/trunk/src/tests/utils.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/utils.hpp?rev=1457164&r1=1457163&r2=1457164&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/utils.hpp (original)
+++ incubator/mesos/trunk/src/tests/utils.hpp Fri Mar 15 23:51:58 2013
@@ -62,9 +62,9 @@
 #include "messages/messages.hpp"
 
 #ifdef __linux__
-#include "slave/cgroups_isolation_module.hpp"
+#include "slave/cgroups_isolator.hpp"
 #endif
-#include "slave/isolation_module.hpp"
+#include "slave/isolator.hpp"
 #include "slave/reaper.hpp"
 #include "slave/slave.hpp"
 #include "slave/state.hpp"
@@ -85,7 +85,7 @@ extern flags::Flags<logging::Flags, Flag
 
 
 #ifdef __linux__
-using slave::CgroupsIsolationModule;
+using slave::CgroupsIsolator;
 
 // Cgroups hierarchy used by the cgroups related tests.
 const static std::string TEST_CGROUPS_HIERARCHY = "/tmp/mesos_test_cgroup";
@@ -156,13 +156,13 @@ protected:
 
 
 template <typename T>
-class IsolationTest : public MesosTest
+class IsolatorTest : public MesosTest
 {};
 
 
 #ifdef __linux__
 template <>
-class IsolationTest<CgroupsIsolationModule> : public MesosTest
+class IsolatorTest<CgroupsIsolator> : public MesosTest
 {
 public:
   static void SetUpTestCase()
@@ -761,10 +761,10 @@ ACTION_P(SendStatusUpdateFromTaskID, sta
   WAIT_FOR(expression, Seconds(2.0))
 
 
-class TestingIsolationModule : public slave::IsolationModule
+class TestingIsolator : public slave::Isolator
 {
 public:
-  TestingIsolationModule(const std::map<ExecutorID, Executor*>& _executors)
+  TestingIsolator(const std::map<ExecutorID, Executor*>& _executors)
     : executors(_executors)
   {
     EXPECT_CALL(*this, resourcesChanged(testing::_, testing::_, testing::_))
@@ -778,7 +778,7 @@ public:
       .WillRepeatedly(Return(Nothing()));
   }
 
-  virtual ~TestingIsolationModule() {}
+  virtual ~TestingIsolator() {}
 
   virtual void initialize(
       const slave::Flags& flags,