summaryrefslogtreecommitdiff
path: root/t/lib-gpg.sh
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2014-12-12 08:50:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-12 18:23:36 (GMT)
commitb41a36e635803f1dc011007e836ae244f9ae04c1 (patch)
treed11e27b12de54bc23c5d9e1f343accd1168b7f78 /t/lib-gpg.sh
parent8213d87a83867809f490e8d683ebbaa857547189 (diff)
downloadgit-b41a36e635803f1dc011007e836ae244f9ae04c1.zip
git-b41a36e635803f1dc011007e836ae244f9ae04c1.tar.gz
git-b41a36e635803f1dc011007e836ae244f9ae04c1.tar.bz2
tests: create gpg homedir on the fly
GnuPG 2.1 homedir looks different, so just create it on the fly by importing needed private and public keys and ownertrust. This solves an issue with gnupg 2.1 running interactive pinentry when old secret key is present. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-gpg.sh')
-rwxr-xr-xt/lib-gpg.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index cd2baef..4e57942 100755
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -16,11 +16,15 @@ else
# Type DSA and Elgamal, size 2048 bits, no expiration date.
# Name and email: C O Mitter <committer@example.com>
# No password given, to enable non-interactive operation.
- cp -R "$TEST_DIRECTORY"/lib-gpg ./gpghome
- chmod 0700 gpghome
- chmod 0600 gpghome/*
+ mkdir ./gpghome
+ chmod 0700 ./gpghome
GNUPGHOME="$(pwd)/gpghome"
export GNUPGHOME
+ gpg --homedir "${GNUPGHOME}" --import \
+ "$TEST_DIRECTORY"/lib-gpg/pubring.gpg \
+ "$TEST_DIRECTORY"/lib-gpg/secring.gpg
+ gpg --homedir "${GNUPGHOME}" --import-ownertrust \
+ "$TEST_DIRECTORY"/lib-gpg/ownertrust
test_set_prereq GPG
;;
esac