Preserve device DM regression coverage with explicit mode

This commit is contained in:
evgeny committed 2026-11-03 12:34:38 +01:00
1 parent ce8f9d53f9
commit c2e503a90a
3 files changed
+7 -6

No files matched your search

+4 -3
View File
@@ -120,7 +120,7 @@ static int peer(struct UTUN_INSTANCE* inst, struct UTUN_INSTANCE* other, const c
int rc = sqlite3_step(st);
sqlite3_finalize(st);
return rc == SQLITE_DONE ? dm_start(inst, other->node_id, other->my_keys.public_key,
other->my_ed25519_pubkey, "peer", group) : -1;
other->my_ed25519_pubkey, "peer", group, DM_MODE_DEVICE, NULL) : -1;
}
static struct UTUN_INSTANCE* start(struct UASYNC* ua, const char* directory, int index, struct SC_MYKEYS* identity) {
@@ -161,7 +161,8 @@ static int exercise(struct UTUN_INSTANCE* inst, struct UTUN_INSTANCE* other, con
fault_query = op == OP_FILE ? "SELECT peer_x25519 FROM dm_conversations" : "SELECT peer_node_id, peer_x25519, peer_ed25519";
injections = 0; fault = failure;
int rc = -1;
if (op == OP_START) rc = dm_start(inst, other->node_id, other->my_keys.public_key, other->my_ed25519_pubkey, "changed", "99");
if (op == OP_START) rc = dm_start(inst, other->node_id, other->my_keys.public_key, other->my_ed25519_pubkey,
"changed", "99", DM_MODE_DEVICE, NULL);
else if (op == OP_RECEIVE) rc = dm_accept_message(inst, body, bytes, receipt);
else if (op == OP_SEND) rc = dm_send(inst, conv, "text", (const uint8_t*)"rejected", 8);
else if (op == OP_LIST) {
@@ -236,7 +237,7 @@ int main(void) {
}
utun_instance_destroy(b); b = start(ua, directory, 1, &identities[1]); CHECK(b);
CHECK(dm_history_generation(b, conv) == 2 && scalar(b->topo_sqlite_db, "SELECT hidden FROM dm_history") == 1);
CHECK(!dm_start(b, a->node_id, a->my_keys.public_key, a->my_ed25519_pubkey, "peer", group_id));
CHECK(!dm_start(b, a->node_id, a->my_keys.public_key, a->my_ed25519_pubkey, "peer", group_id, DM_MODE_DEVICE, NULL));
CHECK(!dm_send(b, conv, "text", (const uint8_t*)"after restart", 13));
CHECK(scalar(b->topo_sqlite_db, "SELECT last_out_seq FROM dm_conversations") == 2);
CHECK(!dm_accept_message(b, first, first_len, receipt) && !dm_verify_receipt(a, receipt, first, first_len));