X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=test%2Fblackbox%2Fcommon%2Fcontainers.h;fp=test%2Fblackbox%2Fcommon%2Fcontainers.h;h=49cbb7c3c4d21e5d48196b9b0a87be7000b35050;hb=dc68da94af8fca91748579c84ef5ed798db7efab;hp=0000000000000000000000000000000000000000;hpb=1a7277c64d74ae5ae18c48ebe09a522ffe7c696b;p=meshlink diff --git a/test/blackbox/common/containers.h b/test/blackbox/common/containers.h new file mode 100644 index 00000000..49cbb7c3 --- /dev/null +++ b/test/blackbox/common/containers.h @@ -0,0 +1,48 @@ +/* + containers.h -- Declarations for Container Management API + Copyright (C) 2018 Guus Sliepen + Manav Kumar Mehta + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef CONTAINERS_H +#define CONTAINERS_H + +#include + +#define DAEMON_ARGV_LEN 200 +#define CONTAINER_SHUTDOWN_TIMEOUT 5 + +extern char *lxc_path; + +struct lxc_container *find_container(const char *name); +void rename_container(const char *old_name, const char *new_name); +char *run_in_container(const char *cmd, const char *node, bool daemonize); +void container_wait_ip(int node); +void create_containers(const char *node_names[], int num_nodes); +void setup_containers(void **state); +void destroy_containers(void); +void restart_all_containers(void); +char *invite_in_container(const char *inviter, const char *invitee); +void node_sim_in_container(const char *node, const char *device_class, const char *invite_url); +void node_sim_in_container_event(const char *node, const char *device_class, + const char *invite_url, const char *clientId, const char *import); +void node_step_in_container(const char *node, const char *sig); +void change_ip(int node); + +char *get_container_ip(int node); + +#endif // CONTAINERS_H