static void test_case_key_rotation_05(void **state);
static bool test_key_rotation_05(void);
-static void log_cb(meshlink_handle_t *mesh, meshlink_log_level_t level, const char *text) {
-
- static const char *levelstr[] = {
- [MESHLINK_DEBUG] = "\x1b[34mDEBUG",
- [MESHLINK_INFO] = "\x1b[32mINFO",
- [MESHLINK_WARNING] = "\x1b[33mWARNING",
- [MESHLINK_ERROR] = "\x1b[31mERROR",
- [MESHLINK_CRITICAL] = "\x1b[31mCRITICAL",
- };
-
- fprintf(stderr, "%s(%s):\x1b[0m %s\n", mesh->name, levelstr[level], text);
-}
-
/* Execute key rotation Test Case # 1 - Sanity test */
static void test_case_key_rotation_01(void **state) {
execute_test(test_key_rotation_01, state);
static int break_stage;
static void nop_stage(int stage) {
+ (void)stage;
+
return;
}
// Terminate the node at the specified stage (by @ break_stage @ )
if(stage == break_stage) {
raise(SIGINT);
- } else if((break_stage < 1) || (break_stage > 11)) {
+ } else if((break_stage < 1) || (break_stage > 3)) {
fprintf(stderr, "INVALID stage break\n");
raise(SIGABRT);
}
// incrementally debug meshlink_encrypted_key_rotate API atomicity
- for(break_stage = 1; break_stage <= 10; break_stage += 1) {
+ for(break_stage = 1; break_stage <= 3; break_stage += 1) {
fprintf(stderr, "Debugging stage %d\n", break_stage);
meshlink_destroy("encrypted_conf");
meshlink_destroy("encrypted_conf.1");
- set_sync_flag(&status_changed_cond, false);
- bar_reachable = false;
-
meshlink_handle_t *mesh2 = meshlink_open("encrypted_conf.1", "bar", "bar", DEV_CLASS_BACKBONE);
assert(mesh2);
- meshlink_set_node_status_cb(mesh2, node_status_cb);
meshlink_set_log_cb(mesh2, MESHLINK_DEBUG, log_cb);
meshlink_enable_discovery(mesh2, false);