From 65bd5a97f8dddaa6710df085cfd643d8eefead38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 4 Sep 2022 12:44:38 +0200 Subject: add test for lvm example --- tests/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/default.nix b/tests/default.nix index 525f936..3118624 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -4,6 +4,14 @@ let lib = pkgs.lib; makeDiskoTest = (pkgs.callPackage ./lib.nix { inherit makeTest; }).makeDiskoTest; + + evalTest = name: configFile: let + disko-config = import configFile; + in { + "${name}-tsp-create" = pkgs.writeScript "create" ((pkgs.callPackage ../. { }).create disko-config); + "${name}-tsp-mount" = pkgs.writeScript "mount" ((pkgs.callPackage ../. { }).mount disko-config); + }; + allTestFilenames = builtins.map (lib.removeSuffix ".nix") ( builtins.filter @@ -11,6 +19,7 @@ let (lib.attrNames (builtins.readDir ./.)) ); - allTests = lib.genAttrs (allTestFilenames) (test: import (./. + "/${test}.nix") { inherit makeDiskoTest; }); + allTests = lib.genAttrs (allTestFilenames) (test: import (./. + "/${test}.nix") { inherit makeDiskoTest; }) // + evalTest "lvm-luks-example" ../example/config.nix; in allTests -- cgit v1.2.3