17 #ifndef __TESTS_MOCKDOCKER_HPP__ 18 #define __TESTS_MOCKDOCKER_HPP__ 24 #include <gmock/gmock.h> 42 using ::testing::Invoke;
55 const std::string&
path,
56 const std::string& socket,
111 const std::string& directory,
112 const std::string&
image,
119 const std::string& containerName,
127 const std::string& containerName,
155 EXPECT_CALL(*
this,
launch(_, _, _, _))
158 EXPECT_CALL(*
this,
update(_, _, _))
166 const mesos::slave::ContainerConfig&,
167 const std::map<std::string, std::string>&,
175 const google::protobuf::Map<std::string, Value::Scalar>&));
180 const ContainerID& containerId,
181 const mesos::slave::ContainerConfig& containerConfig,
182 const std::map<std::string, std::string>&
environment,
193 const ContainerID& containerId,
195 const google::protobuf::Map<std::string, Value::Scalar>& resourceLimits)
242 #endif // __TESTS_MOCKDOCKER_HPP__
virtual process::Future< Nothing > pull(const ContainerID &containerId)
Definition: mock_docker.hpp:136
Try< bool > update(const std::string &link, const Handle &parent, uint16_t protocol, const action::Mirror &mirror)
Definition: fetcher.hpp:49
Definition: docker.hpp:67
MockDocker(const std::string &path, const std::string &socket, const Option< JSON::Object > &config=None())
process::Future< Nothing > _stop(const std::string &containerName, const Duration &timeout, bool remove) const
Definition: mock_docker.hpp:118
Definition: mock_docker.hpp:207
constexpr const char * prefix
Definition: os.hpp:96
process::Future< Nothing > update(const ContainerID &containerId, const Resources &resourceRequests, const google::protobuf::Map< std::string, Value::Scalar > &resourceLimits={}) override
virtual process::Future< std::vector< Container > > ps(bool all=false, const Option< std::string > &prefix=None()) const
Definition: resources.hpp:83
Definition: docker.hpp:127
Try< T > fetch(const std::string &value)
Definition: fetch.hpp:38
virtual process::Future< Image > pull(const std::string &directory, const std::string &image, bool force=false) const
Definition: duration.hpp:32
process::Future< Nothing > _fetch(const ContainerID &containerId)
Definition: mock_docker.hpp:227
virtual process::Future< Container > inspect(const std::string &containerName, const Option< Duration > &retryInterval=None()) const
MOCK_CONST_METHOD3(run, process::Future< Option< int >>(const Docker::RunOptions &options, const process::Subprocess::IO &, const process::Subprocess::IO &))
Environment * environment
process::Future< Containerizer::LaunchResult > launch(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig, const std::map< std::string, std::string > &environment, const Option< std::string > &pidCheckpointPath) override
process::Future< Option< int > > _run(const Docker::RunOptions &runOptions, const process::Subprocess::IO &_stdout, const process::Subprocess::IO &_stderr) const
Definition: mock_docker.hpp:92
process::PID< master::Master > launch(const Flags &flags, mesos::allocator::Allocator *_allocator=nullptr)
process::Future< Docker::Container > _inspect(const std::string &containerName, const Option< Duration > &retryInterval)
Definition: mock_docker.hpp:126
Definition: components.hpp:34
Describes how the I/O is redirected for stdin/stdout/stderr.
Definition: subprocess.hpp:62
Definition: mock_docker.hpp:51
virtual process::Future< Nothing > fetch(const ContainerID &containerId)
MOCK_CONST_METHOD2(ps, process::Future< std::vector< Docker::Container >>(bool, const Option< std::string > &))
process::Future< std::vector< Docker::Container > > _ps(bool all, const Option< std::string > &prefix) const
Definition: mock_docker.hpp:103
Definition: docker.hpp:57
URI image(const std::string &repository, const std::string &reference, const std::string ®istry, const Option< std::string > &scheme=None(), const Option< int > &port=None())
Definition: docker.hpp:30
process::Future< Nothing > _pull(const ContainerID &containerId)
Definition: mock_docker.hpp:232
Definition: attributes.hpp:24
Definition: executor.hpp:48
process::Future< slave::Containerizer::LaunchResult > _launch(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig, const std::map< std::string, std::string > &environment, const Option< std::string > &pidCheckpointPath)
Definition: mock_docker.hpp:179
process::Future< Docker::Image > _pull(const std::string &directory, const std::string &image, bool force) const
Definition: mock_docker.hpp:110
void initialize()
Definition: mock_docker.hpp:150
virtual process::Future< Option< int > > run(const RunOptions &options, const process::Subprocess::IO &_stdout=process::Subprocess::FD(STDOUT_FILENO), const process::Subprocess::IO &_stderr=process::Subprocess::FD(STDERR_FILENO)) const
process::Future< Nothing > _update(const ContainerID &containerId, const Resources &resourceRequests, const google::protobuf::Map< std::string, Value::Scalar > &resourceLimits)
Definition: mock_docker.hpp:192
Definition: docker.hpp:177
virtual process::Future< Nothing > stop(const std::string &containerName, const Duration &timeout=Seconds(0), bool remove=false) const
Definition: future.hpp:58