Align ETCP fixtures with NCD identity and failed-open contracts

This commit is contained in:
evgeny committed 2026-10-24 20:20:09 +02:00
1 parent 702389d8d9
commit a3f004772a
2 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -118,7 +118,7 @@ static void test3(void* arg) {
(void)arg; if (result) return;
fprintf(stderr, "Test 3: unreachable node → error\n"); fflush(stderr);
struct SC_MYKEYS fk; sc_generate_keypair(&fk);
uint64_t fnid = 0xF000000000000001ULL;
uint64_t fnid = sc_derive_node_id_from_pubkey(fk.public_key);
struct TOPO_GROUP_NODE* fn = mknode(g_a, fnid, fk.public_key, 127,0,0,1, 49999);
if (!fn) { fail("mknode failed"); return; }
queue_data_put_with_index(topo_groups_get_default(g_a->topo_groups)->nodes, &fn->ll);
@@ -148,7 +148,7 @@ static void test5(void* arg) {
(void)arg; if (result) return;
fprintf(stderr, "Test 5: double connect to unreachable → both callbacks\n"); fflush(stderr);
struct SC_MYKEYS fk; sc_generate_keypair(&fk);
uint64_t fnid = 0xF000000000000002ULL;
uint64_t fnid = sc_derive_node_id_from_pubkey(fk.public_key);
struct TOPO_GROUP_NODE* fn = mknode(g_a, fnid, fk.public_key, 127,0,0,1, 49998);
if (!fn) { fail("mknode failed"); return; }
queue_data_put_with_index(topo_groups_get_default(g_a->topo_groups)->nodes, &fn->ll);
+2 -1
View File
@@ -437,7 +437,8 @@ static void tcp_creation_case(int reality, int side, unsigned action) {
else etcp_add_link_status_cbk(inst, cancel_tcp_creation, &test);
int result = node_conn_direct_open_node(endpoints[0].inst, peer->node_id, NULL, NULL,
&endpoints[0].owner, peer, NULL);
CHECK(result >= 0 || (side == 0 && (action == 2 || action == 4)));
if (side == 0 && action != 3) CHECK(result == NCD_ERR && !endpoints[0].owner);
else CHECK(result >= 0 && endpoints[0].owner);
uint64_t deadline = get_time_tb() + 30000;
while (!test.fired && get_time_tb() < deadline) test_clock_poll(ua, 100);
CHECK(test.fired == 1);