[PATCH v2 06/16] Prefer gpg2 in the test suite if available

Tomi Ollila tomi.ollila at iki.fi
Sun Jan 24 07:25:26 PST 2016


On Wed, Jan 20 2016, Daniel Kahn Gillmor <dkg at fifthhorseman.net> wrote:

> Now that the notmuch client prefers gpg2 if available, having the test
> suite use the same preference makes it more likely to validate as
> expected.
>
> Be warned that the final test in T350-crypto.sh fails with an infinite
> loop in gpg if you're using an unpatched GnuPG 2.1.10, due to an
> upstream GnuPG bug: https://bugs.gnupg.org/gnupg/issue2187.  In
> debian, this is resolved in 2.1.10-3
> ---
>  test/README         |  2 +-
>  test/T030-config.sh |  2 +-
>  test/T040-setup.sh  |  2 +-
>  test/T350-crypto.sh | 16 ++++++++--------
>  test/test-lib.sh    | 10 +++++++++-
>  5 files changed, 20 insertions(+), 12 deletions(-)
>
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -85,6 +85,13 @@ unset GREP_OPTIONS
>  # For emacsclient
>  unset ALTERNATE_EDITOR
>  
> +# choose the preferred GnuPG binary:
> +if hash gpg2 2> /dev/null; then

For consistency, instead of hash ... 2>/dev/null, use command -v >/dev/null

Tomi

> +    GPG=gpg2
> +else
> +    GPG=gpg
> +fi
> +
>  # Convenience
>  #
>  # A regexp to match 5 and 40 hexdigits
> @@ -1139,6 +1146,7 @@ test_emacs () {
>  				$load_emacs_tests \
>  				--eval '(setq server-name \"$server_name\")' \
>  				--eval '(server-start)' \
> +				--eval '(setq epg-gpg-program \"$GPG\")' \
>  				--eval '(orphan-watchdog $$)'" || return
>  		EMACS_SERVER="$server_name"
>  		# wait until the emacs server is up
> @@ -1327,5 +1335,5 @@ test_declare_external_prereq dtach
>  test_declare_external_prereq emacs
>  test_declare_external_prereq ${TEST_EMACSCLIENT}
>  test_declare_external_prereq gdb
> -test_declare_external_prereq gpg
> +test_declare_external_prereq gpg2 || test_declare_external_prereq gpg
>  test_declare_external_prereq ${NOTMUCH_PYTHON}
> -- 
> 2.7.0.rc3


More information about the notmuch mailing list