[PATCH 2/2] Copy tests/gnupg/ into trash directory for tests

Colin Watson cjwatson at debian.org
Tue May 9 12:24:49 CEST 2017


gpg2 currently creates a Unix socket in GNUPGHOME, which therefore needs
to fit in 108 bytes (the maximum length for a Unix socket path).
Copying tests/gnupg/ into the temporary trash directory makes it easier
to set things up so that it's always in a short enough path, as well as
avoiding accidental pollution by tests.
---
 tests/setup.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/setup.sh b/tests/setup.sh
index 5d1e794..75d0ec5 100644
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -49,7 +49,9 @@ if [[ ! -e $PASS ]]; then
 fi
 
 # Note: the assumption is the test key is unencrypted.
-export GNUPGHOME="$TEST_HOME/gnupg/"
+rm -rf "$SHARNESS_TRASH_DIRECTORY/gnupg"
+cp -a "$TEST_HOME/gnupg" "$SHARNESS_TRASH_DIRECTORY/gnupg"
+export GNUPGHOME="$SHARNESS_TRASH_DIRECTORY/gnupg/"
 chmod 700 "$GNUPGHOME"
 GPG="gpg"
 which gpg2 &>/dev/null && GPG="gpg2"
-- 
2.7.4


More information about the Password-Store mailing list