diff options
author | Justus Winter <[email protected]> | 2017-07-13 13:41:11 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-07-13 13:41:11 +0000 |
commit | 9cd2b58dfb2c21cce64520cf4c726859b583d14e (patch) | |
tree | 81627f4e1532edffb1f7ce472905b55548066dcb /tests/start-stop-agent | |
parent | Sync 'autogen.sh'. (diff) | |
download | gpgme-9cd2b58dfb2c21cce64520cf4c726859b583d14e.tar.gz gpgme-9cd2b58dfb2c21cce64520cf4c726859b583d14e.zip |
tests: Make agent spawning more robust.
* tests/gpgsm/Makefile.am (gpgsm.conf): Add agent-program directive.
* tests/start-stop-agent: Update agent-program directive.
--
Update the 'agent-program' configuration directive to point to the
same agent that we are starting. Previously, it was possible that a
different agent was started if 'make check' was run with a different
PATH.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/start-stop-agent')
-rwxr-xr-x | tests/start-stop-agent | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/start-stop-agent b/tests/start-stop-agent index 3ce6f22a..9514e0a1 100755 --- a/tests/start-stop-agent +++ b/tests/start-stop-agent @@ -30,6 +30,18 @@ if [ "$1" = "--stop" ]; then exit 0 fi +# Update 'agent-program' in the configuration files to make sure we +# will always start exactly this agent again if we ever need to. +for F in gpg.conf gpgsm.conf +do + if test -f "$GNUPGHOME/$F" + then + mv "$GNUPGHOME/$F" "$GNUPGHOME/$F~" + sed -e "s#^agent-program.*#agent-program ${GPG_AGENT}|--debug-quick-random#" \ + >"$GNUPGHOME/$F" <"$GNUPGHOME/$F~" + fi +done + if [ "$(gpg-connect-agent --no-autostart getval\ $token /bye 2>/dev/null | head -1)" \ = "D set" ]; then echo "gpg-agent already running" >&2 |