X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Ftest-lib.sh;h=6a62b5c1568a82c0891d32085764c903797a9171;hp=7f8a3a4dd93ace28c3bb4bcb8d64972e92cbe338;hb=055e0917d73619bb78c6ed9a6068422f40967dcd;hpb=1979145b91fa85d6952b94db561a46238265d910 diff --git a/test/test-lib.sh b/test/test-lib.sh index 7f8a3a4d..6a62b5c1 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -129,6 +129,19 @@ add_gnupg_home () printf '%s:6:\n' "$FINGERPRINT" | gpg --quiet --batch --no-tty --import-ownertrust } +add_gpgsm_home () +{ + local fpr + [ -d ${GNUPGHOME} ] && return + _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; } + at_exit_function _gnupg_exit + 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 + fpr=$(gpgsm --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p') + echo "$fpr S relax" >> $GNUPGHOME/trustlist.txt + test_debug "cat $GNUPGHOME/import.log" +} + # Each test should start with something like this, after copyright notices: # # test_description='Description of this test...