aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sandbox/case/default.nix
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-23 14:14:45 +0900
committerOphestra <cat@gensokyo.uk>2025-03-23 14:53:50 +0900
commit75e0c5d4061d68dc4802285ec137e464f4e01b17 (patch)
treeb8307fa68188bac4c522afc36c27a5c1fb7c02da /test/sandbox/case/default.nix
parent770b37ae166a18f495865e96ccafc6f9fb9f4e88 (diff)
test/sandbox: parse full test case
This makes declaring multiple tests much cleaner. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/sandbox/case/default.nix')
-rw-r--r--test/sandbox/case/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/sandbox/case/default.nix b/test/sandbox/case/default.nix
new file mode 100644
index 00000000..b65b6ed2
--- /dev/null
+++ b/test/sandbox/case/default.nix
@@ -0,0 +1,57 @@
+{
+ lib,
+ callPackage,
+ foot,
+
+ version,
+}:
+let
+ fs = mode: dir: data: {
+ mode = lib.fromHexString mode;
+ inherit
+ dir
+ data
+ ;
+ };
+
+ ent = fsname: dir: type: opts: freq: passno: {
+ inherit
+ fsname
+ dir
+ type
+ opts
+ freq
+ passno
+ ;
+ };
+
+ callTestCase =
+ path:
+ let
+ tc = import path {
+ inherit
+ fs
+ ent
+ ;
+ };
+ in
+ {
+ name = "check-sandbox-${tc.name}";
+ verbose = true;
+ share = foot;
+ packages = [ ];
+ command = "${callPackage ../. {
+ inherit (tc) name want;
+ inherit version;
+ }}";
+ extraPaths = [
+ {
+ src = "/proc/mounts";
+ dst = "/.fortify/mounts";
+ }
+ ];
+ };
+in
+{
+ moduleDefault = callTestCase ./module-default.nix;
+}