Merge pull request #14190 from joachifm/sudotest-for-upstream
nixos/tests: implement a trivial test for sudo
This commit is contained in:
commit
90330c27cd
1 changed files with 7 additions and 0 deletions
|
@ -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'");
|
||||
};
|
||||
'';
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue