Seed admission state in isolated topology and NAT fixtures
This commit is contained in:
1 parent
8f85ed9d17
commit
b6ea2ed401
3 files changed
+3
-1
No files matched your search
@@ -84,6 +84,7 @@ static void create(struct fixture* f, int device, int supernode) {
|
||||
assert(topo_node_sqlite_addrs_put(db, node->node_id, node) == 0);
|
||||
assert(topo_node_sqlite_member_block_put(db, "42", node->node_id, sig, 1, sig, 1,
|
||||
node->public_key, node->ed25519_public_key, "{}", NULL, 0, sig) == 0);
|
||||
assert(sqlite3_exec(db, "UPDATE peers_42 SET admitted=1", NULL, NULL, NULL) == SQLITE_OK);
|
||||
if (i < 3) assert(topo_node_sqlite_member_owner_put(db, "42", node->node_id, "{\"supernode\":\"yes\"}", sig, 0) == 0);
|
||||
assert(topo_node_sqlite_nodeinfo_updated(db, node->node_id) == 0);
|
||||
topo_node_sqlite_update_rtt(db, node->node_id, (uint16_t)(i + 1));
|
||||
|
||||
@@ -252,6 +252,7 @@ static void test_all_groups_tcp(void) {
|
||||
assert(!topo_node_sqlite_member_block_put(db, "42", nodes[j]->node_id, signature, 1, signature, 1,
|
||||
nodes[j]->my_keys.public_key, nodes[j]->my_ed25519_pubkey, "{}", NULL, 0, signature));
|
||||
}
|
||||
assert(sqlite3_exec(db, "UPDATE peers_42 SET admitted=1", NULL, NULL, NULL) == SQLITE_OK);
|
||||
groups[i] = topo_groups_create_group(nodes[i]->topo_groups, 42, TOPO_GROUP_TYPE_CHAT, "42");
|
||||
assert(groups[i]);
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ static void test_snapshot_format_upgrade(struct UTUN_INSTANCE* inst) {
|
||||
assert(!topo_node_sqlite_channel_put(db, "123", "upgrade", 7, inst->my_keys.public_key, NULL, inst->my_ed25519_pubkey, NULL,
|
||||
(const uint8_t[64]){0}));
|
||||
assert(!topo_node_sqlite_member_placeholder_put(db, "123", 7, inst->my_keys.public_key, inst->my_ed25519_pubkey));
|
||||
assert(sqlite3_exec(db, "UPDATE peers_123 SET source=0", NULL, NULL, NULL) == SQLITE_OK);
|
||||
assert(sqlite3_exec(db, "UPDATE peers_123 SET source=0,admitted=1", NULL, NULL, NULL) == SQLITE_OK);
|
||||
struct topo_connect_peer* peers = NULL; size_t count = 0;
|
||||
assert(!topo_node_sqlite_get_connect_peers(db, "123", &peers, &count) && count == 1 && peers[0].client_type == UINT8_MAX);
|
||||
u_free(peers);
|
||||
|
||||
Reference in new issue
Block a user