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 <map>
21 #include <string>
22 #include <vector>
23 
24 #include <gmock/gmock.h>
25 
26 #include <mesos/mesos.hpp>
27 
28 #include <mesos/slave/isolator.hpp>
29 
30 #include <process/future.hpp>
31 #include <process/owned.hpp>
32 #include <process/subprocess.hpp>
33 
34 #include <stout/flags.hpp>
35 #include <stout/lambda.hpp>
36 #include <stout/nothing.hpp>
37 #include <stout/option.hpp>
38 
40 
41 namespace mesos {
42 namespace internal {
43 namespace tests {
44 
45 
47 {
48 public:
50 
51  ~TestLauncher() override;
52 
54  recover,
56  const std::vector<mesos::slave::ContainerState>& states));
57 
59  fork,
60  Try<pid_t>(
61  const ContainerID& containerId,
62  const std::string& path,
63  const std::vector<std::string>& argv,
64  const mesos::slave::ContainerIO& containerIO,
65  const flags::FlagsBase* flags,
66  const Option<std::map<std::string, std::string>>& env,
67  const Option<int>& enterNamespaces,
68  const Option<int>& cloneNamespaces,
69  const std::vector<int_fd>& whitelistFds));
70 
72  destroy,
73  process::Future<Nothing>(const ContainerID& containerId));
74 
76  status,
77  process::Future<ContainerStatus>(const ContainerID& containerId));
78 
80 };
81 
82 } // namespace tests {
83 } // namespace internal {
84 } // namespace mesos {
85 
86 #endif // __TEST_LAUNCHER_HPP__
Definition: path.hpp:29
Definition: launcher.hpp:47
Definition: option.hpp:29
virtual process::Future< hashset< ContainerID > > recover(const std::vector< mesos::slave::ContainerState > &states)=0
Definition: check.hpp:33
virtual Try< pid_t > fork(const ContainerID &containerId, const std::string &path, const std::vector< std::string > &argv, const mesos::slave::ContainerIO &containerIO, const flags::FlagsBase *flags, const Option< std::map< std::string, std::string >> &environment, const Option< int > &enterNamespaces, const Option< int > &cloneNamespaces, const std::vector< int_fd > &whitelistFds)=0
TestLauncher(const process::Owned< slave::Launcher > &_real)
An abstraction around the IO classes used to redirect stdin/stdout/stderr to/from a container by the ...
Definition: containerizer.hpp:37
MOCK_METHOD1(recover, process::Future< hashset< ContainerID >>(const std::vector< mesos::slave::ContainerState > &states))
virtual process::Future< Nothing > destroy(const ContainerID &containerId)=0
Definition: flags.hpp:44
Definition: agent.hpp:25
Definition: launcher.hpp:46
MOCK_METHOD9(fork, Try< pid_t >(const ContainerID &containerId, const std::string &path, const std::vector< std::string > &argv, const mesos::slave::ContainerIO &containerIO, const flags::FlagsBase *flags, const Option< std::map< std::string, std::string >> &env, const Option< int > &enterNamespaces, const Option< int > &cloneNamespaces, const std::vector< int_fd > &whitelistFds))
Definition: attributes.hpp:24
virtual process::Future< ContainerStatus > status(const ContainerID &containerId)=0
process::Owned< slave::Launcher > real
Definition: launcher.hpp:79
Definition: parse.hpp:33
Definition: future.hpp:58