summaryrefslogtreecommitdiffstats
path: root/nixos/tests/glances.nix
blob: a5f07b53386e1b35b3c066b21a5dbc950160745e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ lib, ... }:

{
  name = "glances";

  nodes = {
    machine_default =
      { pkgs, ... }:
      {
        services.glances = {
          enable = true;
        };
      };

    machine_custom_port =
      { pkgs, ... }:
      {
        services.glances = {
          enable = true;
          port = 5678;
        };
      };
  };

  testScript = ''
    machine_default.start()
    machine_default.wait_for_unit("glances.service")
    machine_default.wait_for_open_port(61208)

    machine_custom_port.start()
    machine_custom_port.wait_for_unit("glances.service")
    machine_custom_port.wait_for_open_port(5678)
  '';

  meta.maintainers = [ lib.maintainers.claha ];
}