aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2017-02-14 16:42:39 -0500
committerDavid Bremner <david@tethera.net>2017-02-21 07:45:40 -0400
commite7b88e8b0a93ca83d807edc00e0c97af54c5b5f1 (patch)
tree42bf00d6f1a0e71befcf3ffa266713a2bf070e7d
parent12f7d4e61d30fb9a5c99e128ab1aab0bf069cdb4 (diff)
test: use gpgconf --create-socketdir if available
This enables the shortened socket pathes in /run or equivalent. The explicit call to gpgconf is needed for nonstandard GNUPGHOME settings. (amended according to id:m2fujatr4k.fsf@guru.guru-group.fi)
-rw-r--r--test/test-lib.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 86e792a8..ba1580cd 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -229,10 +229,19 @@ test_fixed=0
test_broken=0
test_success=0
+
+_shutdown_gpg_agent () {
+ if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} = 1 ]; then
+ gpgconf --kill gpg-agent
+ gpgconf --remove-socketdir
+ fi
+}
+
_exit_common () {
code=$?
trap - EXIT
set +ex
+ _shutdown_gpg_agent
rm -rf "$TEST_TMPDIR"
}
@@ -1276,6 +1285,11 @@ test_init_ () {
. ./test-lib-common.sh || exit 1
+# we need the setting of GNUPGHOME in test-lib-common.sh
+if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} = 1 ]; then
+ gpgconf --create-socketdir
+fi
+
emacs_generate_script