summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-01-07 14:34:20 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-01-07 16:18:53 +0000
commit13a350a650fa9847bfbfadea40262e21c0864c39 (patch)
treec9f70b9ffe08c93181a975448193adb6d807dfd0 /tests
parenta1f9fa9628907a650f00f27ad1669d5ad69028d3 (diff)
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 <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tstunt/gpg-locked22
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/tstunt/gpg-locked b/tests/tstunt/gpg-locked
index ddb880f..9dfda26 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