Seed completed admission in isolated history synchronization tests

This commit is contained in:
evgeny committed 2026-11-03 16:31:13 +01:00
1 parent 626fa26a5b
commit 90b90738f1
2 files changed
+6

No files matched your search

+4
View File
@@ -137,6 +137,10 @@ static void seed_members(struct UTUN_INSTANCE* self, struct UTUN_INSTANCE* peer)
NULL, 0, peer->my_keys.public_key, peer->my_ed25519_pubkey, "{}", NULL, 0, z64) < 0) {
DEBUG_ERROR(DEBUG_CATEGORY_CHAT_SYNC, "stress member fixture failed peer=%016llx", (unsigned long long)peer->node_id); abort();
}
if (topo_node_sqlite_member_block_put(db, ch_id, self->node_id, z64, 1, NULL, 0,
self->my_keys.public_key, self->my_ed25519_pubkey, "{}", NULL, 0, z64) < 0) abort();
char admission[96]; snprintf(admission, sizeof(admission), "UPDATE peers_%s SET admitted=1", ch_id);
if (sqlite3_exec(db, admission, NULL, NULL, NULL) != SQLITE_OK) abort();
if (!topo_groups_find(self->topo_groups, INSTANCE_ID))
topo_groups_create_group(self->topo_groups, INSTANCE_ID, TOPO_GROUP_TYPE_CHAT, ch_id);
}
+2
View File
@@ -239,6 +239,8 @@ static void seed_members(struct UTUN_INSTANCE* self, struct UTUN_INSTANCE** peer
DEBUG_ERROR(DEBUG_CATEGORY_CHAT_SYNC, "member fixture failed peer=%016llx", (unsigned long long)peer->node_id); abort();
}
}
char admission[96]; snprintf(admission, sizeof(admission), "UPDATE peers_%s SET admitted=1", groups[gi]);
if (sqlite3_exec(db, admission, NULL, NULL, NULL) != SQLITE_OK) abort();
uint64_t gid = strtoull(groups[gi], NULL, 10);
if (!topo_groups_find(self->topo_groups, gid))
topo_groups_create_group(self->topo_groups, gid, TOPO_GROUP_TYPE_CHAT, groups[gi]);