test/sandbox: expose test tool
All checks were successful
Test / Create distribution (push) Successful in 27s
Test / Fpkg (push) Successful in 34s
Test / Fortify (push) Successful in 2m22s
Test / Data race detector (push) Successful in 3m11s
Test / Flake checks (push) Successful in 56s

Some test elements implemented in the test tool might need to run outside the sandbox. This change allows that to happen.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-03-28 00:08:47 +09:00
parent d97a03c7c6
commit faf59e12c0
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q

View File

@ -46,6 +46,10 @@ let
go mod init git.gensokyo.uk/security/fortify/test >& /dev/null go mod init git.gensokyo.uk/security/fortify/test >& /dev/null
cp ${./main.go} main.go cp ${./main.go} main.go
''; '';
postInstall = ''
mv $out/bin/test $out/bin/fortify-test
'';
}; };
callTestCase = callTestCase =
@ -65,7 +69,7 @@ let
inherit (tc) tty mapRealUid; inherit (tc) tty mapRealUid;
share = foot; share = foot;
packages = [ ]; packages = [ ];
path = "${checkSandbox}/bin/test"; path = "${checkSandbox}/bin/fortify-test";
args = [ args = [
"test" "test"
(toString (writeText "fortify-${tc.name}-want.json" (builtins.toJSON tc.want))) (toString (writeText "fortify-${tc.name}-want.json" (builtins.toJSON tc.want)))
@ -76,4 +80,6 @@ in
preset = callTestCase ./preset.nix; preset = callTestCase ./preset.nix;
tty = callTestCase ./tty.nix; tty = callTestCase ./tty.nix;
mapuid = callTestCase ./mapuid.nix; mapuid = callTestCase ./mapuid.nix;
_testProgram = checkSandbox;
} }