2 run_blackbox_tests.c -- Implementation of Black Box Test Execution for meshlink
4 Copyright (C) 2019 Guus Sliepen <guus@meshlink.io>
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.
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.
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.
30 #include "execute_tests.h"
31 #include "test_cases.h"
32 #include "test_cases_open.h"
33 #include "test_cases_start.h"
34 #include "test_cases_stop_close.h"
35 #include "test_cases_send.h"
36 #include "test_cases_pmtu.h"
37 #include "test_cases_get_self.h"
38 #include "test_cases_get_node.h"
39 #include "test_cases_add_addr.h"
40 #include "test_cases_get_ex_addr.h"
41 #include "test_cases_add_ex_addr.h"
42 #include "test_cases_get_port.h"
43 #include "test_cases_blacklist.h"
44 #include "test_cases_default_blacklist.h"
45 #include "test_cases_whitelist.h"
46 #include "test_cases_channel_open.h"
47 #include "test_cases_channel_close.h"
48 #include "test_cases_channel_send.h"
49 #include "test_cases_channel_shutdown.h"
51 #include "test_cases_destroy.h"
52 #include "test_cases_get_all_nodes.h"
53 #include "test_cases_get_fingerprint.h"
54 #include "test_cases_rec_cb.h"
55 #include "test_cases_sign.h"
56 #include "test_cases_set_port.h"
57 #include "test_cases_verify.h"
58 #include "test_cases_invite.h"
59 #include "test_cases_export.h"
60 #include "test_cases_channel_ex.h"
61 #include "test_cases_channel_get_flags.h"
62 #include "test_cases_status_cb.h"
63 #include "test_cases_set_log_cb.h"
64 #include "test_cases_join.h"
65 #include "test_cases_import.h"
66 #include "test_cases_channel_set_accept_cb.h"
67 #include "test_cases_channel_set_poll_cb.h"
68 #include "test_cases_channel_set_receive_cb.h"
69 #include "test_cases_hint_address.h"
70 #include "test_optimal_pmtu.h"
71 #include "test_cases_key_rotation.h"
73 #include "test_cases_channel_conn.h"
74 #include "test_cases_get_all_nodes_by_dev_class.h"
75 #include "test_cases_submesh01.h"
76 #include "test_cases_submesh02.h"
77 #include "test_cases_submesh03.h"
78 #include "test_cases_submesh04.h"
79 #include "test_cases_autoconnect.h"
80 #include "test_cases_set_connection_try_cb.h"
82 #include "test_cases_random_port_bindings01.h"
83 #include "test_cases_random_port_bindings02.h"
85 #include "test_cases_get_node_reachability.h"
87 #include "../common/containers.h"
88 #include "../common/common_handlers.h"
90 char *meshlink_root_path = NULL;
91 char *choose_arch = NULL;
94 int main(int argc, char *argv[]) {
95 /* Set configuration */
97 meshlink_root_path = argv[1];
100 eth_if_name = argv[4];
101 choose_arch = argv[5];
103 int failed_tests = 0;
105 failed_tests += test_meta_conn();
106 failed_tests += test_meshlink_set_status_cb();
107 failed_tests += test_meshlink_join();
108 failed_tests += test_meshlink_set_channel_poll_cb();
109 failed_tests += test_meshlink_channel_open_ex();
110 failed_tests += test_meshlink_channel_get_flags();
111 failed_tests += test_meshlink_set_channel_accept_cb();
112 failed_tests += test_meshlink_destroy();
113 failed_tests += test_meshlink_export();
114 failed_tests += test_meshlink_get_fingerprint();
115 failed_tests += test_meshlink_get_all_nodes();
116 failed_tests += test_meshlink_get_all_node_by_device_class();
117 failed_tests += test_meshlink_set_port();
118 failed_tests += test_meshlink_sign();
119 failed_tests += test_meshlink_verify();
120 failed_tests += test_meshlink_import();
121 failed_tests += test_meshlink_invite();
122 failed_tests += test_meshlink_set_receive_cb();
123 failed_tests += test_meshlink_set_log_cb();
124 failed_tests += test_meshlink_set_channel_receive_cb();
125 failed_tests += test_meshlink_hint_address();
127 failed_tests += test_meshlink_open();
128 failed_tests += test_meshlink_start();
129 failed_tests += test_meshlink_stop_close();
130 failed_tests += test_meshlink_send();
131 failed_tests += test_meshlink_channel_send();
132 failed_tests += test_meshlink_channel_shutdown();
133 failed_tests += test_meshlink_pmtu();
134 failed_tests += test_meshlink_get_self();
135 failed_tests += test_meshlink_get_node();
136 failed_tests += test_meshlink_add_address();
137 failed_tests += test_meshlink_get_external_address();
138 failed_tests += test_meshlink_add_external_address();
139 failed_tests += test_meshlink_get_port();
140 failed_tests += test_meshlink_blacklist();
141 failed_tests += test_meshlink_whitelist();
142 failed_tests += test_meshlink_default_blacklist();
143 failed_tests += test_meshlink_channel_open();
144 failed_tests += test_meshlink_channel_close();
146 failed_tests += test_meshlink_channel_conn();
147 failed_tests += test_optimal_pmtu();
149 failed_tests += test_cases_submesh01();
150 failed_tests += test_cases_submesh02();
151 failed_tests += test_cases_submesh03();
152 failed_tests += test_cases_submesh04();
154 failed_tests += test_meshlink_autoconnect();
155 failed_tests += test_cases_connection_try();
157 failed_tests += test_optimal_pmtu();
158 failed_tests += test_meshlink_encrypted_key_rotation();
160 failed_tests += test_meshlink_random_port_bindings01();
161 failed_tests += test_meshlink_random_port_bindings02();
163 failed_tests += test_get_node_reachability();
165 printf("[ PASSED ] %d test(s).\n", total_tests - failed_tests);
166 printf("[ FAILED ] %d test(s).\n", failed_tests);