Apache Mesos
launcher.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __TEST_LAUNCHER_HPP__
18 #define __TEST_LAUNCHER_HPP__
19 
20 #include <list>
21 #include <map>
22 #include <string>
23 #include <vector>
24 
25 #include <gmock/gmock.h>
26 
27 #include <mesos/mesos.hpp>
28 
29 #include <mesos/slave/isolator.hpp>
30 
31 #include <process/future.hpp>
32 #include <process/owned.hpp>
33 #include <process/subprocess.hpp>
34 
35 #include <stout/flags.hpp>
36 #include <stout/lambda.hpp>
37 #include <stout/nothing.hpp>
38 #include <stout/option.hpp>
39 
41 
42 namespace mesos {
43 namespace internal {
44 namespace tests {
45 
46 
48 {
49 public:
51 
52  ~TestLauncher();
53 
55  recover,
57  const std::list<mesos::slave::ContainerState>& states));
58 
60  fork,
61  Try<pid_t>(
62  const ContainerID& containerId,
63  const std::string& path,
64  const std::vector<std::string>& argv,
65  const process::Subprocess::IO& in,
66  const process::Subprocess::IO& out,
67  const process::Subprocess::IO& err,
68  const flags::FlagsBase* flags,
69  const Option<std::map<std::string, std::string>>& env,
70  const Option<int>& enterNamespaces,
71  const Option<int>& cloneNamespaces));
72 
74  destroy,
75  process::Future<Nothing>(const ContainerID& containerId));
76 
78  status,
79  process::Future<ContainerStatus>(const ContainerID& containerId));
80 
82 };
83 
84 } // namespace tests {
85 } // namespace internal {
86 } // namespace mesos {
87 
88 #endif // __TEST_LAUNCHER_HPP__
Definition: launcher.hpp:46
Definition: option.hpp:28
Definition: try.hpp:34
MOCK_METHOD10(fork, Try< pid_t >(const ContainerID &containerId, const std::string &path, const std::vector< std::string > &argv, const process::Subprocess::IO &in, const process::Subprocess::IO &out, const process::Subprocess::IO &err, const flags::FlagsBase *flags, const Option< std::map< std::string, std::string >> &env, const Option< int > &enterNamespaces, const Option< int > &cloneNamespaces))
TestLauncher(const process::Owned< slave::Launcher > &_real)
virtual process::Future< Nothing > destroy(const ContainerID &containerId)=0
Describes how the I/O is redirected for stdin/stdout/stderr.
Definition: subprocess.hpp:61
Definition: flags.hpp:44
MOCK_METHOD1(recover, process::Future< hashset< ContainerID >>(const std::list< mesos::slave::ContainerState > &states))
Definition: launcher.hpp:47
virtual process::Future< hashset< ContainerID > > recover(const std::list< mesos::slave::ContainerState > &states)=0
virtual process::Future< ContainerStatus > status(const ContainerID &containerId)=0
process::Owned< slave::Launcher > real
Definition: launcher.hpp:81
virtual Try< pid_t > fork(const ContainerID &containerId, const std::string &path, const std::vector< std::string > &argv, const process::Subprocess::IO &in, const process::Subprocess::IO &out, const process::Subprocess::IO &err, const flags::FlagsBase *flags, const Option< std::map< std::string, std::string >> &environment, const Option< int > &enterNamespaces, const Option< int > &cloneNamespaces)=0
Definition: future.hpp:57