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:47 UTC

[11/14] mesos git commit: Added a 'MockSecretGenerator'.

Added a 'MockSecretGenerator'.

This patch adds a mock secret generator, which will
be used for testing failure scenarios involving
executor secret generation.

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


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

Branch: refs/heads/master
Commit: 8f35d5269d844f361e4a544ce50cf2230c247001
Parents: 3d82286
Author: Greg Mann <gr...@mesosphere.io>
Authored: Sat Mar 25 12:05:58 2017 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Sat Mar 25 12:05:58 2017 -0700

----------------------------------------------------------------------
 src/tests/mesos.hpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8f35d526/src/tests/mesos.hpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp
index e4a8a42..a7d33ad 100644
--- a/src/tests/mesos.hpp
+++ b/src/tests/mesos.hpp
@@ -34,6 +34,8 @@
 
 #include <mesos/v1/scheduler/scheduler.hpp>
 
+#include <mesos/authentication/secret_generator.hpp>
+
 #include <mesos/authorizer/authorizer.hpp>
 
 #include <mesos/fetcher/fetcher.hpp>
@@ -2143,6 +2145,17 @@ public:
 };
 
 
+class MockSecretGenerator : public SecretGenerator
+{
+public:
+  MockSecretGenerator() = default;
+  virtual ~MockSecretGenerator() = default;
+
+  MOCK_METHOD1(generate, process::Future<Secret>(
+      const process::http::authentication::Principal& principal));
+};
+
+
 ACTION_P(SendStatusUpdateFromTask, state)
 {
   TaskStatus status;