summaryrefslogtreecommitdiff
path: root/tests/tstunt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tstunt')
-rwxr-xr-xtests/tstunt/gpg-locked18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/tstunt/gpg-locked b/tests/tstunt/gpg-locked
index 892b9c8..ddb880f 100755
--- a/tests/tstunt/gpg-locked
+++ b/tests/tstunt/gpg-locked
@@ -3,6 +3,20 @@ set -e
for attempt in '' ' ' exec; do
+case "$*" in
+*"
+--batch
+--import")
+ # ^ apt-key's invocation
+ if [ "x$stdin_tmp" = x ]; then
+ stdin_tmp="$GNUPGHOME"/dgit-stdin-tmp
+ cat >$stdin_tmp
+ stdin_tmp_bytes=$(wc -c <$stdin_tmp)
+ fi
+ exec <$stdin_tmp
+ ;;
+esac
+
set +e
$attempt \
$DGIT_TEST_REAL_GPG \
@@ -13,7 +27,7 @@ set -e
if [ $rc != 2 ]; then exit $rc; fi
-echo >&2 "WARNING - GNUPG FAILED $rc - STUNT GNUPG $attempt $*"
+echo >&2 "WARNING - GNUPG FAILED $rc - STUNT GNUPG $attempt $stdin_tmp_bytes $*"
sh -ec '
if [ "x$DGIT_GNUPG_STUNT_ERRLOG" != x ]; then
@@ -23,7 +37,7 @@ sh -ec '
fi
exec >/dev/tty
printf "%s\n" "$*"
-' x "GNUPG WRAPPER - TROUBLE - $HOME $GNUPGHOME - FAILED $rc $attempt $*"
+' x "GNUPG WRAPPER - TROUBLE - $HOME $GNUPGHOME - FAILED $rc $attempt $stdin_tmp_bytes $*"
sleep 10