Loading nixos/tests/homepage-dashboard.nix +11 −32 Original line number Diff line number Diff line Loading @@ -4,15 +4,7 @@ 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, ... }: { nodes.machine = _: { services.homepage-dashboard = { enable = true; settings.title = "test title rodUsEagid"; # something random/unique Loading @@ -20,30 +12,17 @@ import ./make-test-python.nix ( }; 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" ''; } ) Loading
nixos/tests/homepage-dashboard.nix +11 −32 Original line number Diff line number Diff line Loading @@ -4,15 +4,7 @@ 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, ... }: { nodes.machine = _: { services.homepage-dashboard = { enable = true; settings.title = "test title rodUsEagid"; # something random/unique Loading @@ -20,30 +12,17 @@ import ./make-test-python.nix ( }; 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" ''; } )