X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fserver_container.h;h=c65065aa1eb53113844b5d1330f8f22f901f4229;hb=9069819ac2940397e96210867e0666b801b97f60;hp=9c9922ed0ed6b30c1a58b51e052826d7b6affaa9;hpb=27ee6d2aea6210eaca004475600aba78b7170883;p=m6w6%2Flibmemcached diff --git a/libtest/server_container.h b/libtest/server_container.h index 9c9922ed..c65065aa 100644 --- a/libtest/server_container.h +++ b/libtest/server_container.h @@ -35,9 +35,11 @@ namespace libtest { class server_startup_st { private: + uint64_t _magic; std::string server_list; bool _socket; bool _sasl; + uint32_t _count; std::string _username; std::string _password; @@ -46,21 +48,22 @@ public: uint8_t udp; std::vector servers; - server_startup_st() : - _socket(false), - _sasl(false), - udp(0) - { } + server_startup_st(); + ~server_startup_st(); - bool start_socket_server(const std::string& server_type, const in_port_t try_port, int argc, const char *argv[]); + bool validate(); - std::string option_string() const; + bool start_socket_server(const std::string& server_type, const in_port_t try_port, int argc, const char *argv[]); - size_t count() const + uint32_t count() const { return servers.size(); } + void restart(); + + std::string option_string() const; + const std::string& password() const { return _password; @@ -71,11 +74,6 @@ public: return _username; } - - bool is_debug() const; - bool is_helgrind() const; - bool is_valgrind() const; - bool socket() { return _socket; @@ -99,13 +97,29 @@ public: } - void shutdown(bool remove= false); + void shutdown_and_remove(); + bool shutdown(); + bool shutdown(uint32_t number_of_host); + + bool check() const; + void push_server(Server *); Server *pop_server(); - ~server_startup_st(); + unsigned long int servers_to_run() const + { + return _servers_to_run; + } + + void set_servers_to_run(unsigned long int arg) + { + _servers_to_run= arg; + } + +private: + unsigned long int _servers_to_run; }; -bool server_startup(server_startup_st&, const std::string&, in_port_t try_port, int argc, const char *argv[]); +bool server_startup(server_startup_st&, const std::string&, in_port_t try_port, int argc, const char *argv[], const bool opt_startup_message= true); } // namespace libtest