1let
2 defaultPort = 8080;
3 customPort = 4242;
4in
5{ pkgs, ... }:
6{
7 name = "podgrab";
8
9 nodes = {
10 default =
11 { ... }:
12 {
13 services.podgrab.enable = true;
14 };
15
16 customized =
17 { ... }:
18 {
19 services.podgrab = {
20 enable = true;
21 port = customPort;
22 };
23 };
24 };
25
26 testScript = ''
27 start_all()
28
29 default.wait_for_unit("podgrab")
30 default.wait_for_open_port(${toString defaultPort})
31 default.succeed("curl --fail http://localhost:${toString defaultPort}")
32
33 customized.wait_for_unit("podgrab")
34 customized.wait_for_open_port(${toString customPort})
35 customized.succeed("curl --fail http://localhost:${toString customPort}")
36 '';
37
38 meta.maintainers = with pkgs.lib.maintainers; [ ambroisie ];
39}