tests/smime: Always use --batch with gpgsm

GnuPG's gpgsm, like gpg, should always be used with --batch when it is
invoked in a non-interactive environment.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
Daniel Kahn Gillmor 2020-04-28 14:57:10 -04:00 committed by David Bremner
parent 055e0917d7
commit 6d843b8199

View file

@ -136,8 +136,8 @@ add_gpgsm_home ()
_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 -m 0700 "$GNUPGHOME"
gpgsm --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/test.crt >"$GNUPGHOME"/import.log 2>&1 gpgsm --batch --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/test.crt >"$GNUPGHOME"/import.log 2>&1
fpr=$(gpgsm --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p') fpr=$(gpgsm --batch --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p')
echo "$fpr S relax" >> $GNUPGHOME/trustlist.txt echo "$fpr S relax" >> $GNUPGHOME/trustlist.txt
test_debug "cat $GNUPGHOME/import.log" test_debug "cat $GNUPGHOME/import.log"
} }