chiark / gitweb /
test suite: gpg agent workaround: Neaten the logging. archive/debian/5.5+exp8 debian/5.5+exp8
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Jun 2018 09:21:32 +0000 (10:21 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Jun 2018 09:54:53 +0000 (10:54 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/setup/gnupg
tests/tstunt/gpg
tests/tstunt/gpg-withagent

index 3611845..3f363e4 100644 (file)
@@ -1,3 +1,9 @@
+dgit (5.5+exp8) experimental; urgency=medium
+
+  * test suite: gpg agent workaround: Neaten the logging.
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Sat, 30 Jun 2018 10:54:48 +0100
+
 dgit (5.5+exp7) experimental; urgency=medium
 
   * test suite: gpg-agent workaround: Send ps output to stderr (oops)
index c88d40b..7a164ef 100755 (executable)
@@ -7,10 +7,11 @@ cp $troot/gnupg/* $tmp/gnupg
 chmod go-rw $tmp/gnupg/*
 
 export DGIT_TEST_GNUPG_GLOBAL_LOCK=$tmp/gnupg/dgit-test-global-lock
+export DGIT_TEST_GNUPG_LOG=$tmp/gnupg-workarounds.log
 
 setup='
        export GNUPGHOME=$tmp/gnupg
-       export DGIT_TEST_GNUPG_GLOBAL_LOCK
+       export DGIT_TEST_GNUPG_GLOBAL_LOCK DGIT_TEST_GNUPG_LOG
 
        cat >$tmp/gnupg/gpg-agent.conf <<END
        log-file $tmp/gnupg/AGENT.log
@@ -27,6 +28,7 @@ eval "$setup"
 
 gpg --list-secret
 
-t-setup-done 'DGIT_TEST_GNUPG_GLOBAL_LOCK' 'gnupg' "$setup"
+t-setup-done 'DGIT_TEST_GNUPG_GLOBAL_LOCK DGIT_TEST_GNUPG_LOG' \
+       'gnupg' "$setup"
 
 t-ok
index 79d8319..7e12846 100755 (executable)
@@ -3,4 +3,18 @@ set -e
 
 exec \
 with-lock-ex -w "$DGIT_TEST_GNUPG_GLOBAL_LOCK" \
+       sh -c '
+               "$@" 9>&2 2>>"$DGIT_TEST_GNUPG_LOG"
+               rc=$?
+               if [ rc = 0 ]; then exit 0; fi
+               if [ "x$DGIT_TEST_BYHAND" != x ]; then
+                       echo >&2 "BYHAND, not catting $DGIT_TEST_GNUPG_LOG"
+               else
+                       echo >&2 "########################################"
+                       echo >&2 "$DGIT_TEST_GNUPG_LOG"
+                       cat >&2 "$DGIT_TEST_GNUPG_LOG"
+                       echo >&2 "end of $DGIT_TEST_GNUPG_LOG"
+               fi
+               exit $rc
+       ' x \
        "$DGIT_TEST_TROOT"/tstunt/gpg-withagent "$@"
index 4b2ee1a..b7b8bfd 100755 (executable)
@@ -51,7 +51,7 @@ d
 
 set +e
 $DGIT_TEST_REAL_GPG                                    \
-       --agent-program=$DGIT_STUNT_AGENT "$@"
+       --agent-program=$DGIT_STUNT_AGENT "$@" 2>&9
 rc=$?
 set -e