From 395e13bd154a9d00ffb25cff3f45e3afa8222d13 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 29 Jun 2018 12:13:59 +0100 Subject: [PATCH] test suite: gpg-agent workaround: Kill unexpected leftover agents. Signed-off-by: Ian Jackson --- debian/changelog | 1 + tests/tstunt/gpg-withagent | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 78505974..bc809a72 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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. -- diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent index d7fe793e..4318cce0 100755 --- a/tests/tstunt/gpg-withagent +++ b/tests/tstunt/gpg-withagent @@ -24,7 +24,16 @@ retry_until_ok () { done } -echo >&2 'GPG-WITHAGENT...' +kill_agent_not_running () { + LC_MESSAGES=C gpg-connect-agent --no-autostart &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 &2 'GPG-WITHAGENT... STOPPING' -kill_agent_not_running () { - LC_MESSAGES=C gpg-connect-agent --no-autostart &1 \ - | tee -a /dev/stderr \ - | grep 'no gpg-agent running' >&2 -} - retry_until_ok kill_agent_not_running echo >&2 'GPG-WITHAGENT... DONE' -- 2.30.2