clanService/phonebox-global: unit tests for the directory sync logic

Add a flake check `phonebox-global-sync` that exercises phonebox-sync.py:
yggdrasil address derivation (fixed vector plus cross-check against the
yggdrasil binary), record verification (foreign address, bad or forged
signature, malformed tags, number format), collision tie-breaking, and
the files written for the dialplan including stale entry removal.
This commit is contained in:
2026-09-18 09:55:21 +00:00
parent f398daacb5
commit f58da21d15
2 changed files with 181 additions and 1 deletions
+17 -1
View File
@@ -11,7 +11,7 @@ in
phonebox-global = module;
};
perSystem =
{ ... }:
{ pkgs, ... }:
{
clan.nixosTests.service-phonebox-global = {
imports = [ ./tests/vm/default.nix ];
@@ -19,5 +19,21 @@ in
clan.modules."@clan/phonebox-global" = module;
};
# Unit tests for the directory sync logic (record verification,
# address derivation, collision handling, file output).
checks.phonebox-global-sync =
pkgs.runCommand "phonebox-global-sync-test"
{
nativeBuildInputs = [
(pkgs.python3.withPackages (ps: [ ps.cryptography ]))
pkgs.yggdrasil
];
PHONEBOX_SYNC = ./phonebox-sync.py;
}
''
python3 ${./tests/sync/test_sync.py} -v
touch $out
'';
};
}