chiark / gitweb /
test suite: gpg-agent workaround: Kill unexpected leftover agents.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 29 Jun 2018 11:13:59 +0000 (12:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 29 Jun 2018 11:14:00 +0000 (12:14 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/tstunt/gpg-withagent

index 7850597..bc809a7 100644 (file)
@@ -1,6 +1,7 @@
 dgit (5.5+exp5~) experimental; urgency=medium
 
   * test suite: gpg-agent workaround: Add more debugging output.
+  * test suite: gpg-agent workaround: Kill unexpected leftover agents.
 
  --
 
index d7fe793..4318cce 100755 (executable)
@@ -24,7 +24,16 @@ retry_until_ok () {
        done
 }
 
-echo >&2 'GPG-WITHAGENT...'
+kill_agent_not_running () {
+       LC_MESSAGES=C gpg-connect-agent --no-autostart </dev/null \
+               KILLAGENT /bye 2>&1 \
+       | tee -a /dev/stderr \
+       | grep 'no gpg-agent running' >&2
+}
+
+echo >&2 'GPG-WITHAGENT... PRE-STOPPING'
+
+retry_until_ok kill_agent_not_running
 
 agent_is_running () {
        gpg-connect-agent --no-autostart </dev/null \
@@ -50,13 +59,6 @@ d
 
 echo >&2 'GPG-WITHAGENT... STOPPING'
 
-kill_agent_not_running () {
-       LC_MESSAGES=C gpg-connect-agent --no-autostart </dev/null \
-               KILLAGENT /bye 2>&1 \
-       | tee -a /dev/stderr \
-       | grep 'no gpg-agent running' >&2
-}
-
 retry_until_ok kill_agent_not_running
 
 echo >&2 'GPG-WITHAGENT... DONE'