nixpkgs/nixos/tests/podgrab.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
789 B
Nix
Raw Normal View History

2021-04-14 17:15:41 +00:00
let
defaultPort = 8080;
customPort = 4242;
in
{ pkgs, ... }:
{
name = "podgrab";
2021-04-14 17:15:41 +00:00
nodes = {
default =
{ ... }:
{
services.podgrab.enable = true;
};
2021-04-14 17:15:41 +00:00
customized =
{ ... }:
{
services.podgrab = {
enable = true;
port = customPort;
};
};
};
2021-04-14 17:15:41 +00:00
testScript = ''
start_all()
2021-04-14 17:15:41 +00:00
default.wait_for_unit("podgrab")
default.wait_for_open_port(${toString defaultPort})
default.succeed("curl --fail http://localhost:${toString defaultPort}")
2021-04-14 17:15:41 +00:00
customized.wait_for_unit("podgrab")
customized.wait_for_open_port(${toString customPort})
customized.succeed("curl --fail http://localhost:${toString customPort}")
'';
2021-04-14 17:15:41 +00:00
meta.maintainers = with pkgs.lib.maintainers; [ ambroisie ];
}