X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftstunt%2Fgpg-withagent;h=b7b8bfd787680f9db0ec3d95ad02022e6bf032b4;hb=refs%2Ftags%2Farchive%2Fdebian%2F5.5%2Bexp8;hp=d7fe793e7cdf36b9216d94343a043d0a328ecb64;hpb=7d0d834d7b41b5f3cafffc37b9a9d94966c68e0f;p=dgit.git diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent index d7fe793e..b7b8bfd7 100755 --- a/tests/tstunt/gpg-withagent +++ b/tests/tstunt/gpg-withagent @@ -3,7 +3,7 @@ set -ex d () { date --iso-8601=ns >&2 - ps -ef | grep gpg-agent >&2 + ps -ef | grep gpg-agent >&2 ||: } d @@ -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 &9 rc=$? set -e @@ -50,13 +59,6 @@ d echo >&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'