test/sandbox: check pd behaviour
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (race detector) (push) Successful in 42s
Test / Hakurei (push) Successful in 44s
Test / Sandbox (push) Successful in 42s
Test / Hakurei (race detector) (push) Successful in 45s
Test / Hpkg (push) Successful in 43s
Test / Flake checks (push) Successful in 1m23s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-01 02:11:19 +09:00
parent f14e7255be
commit 987981df73
4 changed files with 230 additions and 15 deletions

View File

@@ -6,6 +6,7 @@
}:
let
testProgram = pkgs.callPackage ./tool/package.nix { inherit (config.environment.hakurei.package) version; };
testCases = import ./case pkgs.system lib testProgram;
in
{
users.users = {
@@ -26,6 +27,13 @@ in
systemPackages = [
# For checking seccomp outcome:
testProgram
# For checking pd outcome:
(pkgs.writeShellScriptBin "check-sandbox-pd" ''
hakurei -v run hakurei-test \
-t ${toString (builtins.toFile "hakurei-pd-want.json" (builtins.toJSON testCases.pd.want))} \
-s ${testCases.pd.expectedFilter.${pkgs.system}} "$@"
'')
];
variables = {
@@ -75,6 +83,6 @@ in
}
];
apps = import ./case pkgs.system lib testProgram;
inherit (testCases) apps;
};
}