nixosTests.homepage-dashboard: migrate to runTest

Part of #386873
This commit is contained in:
Piotr Kwiecinski 2025-04-04 21:16:05 +02:00
parent 1cfe5a5d42
commit 8fbb437033
No known key found for this signature in database
GPG key ID: EC0DE1CB9D5258B4
2 changed files with 22 additions and 24 deletions

View file

@ -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 { };

View file

@ -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"
'';
}