diff --git a/test/integration.nix b/test/integration.nix index e0ee85a..8479ac9 100644 --- a/test/integration.nix +++ b/test/integration.nix @@ -63,6 +63,10 @@ pkgs.nixosTest { file = ../example/secret2.age; path = "/home/user1/secret2"; }; + secrets.armored-secret = { + file = ../example/armored-secret.age; + path = "/home/user1/armored-secret"; + }; }; }; }; @@ -71,6 +75,7 @@ pkgs.nixosTest { user = "user1"; password = "password1234"; secret2 = "world!"; + armored-secret = "Hello World!"; in '' system1.wait_for_unit("multi-user.target") system1.wait_until_succeeds("pgrep -f 'agetty.*tty1'") @@ -89,8 +94,10 @@ pkgs.nixosTest { system1.wait_for_file("/tmp/1") assert "${user}" in system1.succeed("cat /tmp/1") system1.send_chars("cat /run/user/$(id -u)/agenix/secret2 > /tmp/2\n") + system1.send_chars("cat /run/user/$(id -u)/agenix/armored-secret > /tmp/3\n") system1.wait_for_file("/tmp/2") assert "${secret2}" in system1.succeed("cat /tmp/2") + assert "${armored-secret}" in system1.succeed("cat /tmp/3") userDo = lambda input : f"sudo -u user1 -- bash -c 'set -eou pipefail; cd /tmp/secrets; {input}'"