mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-02-17 23:53:15 +01:00
test: Allow tests to have both gpg and gpgsm active at once
Without this fix, we couldn't run both add_gnupg_home and add_gpgsm_home in the same test script. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
parent
7eaac52ddb
commit
51c43d0e92
1 changed files with 4 additions and 4 deletions
|
@ -110,10 +110,10 @@ unset ALTERNATE_EDITOR
|
||||||
add_gnupg_home ()
|
add_gnupg_home ()
|
||||||
{
|
{
|
||||||
local output
|
local output
|
||||||
[ -d ${GNUPGHOME} ] && return
|
[ -e "${GNUPGHOME}/gpg.conf" ] && return
|
||||||
_gnupg_exit () { gpgconf --kill all 2>/dev/null || true; }
|
_gnupg_exit () { gpgconf --kill all 2>/dev/null || true; }
|
||||||
at_exit_function _gnupg_exit
|
at_exit_function _gnupg_exit
|
||||||
mkdir -m 0700 "$GNUPGHOME"
|
mkdir -p -m 0700 "$GNUPGHOME"
|
||||||
gpg --no-tty --import <$NOTMUCH_SRCDIR/test/gnupg-secret-key.asc >"$GNUPGHOME"/import.log 2>&1
|
gpg --no-tty --import <$NOTMUCH_SRCDIR/test/gnupg-secret-key.asc >"$GNUPGHOME"/import.log 2>&1
|
||||||
test_debug "cat $GNUPGHOME/import.log"
|
test_debug "cat $GNUPGHOME/import.log"
|
||||||
if (gpg --quick-random --version >/dev/null 2>&1) ; then
|
if (gpg --quick-random --version >/dev/null 2>&1) ; then
|
||||||
|
@ -132,10 +132,10 @@ add_gnupg_home ()
|
||||||
add_gpgsm_home ()
|
add_gpgsm_home ()
|
||||||
{
|
{
|
||||||
local fpr
|
local fpr
|
||||||
[ -d "$GNUPGHOME" ] && return
|
[ -e "$GNUPGHOME/gpgsm.conf" ] && return
|
||||||
_gnupg_exit () { gpgconf --kill all 2>/dev/null || true; }
|
_gnupg_exit () { gpgconf --kill all 2>/dev/null || true; }
|
||||||
at_exit_function _gnupg_exit
|
at_exit_function _gnupg_exit
|
||||||
mkdir -m 0700 "$GNUPGHOME"
|
mkdir -p -m 0700 "$GNUPGHOME"
|
||||||
openssl pkcs12 -export -passout pass: -inkey "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" \
|
openssl pkcs12 -export -passout pass: -inkey "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" \
|
||||||
< "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
|
< "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
|
||||||
gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
|
gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
|
||||||
|
|
Loading…
Add table
Reference in a new issue