diff --git a/nixos/tests/homepage-dashboard.nix b/nixos/tests/homepage-dashboard.nix index 7fb30d473e00..ed70ead01820 100644 --- a/nixos/tests/homepage-dashboard.nix +++ b/nixos/tests/homepage-dashboard.nix @@ -4,46 +4,25 @@ import ./make-test-python.nix ( name = "homepage-dashboard"; meta.maintainers = with lib.maintainers; [ jnsgruk ]; - nodes.unmanaged_conf = - { pkgs, ... }: - { - services.homepage-dashboard.enable = true; - }; - - nodes.managed_conf = - { pkgs, ... }: - { - services.homepage-dashboard = { - enable = true; - settings.title = "test title rodUsEagid"; # something random/unique - }; + nodes.machine = _: { + services.homepage-dashboard = { + enable = true; + settings.title = "test title rodUsEagid"; # something random/unique }; + }; testScript = '' - # Ensure the services are started on unmanaged machine - unmanaged_conf.wait_for_unit("homepage-dashboard.service") - unmanaged_conf.wait_for_open_port(8082) - unmanaged_conf.succeed("curl --fail http://localhost:8082/") - - # Ensure that /etc/homepage-dashboard doesn't exist, and boilerplate - # configs are copied into place. - unmanaged_conf.fail("test -d /etc/homepage-dashboard") - unmanaged_conf.succeed("test -f /var/lib/private/homepage-dashboard/settings.yaml") - # Ensure the services are started on managed machine - managed_conf.wait_for_unit("homepage-dashboard.service") - managed_conf.wait_for_open_port(8082) - managed_conf.succeed("curl --fail http://localhost:8082/") + machine.wait_for_unit("homepage-dashboard.service") + machine.wait_for_open_port(8082) + machine.succeed("curl --fail http://localhost:8082/") - # Ensure /etc/homepage-dashboard is created and unmanaged conf location isn't. - managed_conf.succeed("test -d /etc/homepage-dashboard") - managed_conf.fail("test -f /var/lib/private/homepage-dashboard/settings.yaml") + # Ensure /etc/homepage-dashboard is created. + machine.succeed("test -d /etc/homepage-dashboard") # Ensure that we see the custom title *only in the managed config* - page = managed_conf.succeed("curl --fail http://localhost:8082/") + page = machine.succeed("curl --fail http://localhost:8082/") assert "test title rodUsEagid" in page, "Custom title not found" - page = unmanaged_conf.succeed("curl --fail http://localhost:8082/") - assert "test title rodUsEagid" not in page, "Custom title found where it shouldn't be" ''; } )