|
|
|
|
@ -16,6 +16,7 @@
|
|
|
|
|
#include "../transport_layer/etcp.h" |
|
|
|
|
#include "../config_parser.h" |
|
|
|
|
#include "../config_updater.h" |
|
|
|
|
#include "test_utils.h" |
|
|
|
|
#include "../routing_layer/topo_group.h" |
|
|
|
|
#include "../routing_layer/topo_node.h" |
|
|
|
|
#include "../lib/u_async.h" |
|
|
|
|
@ -58,14 +59,7 @@ static char* gv(const char* p, const char* k) {
|
|
|
|
|
free_config(c); return r; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void test_mkdtemp(char* tmpl) { |
|
|
|
|
(void)!mkdtemp(tmpl); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void test_unlink(const char* p) { unlink(p); } |
|
|
|
|
static void test_rmdir(const char* p) { |
|
|
|
|
char cmd[512]; snprintf(cmd, sizeof(cmd), "rm -rf %s", p); system(cmd); |
|
|
|
|
} |
|
|
|
|
/* ── helpers ── */ |
|
|
|
|
|
|
|
|
|
static int count_rows(sqlite3* db, const char* tbl, const char* where, uint64_t val) { |
|
|
|
|
char sql[256]; |
|
|
|
|
@ -303,6 +297,6 @@ done:
|
|
|
|
|
if (g_a) { g_a->running = 0; utun_instance_destroy(g_a); g_a = NULL; } |
|
|
|
|
if (g_b) { g_b->running = 0; utun_instance_destroy(g_b); g_b = NULL; } |
|
|
|
|
if (g_ua) { uasync_destroy(g_ua, 0); g_ua = NULL; } |
|
|
|
|
test_rmdir(g_tdir); |
|
|
|
|
{ char cmd[512]; snprintf(cmd, sizeof(cmd), "rm -rf %s", g_tdir); system(cmd); } |
|
|
|
|
return g_failed > 0 ? 1 : 0; |
|
|
|
|
} |
|
|
|
|
|