t/lib-gpg: sanity-check that we can actually sign
authorJeff King <peff@peff.net>
Thu, 29 Jan 2015 15:51:11 +0000 (10:51 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Jan 2015 20:35:05 +0000 (12:35 -0800)
Some older versions of gpg (reportedly v1.2.6 from RHEL4) cannot
import the keyrings found in our test suite, and thus cannot even
make a signature. The previous change works it around, but we
cannot anticipate breakages update to GPG would cause in the future.

Do a test-sign before declaring the GPG prerequisite fulfilled
to future-proof our tests.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-gpg.sh
index 16e0d3fcafc9e410a51dae639c211228753d29ae..db2ef22e8f76a54c851424dd19c1232f6061392c 100755 (executable)
@@ -36,6 +36,8 @@ else
                        "$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
                gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \
                        "$TEST_DIRECTORY"/lib-gpg/ownertrust &&
+               gpg --homedir "${GNUPGHOME}" </dev/null >/dev/null 2>&1 \
+                       --sign -u committer@example.com &&
                test_set_prereq GPG
                ;;
        esac