diff --git a/nixos/tests/homepage-dashboard.nix b/nixos/tests/homepage-dashboard.nix index 53e5b113cd02..d72ebc215295 100644 --- a/nixos/tests/homepage-dashboard.nix +++ b/nixos/tests/homepage-dashboard.nix @@ -21,10 +21,23 @@ ]; } ]; + services = [ + { + Machines = [ + { + Localhost = { + ping = "127.0.0.1"; + }; + } + ]; + } + ]; }; }; testScript = '' + import json + # Ensure the services are started on managed machine machine.wait_for_unit("homepage-dashboard.service") machine.wait_for_open_port(8082) @@ -40,5 +53,9 @@ # Ensure that we see the custom bookmarks on the page page = machine.succeed("curl --fail http://127.0.0.1:8082/api/bookmarks") assert "nixpkgs" in page, "Custom bookmarks not found" + + # Ensure that the ping command works + response = machine.succeed("curl --fail \"http://localhost:8082/api/ping?groupName=Machines&serviceName=Localhost\"") + assert json.loads(response)["alive"] is True, "Ping to localhost failed" ''; }