From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Martin Ågren" <martin.agren@gmail.com>,
"Eric Sunshine" <sunshine@sunshineco.com>
Subject: [PATCH v2 01/28] t/test-lib: add an SHA1 prerequisite
Date: Sun, 13 May 2018 02:24:11 +0000 [thread overview]
Message-ID: <20180513022438.60003-2-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20180513022438.60003-1-sandals@crustytoothpaste.net>
There are some basic tests in our codebase that test that we get fixed
SHA-1 values. These are valuable because they make sure that our SHA-1
implementation is free of bugs, but obviously these tests will fail with
a different hash.
There are also tests which intentionally produce objects that have
collisions when truncated to a certain length to test our handling of
these cases. These tests, too, will fail with a different hash.
Add an SHA1 prerequisite to annotate both of these types of tests and
disable them when we're using a different hash. In the future, we will
create versions of these tests which handle both SHA-1 and NewHash.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
t/test-lib.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ea2bbaaa7a..fce728d2ea 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1212,3 +1212,10 @@ test_lazy_prereq TIME_T_IS_64BIT 'test-tool date time_t-is64bit'
test_lazy_prereq CURL '
curl --version
'
+
+# SHA1 is a test if the hash algorithm in use is SHA-1. This is both for tests
+# which will not work with other hash algorithms and tests that work but don't
+# test anything meaningful (e.g. special values which cause short collisions).
+test_lazy_prereq SHA1 '
+ test $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
+'
next prev parent reply other threads:[~2018-05-13 2:25 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-13 2:24 [PATCH v2 00/28] Hash-independent tests (part 2) brian m. carlson
2018-05-13 2:24 ` brian m. carlson [this message]
2018-05-13 2:24 ` [PATCH v2 02/28] t/test-lib: introduce ZERO_OID brian m. carlson
2018-05-13 2:24 ` [PATCH v2 03/28] t: switch $_z40 to $ZERO_OID brian m. carlson
2018-05-13 2:24 ` [PATCH v2 04/28] t/test-lib: introduce OID_REGEX brian m. carlson
2018-05-13 2:24 ` [PATCH v2 05/28] t: switch $_x40 to $OID_REGEX brian m. carlson
2018-05-13 2:24 ` [PATCH v2 06/28] t0000: annotate with SHA1 prerequisite brian m. carlson
2018-05-13 2:24 ` [PATCH v2 07/28] t1007: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 08/28] t1512: skip test if not using SHA-1 brian m. carlson
2018-05-13 2:24 ` [PATCH v2 09/28] t4044: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 10/28] t: skip pack tests " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 11/28] t2203: abstract away SHA-1-specific constants brian m. carlson
2018-05-13 2:24 ` [PATCH v2 12/28] t3103: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 13/28] t3702: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 14/28] t3905: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 15/28] t4007: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 16/28] t4008: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 17/28] t4014: " brian m. carlson
2018-05-13 7:34 ` Johannes Sixt
2018-05-13 17:46 ` brian m. carlson
2018-05-13 2:24 ` [PATCH v2 18/28] t4020: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 19/28] t4022: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 20/28] t4029: fix test indentation brian m. carlson
2018-05-13 2:24 ` [PATCH v2 21/28] t4029: abstract away SHA-1-specific constants brian m. carlson
2018-05-13 2:24 ` [PATCH v2 22/28] t4030: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 23/28] t/lib-diff-alternative: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 24/28] t4205: sort log output in a hash-independent way brian m. carlson
2018-05-13 2:24 ` [PATCH v2 25/28] t4042: abstract away SHA-1-specific constants brian m. carlson
2018-05-13 2:24 ` [PATCH v2 26/28] t4045: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 27/28] t4208: " brian m. carlson
2018-05-13 2:24 ` [PATCH v2 28/28] t5300: " brian m. carlson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180513022438.60003-2-sandals@crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=martin.agren@gmail.com \
--cc=pclouds@gmail.com \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).