Merge pull request #14190 from joachifm/sudotest-for-upstream

nixos/tests: implement a trivial test for sudo
This commit is contained in:
Domen Kožar 2016-03-25 10:08:33 +00:00
commit 90330c27cd

@ -23,6 +23,8 @@ import ./make-test.nix ({ pkgs, ...} : {
{ wantedBy = [ "multi-user.target" ];
where = "/tmp2";
};
users.users.sybil = { isNormalUser = true; group = "wheel"; };
security.sudo = { enable = true; wheelNeedsPassword = false; };
};
testScript =
@ -110,5 +112,10 @@ import ./make-test.nix ({ pkgs, ...} : {
subtest "nix-db", sub {
$machine->succeed("nix-store -qR /run/current-system | grep nixos-");
};
# Test sudo
subtest "sudo", sub {
$machine->succeed("su - sybil -c 'sudo true'");
};
'';
})