python312Packages.millheater: 0.11.8 -> 0.12.0
[NixPkgs.git] / nixos / tests / homepage-dashboard.nix
blobdd36473e8ac024da547c8035450ad9ea5579ffff
1 import ./make-test-python.nix ({ lib, ... }: {
2   name = "homepage-dashboard";
3   meta.maintainers = with lib.maintainers; [ jnsgruk ];
5   nodes.unmanaged_conf = { pkgs, ... }: {
6     services.homepage-dashboard.enable = true;
7   };
9   nodes.managed_conf = { pkgs, ... }: {
10     services.homepage-dashboard = {
11       enable = true;
12       settings.title = "custom";
13     };
14   };
16   testScript = ''
17     # Ensure the services are started on unmanaged machine
18     unmanaged_conf.wait_for_unit("homepage-dashboard.service")
19     unmanaged_conf.wait_for_open_port(8082)
20     unmanaged_conf.succeed("curl --fail http://localhost:8082/")
22     # Ensure that /etc/homepage-dashboard doesn't exist, and boilerplate
23     # configs are copied into place.
24     unmanaged_conf.fail("test -d /etc/homepage-dashboard")
25     unmanaged_conf.succeed("test -f /var/lib/private/homepage-dashboard/settings.yaml")
27     # Ensure the services are started on managed machine
28     managed_conf.wait_for_unit("homepage-dashboard.service")
29     managed_conf.wait_for_open_port(8082)
30     managed_conf.succeed("curl --fail http://localhost:8082/")
32     # Ensure /etc/homepage-dashboard is created and unmanaged conf location isn't.
33     managed_conf.succeed("test -d /etc/homepage-dashboard")
34     managed_conf.fail("test -f /var/lib/private/homepage-dashboard/settings.yaml")
35   '';