]> git.meshlink.io Git - meshlink/blob - test/blackbox/common/containers.h
Add the blackbox container based test suite.
[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 struct lxc_container *find_container(const char *name);
32 void rename_container(const char *old_name, const char *new_name);
33 char *run_in_container(const char *cmd, const char *node, bool daemonize);
34 void container_wait_ip(int node);
35 void create_containers(const char *node_names[], int num_nodes);
36 void setup_containers(void **state);
37 void destroy_containers(void);
38 void restart_all_containers(void);
39 char *invite_in_container(const char *inviter, const char *invitee);
40 void node_sim_in_container(const char *node, const char *device_class, const char *invite_url);
41 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 void node_step_in_container(const char *node, const char *sig);
44 void change_ip(int node);
45
46 char *get_container_ip(int node);
47
48 #endif // CONTAINERS_H