about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJon Seager <jon@sgrs.uk>2023-07-12 16:46:28 +0100
committerJon Seager <jon@sgrs.uk>2023-07-13 09:38:27 +0100
commitf94b38be98b9b9df4a964b019257d511f65b0c13 (patch)
tree29c449955bb11fdab81fcab70b938cd4c00d053d
parent3de6be09518a97066b358da98b153a421aae8d24 (diff)
tests/homepage-dashboard: add tests for homepage
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/homepage-dashboard.nix14
2 files changed, 15 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 790de7bbdc47b..723b030072e19 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -337,6 +337,7 @@ in {
   hbase3 = handleTest ./hbase.nix { package=pkgs.hbase3; };
   hedgedoc = handleTest ./hedgedoc.nix {};
   herbstluftwm = handleTest ./herbstluftwm.nix {};
+  homepage-dashboard = handleTest ./homepage-dashboard.nix {};
   installed-tests = pkgs.recurseIntoAttrs (handleTest ./installed-tests {});
   invidious = handleTest ./invidious.nix {};
   oci-containers = handleTestOn ["aarch64-linux" "x86_64-linux"] ./oci-containers.nix {};
diff --git a/nixos/tests/homepage-dashboard.nix b/nixos/tests/homepage-dashboard.nix
new file mode 100644
index 0000000000000..56e077f5ff6de
--- /dev/null
+++ b/nixos/tests/homepage-dashboard.nix
@@ -0,0 +1,14 @@
+import ./make-test-python.nix ({ lib, ... }: {
+  name = "homepage-dashboard";
+  meta.maintainers = with lib.maintainers; [ jnsgruk ];
+
+  nodes.machine = { pkgs, ... }: {
+    services.homepage-dashboard.enable = true;
+  };
+
+  testScript = ''
+    machine.wait_for_unit("homepage-dashboard.service")
+    machine.wait_for_open_port(8082)
+    machine.succeed("curl --fail http://localhost:8082/")
+  '';
+})