]> git.meshlink.io Git - meshlink/blob - test/blackbox/common/containers.h
Add the blackbox channel connection tests.
[meshlink] / test / blackbox / common / containers.h
1 /*
2     containers.h -- Declarations for Container Management API
3     Copyright (C) 2018  Guus Sliepen <guus@meshlink.io>
4                         Manav Kumar Mehta <manavkumarm@yahoo.com>
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License along
17     with this program; if not, write to the Free Software Foundation, Inc.,
18     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #ifndef CONTAINERS_H
22 #define CONTAINERS_H
23
24 #include <lxc/lxccontainer.h>
25
26 #define DAEMON_ARGV_LEN 200
27 #define CONTAINER_SHUTDOWN_TIMEOUT 5
28
29 extern char *lxc_path;
30
31 extern struct lxc_container *find_container(const char *name);
32 extern void rename_container(const char *old_name, const char *new_name);
33 extern char *run_in_container(const char *cmd, const char *node, bool daemonize);
34 extern void container_wait_ip(int node);
35 extern void create_containers(const char *node_names[], int num_nodes);
36 extern void setup_containers(void **state);
37 extern void destroy_containers(void);
38 extern void restart_all_containers(void);
39 extern char *invite_in_container(const char *inviter, const char *invitee);
40 extern void node_sim_in_container(const char *node, const char *device_class, const char *invite_url);
41 extern void node_sim_in_container_event(const char *node, const char *device_class,
42                                         const char *invite_url, const char *clientId, const char *import);
43 extern void node_step_in_container(const char *node, const char *sig);
44 extern void change_ip(int node);
45
46 extern char *get_container_ip(const char *node_name);
47 extern void install_in_container(const char *node, const char *app);
48 extern void unblock_node_ip(const char *node);
49 extern void block_node_ip(const char *node);
50 void accept_port_rule(const char *node, const char *chain, const char *protocol, int port);
51
52 #endif // CONTAINERS_H