nixosTests.homepage-dashboard: remove unmanaged conf tests

This commit is contained in:
Jon Seager 2025-03-19 11:05:40 +00:00
parent eb324777e9
commit 4240d073c7
No known key found for this signature in database

View File

@ -4,46 +4,25 @@ import ./make-test-python.nix (
name = "homepage-dashboard"; name = "homepage-dashboard";
meta.maintainers = with lib.maintainers; [ jnsgruk ]; meta.maintainers = with lib.maintainers; [ jnsgruk ];
nodes.unmanaged_conf = nodes.machine = _: {
{ pkgs, ... }: services.homepage-dashboard = {
{ enable = true;
services.homepage-dashboard.enable = true; settings.title = "test title rodUsEagid"; # something random/unique
};
nodes.managed_conf =
{ pkgs, ... }:
{
services.homepage-dashboard = {
enable = true;
settings.title = "test title rodUsEagid"; # something random/unique
};
}; };
};
testScript = '' 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 # Ensure the services are started on managed machine
managed_conf.wait_for_unit("homepage-dashboard.service") machine.wait_for_unit("homepage-dashboard.service")
managed_conf.wait_for_open_port(8082) machine.wait_for_open_port(8082)
managed_conf.succeed("curl --fail http://localhost:8082/") machine.succeed("curl --fail http://localhost:8082/")
# Ensure /etc/homepage-dashboard is created and unmanaged conf location isn't. # Ensure /etc/homepage-dashboard is created.
managed_conf.succeed("test -d /etc/homepage-dashboard") machine.succeed("test -d /etc/homepage-dashboard")
managed_conf.fail("test -f /var/lib/private/homepage-dashboard/settings.yaml")
# Ensure that we see the custom title *only in the managed config* # 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" 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"
''; '';
} }
) )