From a5725baf256d1d3dfd6b33d18c0dfcfd6c3a6c13 Mon Sep 17 00:00:00 2001 From: Andrew Lubawy Date: Tue, 30 Jul 2024 16:03:03 -0700 Subject: [PATCH] Add wait for file write before assertion --- test/integration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration.nix b/test/integration.nix index 09ce39a..d2bfaaa 100644 --- a/test/integration.nix +++ b/test/integration.nix @@ -93,9 +93,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") + system1.send_chars("cat /run/user/$(id -u)/agenix/armored-secret > /tmp/3\n") + system1.wait_for_file("/tmp/3") 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}'"