chiark / gitweb /
test suite: gnupg: Have three goes, rather than two
[dgit.git] / tests / tstunt / gpg
index 790c46c86ed9a3d6b6cf2cfa872f8eb6f446c668..892b9c8cf446b255a221276463553c88fc83a0f7 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-for attempt in '' exec; do
+for attempt in '' ' ' exec; do
 
 set +e
 $attempt                                               \
@@ -15,6 +15,18 @@ if [ $rc != 2 ]; then exit $rc; fi
 
 echo >&2 "WARNING - GNUPG FAILED $rc - STUNT GNUPG $attempt $*"
 
+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 $*"
+
+sleep 10
+
 done
 
 exit 127