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:
@@ -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
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user