]> git.ipfire.org Git - thirdparty/git.git/commit
t: increase test coverage of signature verification output
authorHans Jerry Illikainen <hji@dyntopia.com>
Wed, 4 Mar 2020 11:48:03 +0000 (11:48 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 15 Mar 2020 16:45:58 +0000 (09:45 -0700)
commitf1e3df316992d32b17ee27385e4c644ef7b66cc1
tree10db19138ba169fe822db9ab49dd2943bd2e4b2e
parente63cefb024895fcff4b692cad84cb33ac4c81dcc
t: increase test coverage of signature verification output

There weren't any tests for unsuccessful signature verification of
signed merge tags shown in 'git log'.  There also weren't any tests for
the GPG output from 'git fmt-merge-msg'.  This was noticed while
investigating a buggy refactor that slipped through the test suite; see
commit 72b006f4bfd30b7c5037c163efaf279ab65bea9c.

This commit adds signature verification tests to the 'log' and
'fmt-merge-msg' builtins.

Thanks to Linus Torvalds for reporting and finding the (now reverted)
commit that introduced the regression.

Note that the "log --show-signature for merged tag with GPG failure"
test case is really hacky.  It relies on an implementation detail of
verify_signed_buffer() -- namely, it assumes that the signature is
written to a temporary file whose path is under TMPDIR.

The rationale for that test case is to check whether the code path that
yields the "No signature" message is reachable on failure.  The
functionality in log-tree.c that may show this message does some
pre-parsing of a possible signature that prevents the GPG interface from
being invoked if a signature is actually missing.  And I haven't been
able to construct a signature that both 1. satisfies that
pre-processing, and 2. causes GPG to fail without any sort of output on
stderr along the lines of "this is a bogus/corrupt/... signature" (the
"No signature" message should only be shown if GPG produce no output).

Signed-off-by: Hans Jerry Illikainen <hji@dyntopia.com>
[jc: fixed missing test title noticed by Dscho]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4202-log.sh
t/t6200-fmt-merge-msg.sh