From 8fbb437033d8c44c2075b340bc2af9aa35453170 Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski <2151333+piotrkwiecinski@users.noreply.github.com> Date: Fri, 4 Apr 2025 21:16:05 +0200 Subject: [PATCH] nixosTests.homepage-dashboard: migrate to runTest Part of #386873 --- nixos/tests/all-tests.nix | 2 +- nixos/tests/homepage-dashboard.nix | 44 ++++++++++++++---------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 132bd5d64d22..cb41b17e77a4 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -584,7 +584,7 @@ in herbstluftwm = handleTest ./herbstluftwm.nix { }; homebox = handleTest ./homebox.nix { }; homer = handleTest ./homer { }; - homepage-dashboard = handleTest ./homepage-dashboard.nix { }; + homepage-dashboard = runTest ./homepage-dashboard.nix; honk = runTest ./honk.nix; installed-tests = pkgs.recurseIntoAttrs (handleTest ./installed-tests { }); invidious = handleTest ./invidious.nix { }; diff --git a/nixos/tests/homepage-dashboard.nix b/nixos/tests/homepage-dashboard.nix index ed70ead01820..d654dcaf53df 100644 --- a/nixos/tests/homepage-dashboard.nix +++ b/nixos/tests/homepage-dashboard.nix @@ -1,28 +1,26 @@ -import ./make-test-python.nix ( - { lib, ... }: - { - name = "homepage-dashboard"; - meta.maintainers = with lib.maintainers; [ jnsgruk ]; +{ lib, ... }: +{ + name = "homepage-dashboard"; + meta.maintainers = with lib.maintainers; [ jnsgruk ]; - nodes.machine = _: { - 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 managed machine - machine.wait_for_unit("homepage-dashboard.service") - machine.wait_for_open_port(8082) - machine.succeed("curl --fail http://localhost:8082/") + testScript = '' + # Ensure the services are started on managed machine + 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. - machine.succeed("test -d /etc/homepage-dashboard") + # 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 = machine.succeed("curl --fail http://localhost:8082/") - assert "test title rodUsEagid" in page, "Custom title not found" - ''; - } -) + # Ensure that we see the custom title *only in the managed config* + page = machine.succeed("curl --fail http://localhost:8082/") + assert "test title rodUsEagid" in page, "Custom title not found" + ''; +}