Browse Source

tests: squelch noise from GPG machinery set-up

It is distracting to let the GPG message while setting up the test
gpghome leak into the test output, especially without running these
tests with "-v" option.

The splitting of RFC1991 prerequiste part is about future-proofing.
When we want to define other kinds of specific prerequisites in the
future, we'd prefer to see it done separately from the basic set-up
code.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Junio C Hamano 10 years ago
parent
commit
4b0bf39dd5
  1. 26
      t/lib-gpg.sh

26
t/lib-gpg.sh

@ -16,23 +16,25 @@ else
# Type DSA and Elgamal, size 2048 bits, no expiration date. # Type DSA and Elgamal, size 2048 bits, no expiration date.
# Name and email: C O Mitter <committer@example.com> # Name and email: C O Mitter <committer@example.com>
# No password given, to enable non-interactive operation. # No password given, to enable non-interactive operation.
mkdir ./gpghome mkdir ./gpghome &&
chmod 0700 ./gpghome chmod 0700 ./gpghome &&
GNUPGHOME="$(pwd)/gpghome" GNUPGHOME="$(pwd)/gpghome" &&
export GNUPGHOME export GNUPGHOME &&
gpg --homedir "${GNUPGHOME}" --import \ gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
"$TEST_DIRECTORY"/lib-gpg/keyring.gpg "$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
gpg --homedir "${GNUPGHOME}" --import-ownertrust \ gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \
"$TEST_DIRECTORY"/lib-gpg/ownertrust "$TEST_DIRECTORY"/lib-gpg/ownertrust &&
test_set_prereq GPG test_set_prereq GPG
if echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1
then
test_set_prereq RFC1991
fi
;; ;;
esac esac
fi fi


if test_have_prereq GPG &&
echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1
then
test_set_prereq RFC1991
fi

sanitize_pgp() { sanitize_pgp() {
perl -ne ' perl -ne '
/^-----END PGP/ and $in_pgp = 0; /^-----END PGP/ and $in_pgp = 0;

Loading…
Cancel
Save