summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/tests/sudo.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/tests/sudo.nix b/nixos/tests/sudo.nix
index 4885d6e17b8..ae9362ca70d 100644
--- a/nixos/tests/sudo.nix
+++ b/nixos/tests/sudo.nix
@@ -73,7 +73,7 @@ in
             machine.fail('su - test1 -c "sudo -n -u root true"')
 
         with subtest("users in group 'foobar' should be able to use sudo with password"):
-            machine.succeed("sudo -u test2 echo ${password} | sudo -S -u root true")
+            machine.succeed('su - test2 -c "echo ${password} | sudo -S -u root true"')
 
         with subtest("users in group 'barfoo' should be able to use sudo without password"):
             machine.succeed("sudo -u test3 sudo -n -u root true")