Merge pull request #14190 from joachifm/sudotest-for-upstream
nixos/tests: implement a trivial test for sudo
This commit is contained in:
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'");
|
||||
};
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user