Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6cd5863060a4
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b17b44232f5d
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jun 1, 2018

  1. nixos/tests/iftop: fix non-deterministic failure (#41309)

    - make sure machines are fully booted before sending commands
    - test that capability setting in iftop module makes a difference
    xeji authored Jun 1, 2018
    Copy the full SHA
    b17b442 View commit details
Showing with 9 additions and 5 deletions.
  1. +9 −5 nixos/tests/iftop.nix
14 changes: 9 additions & 5 deletions nixos/tests/iftop.nix
Original file line number Diff line number Diff line change
@@ -9,22 +9,26 @@ with lib;
nodes = {
withIftop = {
imports = [ ./common/user-account.nix ];

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

testScript = ''
subtest "machine with iftop enabled", sub {
$withIftop->start;
$withIftop->succeed("su -l alice -c 'iftop -t -s 1'");
$withIftop->waitForUnit("default.target");
# limit to eth1 (eth0 is the test driver's control interface)
# and don't try name lookups
$withIftop->succeed("su -l alice -c 'iftop -t -s 1 -n -i eth1'");
};
subtest "machine without iftop", sub {
$withoutIftop->start;
$withoutIftop->mustFail("su -l alice -c 'iftop -t -s 1'");
$withoutIftop->waitForUnit("default.target");
# check that iftop is there but user alice lacks capabilities
$withoutIftop->succeed("iftop -t -s 1 -n -i eth1");
$withoutIftop->fail("su -l alice -c 'iftop -t -s 1 -n -i eth1'");
};
'';
})