Re: [PATCH v2 9/9] gpg-interface t: extend the existing GPG tests with GPGSM
From: Henning Schild <hidden>
Date: 2018-07-11 16:36:16
Am Wed, 11 Jul 2018 10:33:52 -0400 schrieb Jeff King [off-list ref]:
On Tue, Jul 10, 2018 at 10:52:31AM +0200, Henning Schild wrote:quoted
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh index a5d3b2cba..9dcb4e990 100755 --- a/t/lib-gpg.sh +++ b/t/lib-gpg.sh@@ -38,7 +38,14 @@ then "$TEST_DIRECTORY"/lib-gpg/ownertrust && gpg --homedir "${GNUPGHOME}" </dev/null >/dev/null2>&1 \ --sign -u committer@example.com && - test_set_prereq GPG + test_set_prereq GPG && + echo | gpgsm --homedir "${GNUPGHOME}" -o "$TEST_DIRECTORY"/lib-gpg/gpgsm.crt.user --passphrase-fd 0 --pinentry-mode loopback --generate-key --batch "$TEST_DIRECTORY"/lib-gpg/gpgsm-gen-key.in && + gpgsm --homedir "${GNUPGHOME}" --import "$TEST_DIRECTORY"/lib-gpg/gpgsm.crt.user && + gpgsm --homedir "${GNUPGHOME}" -K | grep fingerprint: | cut -d" " -f4 | tr -d '\n' > ${GNUPGHOME}/trustlist.txt && + echo " S relax" >> ${GNUPGHOME}/trustlist.txt && + (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && + echo hello | gpgsm --homedir "${GNUPGHOME}" -u committer@example.com -o /dev/null --sign - 2>&1 && + test_set_prereq GPGSMBy the way, I think these gpgsm invocations need some redirection of their stderr. This isn't inside a test_expect block, so they spew to the terminal even in non-verbose mode. Ideally they'd redirect to descriptor 4, which then respects "-v" properly (though the existing gpg invocations just go to 2).
Thanks for pointing that out. I decided to go for 2 as well, for consistency with gpg and not having to change that. Henning
-Peff