X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fblackbox%2Frun_blackbox_tests%2Ftest_optimal_pmtu.c;h=d7463e761e36c139bd03ecf48e6d892d720a2a97;hb=f1da50294494310d7a299c29af5649d4415bd38a;hp=2cb605ae57ac0bf22b17d3d848b34e8c349edf26;hpb=a65fbef9ae9c314940e8977d10bdd761cc52b0ad;p=meshlink diff --git a/test/blackbox/run_blackbox_tests/test_optimal_pmtu.c b/test/blackbox/run_blackbox_tests/test_optimal_pmtu.c index 2cb605ae..d7463e76 100644 --- a/test/blackbox/run_blackbox_tests/test_optimal_pmtu.c +++ b/test/blackbox/run_blackbox_tests/test_optimal_pmtu.c @@ -16,6 +16,11 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + +#ifdef NDEBUG +#undef NDEBUG +#endif + #include #include #include @@ -61,6 +66,8 @@ struct sync_flag test_pmtu_nut_closed = {.mutex = PTHREAD_MUTEX_INITIALIZER, .c static netns_state_t *test_pmtu_state; static int setup_test(void **state) { + (void)state; + netns_create_topology(test_pmtu_state); fprintf(stderr, "\nCreated topology\n"); @@ -68,7 +75,7 @@ static int setup_test(void **state) { test_pmtu_peer_running = true; test_pmtu_nut_running = true; ping_channel_enable_07 = false; - memset(node_pmtu, 2, sizeof(node_pmtu[0])); + memset(node_pmtu, 0, sizeof(node_pmtu)); set_sync_flag(&test_pmtu_nut_closed, false); meshlink_destroy("nut"); meshlink_destroy("peer"); @@ -78,6 +85,8 @@ static int setup_test(void **state) { } static int teardown_test(void **state) { + (void)state; + meshlink_destroy("nut"); meshlink_destroy("peer"); meshlink_destroy("relay"); @@ -87,6 +96,8 @@ static int teardown_test(void **state) { } static void execute_test(test_step_func_t step_func, void **state) { + (void)state; + fprintf(stderr, "\n\x1b[32mRunning Test\x1b[0m\n"); bool test_result = step_func(); @@ -106,6 +117,8 @@ static void *gen_inv(void *arg) { assert(invitation); mesh_invite_arg->invite_str = invitation; meshlink_close(mesh); + + return NULL; } /* Test Steps for optimal PMTU discovery Test Case # 1 - @@ -417,6 +430,8 @@ static void test_case_optimal_pmtu_06(void **state) { static bool run_conntrack; static pthread_t pmtu_test_case_conntrack_thread; static void *conntrack_flush(void *arg) { + (void)arg; + // flushes mappings for every 60 seconds while(run_conntrack) {