From f494662b7bb453a1e0368866c09c210496876642 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 8 May 2022 05:52:17 +0200 Subject: 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 --- tests/programs/gnupg/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') 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)}" -- cgit 1.4.1