nixos/tests/healthchecks: update test for auto user change in healthchecks-manage

This commit is contained in:
Sandro Jäckel 2022-10-28 13:34:18 +02:00
parent 887462db03
commit 3c4c38a799
No known key found for this signature in database
GPG Key ID: B1763F8651144063

View File

@ -33,10 +33,10 @@ import ../make-test-python.nix ({ lib, pkgs, ... }: {
)
with subtest("Manage script works"):
# Should fail if not called by healthchecks user
machine.fail("echo 'print(\"foo\")' | healthchecks-manage help")
# "shell" sucommand should succeed, needs python in PATH.
assert "foo\n" == machine.succeed("echo 'print(\"foo\")' | sudo -u healthchecks healthchecks-manage shell")
# Shouldn't fail if not called by healthchecks user
assert "foo\n" == machine.succeed("echo 'print(\"foo\")' | healthchecks-manage shell")
'';
})