Skip to content

Commit b41a36e

Browse files
eworm-degitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8213d87 commit b41a36e

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

t/lib-gpg.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ else
1616
# Type DSA and Elgamal, size 2048 bits, no expiration date.
1717
# Name and email: C O Mitter <[email protected]>
1818
# No password given, to enable non-interactive operation.
19-
cp -R "$TEST_DIRECTORY"/lib-gpg ./gpghome
20-
chmod 0700 gpghome
21-
chmod 0600 gpghome/*
19+
mkdir ./gpghome
20+
chmod 0700 ./gpghome
2221
GNUPGHOME="$(pwd)/gpghome"
2322
export GNUPGHOME
23+
gpg --homedir "${GNUPGHOME}" --import \
24+
"$TEST_DIRECTORY"/lib-gpg/pubring.gpg \
25+
"$TEST_DIRECTORY"/lib-gpg/secring.gpg
26+
gpg --homedir "${GNUPGHOME}" --import-ownertrust \
27+
"$TEST_DIRECTORY"/lib-gpg/ownertrust
2428
test_set_prereq GPG
2529
;;
2630
esac

t/lib-gpg/ownertrust

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# List of assigned trustvalues, created Thu 11 Dec 2014 01:26:28 PM CET
2+
# (Use "gpg --import-ownertrust" to restore them)
3+
73D758744BE721698EC54E8713B6F51ECDDE430D:6:
4+
D4BE22311AD3131E5EDA29A461092E85B7227189:3:

t/lib-gpg/random_seed

-600 Bytes
Binary file not shown.

t/lib-gpg/trustdb.gpg

-1.33 KB
Binary file not shown.

0 commit comments

Comments
 (0)