From 591172acc8865136f0e1ac55916b24d8dc9dfa44 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Wed, 28 Dec 2022 15:43:15 -0800 Subject: [PATCH] Add basic unit test that evlauates the module --- flake.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/flake.nix b/flake.nix index 9caf0d9..aeeda1e 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,26 @@ ''; }; }; + + checks.${system}.test-module = let + test-lib = import "${nixpkgs}/nixos/lib/testing-python.nix" { + inherit system; + }; + in + test-lib.makeTest { + name = "inquisitor-test-module"; + nodes = { + host = { ... }: { + imports = [ self.nixosModules.default ]; + services.inquisitor.enable = true; + }; + }; + testScript = '' + start_all() + host.wait_for_unit("multi-user.target") + host.succeed("[ -e /var/lib/inquisitor ]") + ''; + }; }; in (my-flake.outputs-for each systems) // { overlays.default = final: prev: {