From 9f25f899f09b55541e85cf1279c1ff116ecb2899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 5 Jan 2025 08:06:25 +0100 Subject: [PATCH] nixosTests.homepage-dashboard: check declarative settings Check that the custom title is used, or else we don't know that our settings get applied. --- nixos/tests/homepage-dashboard.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/tests/homepage-dashboard.nix b/nixos/tests/homepage-dashboard.nix index 622c5a6e0d1a..7fb30d473e00 100644 --- a/nixos/tests/homepage-dashboard.nix +++ b/nixos/tests/homepage-dashboard.nix @@ -15,7 +15,7 @@ import ./make-test-python.nix ( { services.homepage-dashboard = { enable = true; - settings.title = "custom"; + settings.title = "test title rodUsEagid"; # something random/unique }; }; @@ -38,6 +38,12 @@ import ./make-test-python.nix ( # 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 that we see the custom title *only in the managed config* + page = managed_conf.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" ''; } )