From 13a350a650fa9847bfbfadea40262e21c0864c39 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 7 Jan 2018 14:34:20 +0000 Subject: [PATCH 1/1] test suite: gnupg: Do not count as "trouble" a 0-byte input file failure apt-key seems to feed gpg --import an empty pipe. This makes gpg exit with status 2. We think this is trouble, but it isn't. Signed-off-by: Ian Jackson --- tests/tstunt/gpg-locked | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/tstunt/gpg-locked b/tests/tstunt/gpg-locked index ddb880f6..9dfda269 100755 --- a/tests/tstunt/gpg-locked +++ b/tests/tstunt/gpg-locked @@ -29,15 +29,19 @@ if [ $rc != 2 ]; then exit $rc; fi echo >&2 "WARNING - GNUPG FAILED $rc - STUNT GNUPG $attempt $stdin_tmp_bytes $*" -sh -ec ' - if [ "x$DGIT_GNUPG_STUNT_ERRLOG" != x ]; then - exec >"$DGIT_GNUPG_STUNT_ERRLOG" - else - exec 2>/dev/null - fi - exec >/dev/tty - printf "%s\n" "$*" -' x "GNUPG WRAPPER - TROUBLE - $HOME $GNUPGHOME - FAILED $rc $attempt $stdin_tmp_bytes $*" +if [ "$stdin_tmp_bytes" = 0 ]; then + sleep 5 +else + sh -ec ' + if [ "x$DGIT_GNUPG_STUNT_ERRLOG" != x ]; then + exec >"$DGIT_GNUPG_STUNT_ERRLOG" + else + exec 2>/dev/null + fi + exec >/dev/tty + printf "%s\n" "$*" + ' x "GNUPG WRAPPER - TROUBLE - $HOME $GNUPGHOME - FAILED $rc $attempt $stdin_tmp_bytes $*" +fi sleep 10 -- 2.30.2