You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2017/03/25 19:06:49 UTC

[13/14] mesos git commit: Added a new unmocked method to the mock agent.

Added a new unmocked method to the mock agent.

This patch adds a new method to the mock agent,
`MockSlave::unmocked_executorTerminated`. This will
facilitate the testing of executor secret generation,
as it allows us to forward the mock function call to
the base class method.

Review: https://reviews.apache.org/r/57891/


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

Branch: refs/heads/master
Commit: d11dd0e6c1daa9724642ad57db94bdfd12436d22
Parents: ca58a52
Author: Greg Mann <gr...@mesosphere.io>
Authored: Sat Mar 25 12:06:06 2017 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Sat Mar 25 12:06:06 2017 -0700

----------------------------------------------------------------------
 src/tests/mock_slave.cpp | 13 +++++++++++++
 src/tests/mock_slave.hpp |  6 ++++++
 2 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d11dd0e6/src/tests/mock_slave.cpp
----------------------------------------------------------------------
diff --git a/src/tests/mock_slave.cpp b/src/tests/mock_slave.cpp
index f145c5c..35cd13d 100644
--- a/src/tests/mock_slave.cpp
+++ b/src/tests/mock_slave.cpp
@@ -35,6 +35,8 @@
 
 using mesos::master::detector::MasterDetector;
 
+using mesos::slave::ContainerTermination;
+
 using std::list;
 
 using process::Future;
@@ -139,6 +141,8 @@ MockSlave::MockSlave(
     .WillRepeatedly(Invoke(this, &MockSlave::unmocked_qosCorrections));
   EXPECT_CALL(*this, usage())
     .WillRepeatedly(Invoke(this, &MockSlave::unmocked_usage));
+  EXPECT_CALL(*this, executorTerminated(_, _, _))
+    .WillRepeatedly(Invoke(this, &MockSlave::unmocked_executorTerminated));
 }
 
 
@@ -224,6 +228,15 @@ Future<ResourceUsage> MockSlave::unmocked_usage()
   return slave::Slave::usage();
 }
 
+
+void MockSlave::unmocked_executorTerminated(
+    const FrameworkID& frameworkId,
+    const ExecutorID& executorId,
+    const Future<Option<ContainerTermination>>& termination)
+{
+  slave::Slave::executorTerminated(frameworkId, executorId, termination);
+}
+
 } // namespace tests {
 } // namespace internal {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/d11dd0e6/src/tests/mock_slave.hpp
----------------------------------------------------------------------
diff --git a/src/tests/mock_slave.hpp b/src/tests/mock_slave.hpp
index 979ac59..2b30b87 100644
--- a/src/tests/mock_slave.hpp
+++ b/src/tests/mock_slave.hpp
@@ -195,6 +195,12 @@ public:
       const process::Future<Option<
           mesos::slave::ContainerTermination>>& termination));
 
+  void unmocked_executorTerminated(
+      const FrameworkID& frameworkId,
+      const ExecutorID& executorId,
+      const process::Future<Option<
+          mesos::slave::ContainerTermination>>& termination);
+
 private:
   Files files;
   MockGarbageCollector gc;