summary refs log tree commit diff
path: root/nixos/tests/iftop.nix
blob: 21ff3cafed7ce48c902b10ee20eec12557370829 (plain) (blame)
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
import ./make-test.nix ({ pkgs, lib, ... }:

with lib;

{
  name = "iftop";
  meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ma27 ];

  nodes = {
    withIftop = {
      imports = [ ./common/user-account.nix ];

      programs.iftop.enable = true;
    };
    withoutIftop = {
      imports = [ ./common/user-account.nix ];
    };
  };

  testScript = ''
    subtest "machine with iftop enabled", sub {
      $withIftop->start;
      $withIftop->succeed("su -l alice -c 'iftop -t -s 1'");
    };
    subtest "machine without iftop", sub {
      $withoutIftop->start;
      $withoutIftop->mustFail("su -l alice -c 'iftop -t -s 1'");
    };
  '';
})