about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2022-05-08 05:52:17 +0200
committeraszlig <aszlig@nix.build>2022-05-08 06:07:18 +0200
commitf494662b7bb453a1e0368866c09c210496876642 (patch)
tree9541b811293fe1a83284c9f081e7ff60ceea1a55 /tests
parent2a2a4bd91820888af7a723c147a7cc3ee44f2518 (diff)
tests/gnupg: Work around possible buffering issue
Recently the test has started to stall, so I investigated and found the
commit that introduced this in nixpkgs[1]. The commit in question
changes the command to be passed to Machine.execute from a list in a
subshell environment (like "(some commands)") to using a subshell
directly via "sh -c". This is allegedly to avoid shell injection, but
what matters in our case I guess is that it forks into another shell.

Unfortunately, I did not find out *exactly* why this happens but it
seems to affect buffering in such a way that the command never
terminates for some reason.

Since I don't have a lot of time to investigate further, I just worked
around the issue by suppressing stdout output from the expect scripts we
run. This is not nice but since the test stall is irrelevant to our
gnupg module, it doesn't make sense to block the test for reasons out of
the scope of this test.

[1]: https://github.com/NixOS/nixpkgs/commit/dbc95f15b8dad5224cbb6a52df9

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'tests')
-rw-r--r--tests/programs/gnupg/default.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/programs/gnupg/default.nix b/tests/programs/gnupg/default.nix
index 098178a4..bb0ed107 100644
--- a/tests/programs/gnupg/default.nix
+++ b/tests/programs/gnupg/default.nix
@@ -53,8 +53,10 @@ in {
     machine.wait_for_x()
 
     def ssh(cmd: str) -> str:
+      # XXX: Redirecting stdout to /dev/null is a workaround and we ideally
+      #      should *ONLY* get stdout on error.
       return "ssh -q -i /root/id_ed25519 -o StrictHostKeyChecking=no" \
-             f" alice@127.0.0.1 -- {quote(cmd)}"
+             f" alice@127.0.0.1 -- {quote(cmd)} > /dev/null"
 
     def xsu(cmd: str) -> str:
       return f"DISPLAY=:0 su alice -c {quote(cmd)}"