From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 687E11F406 for ; Wed, 16 May 2018 01:58:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752309AbeEPB6R (ORCPT ); Tue, 15 May 2018 21:58:17 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:47304 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbeEPB6Q (ORCPT ); Tue, 15 May 2018 21:58:16 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:64f1:3b3f:8f13:59ed]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id A92D260735; Wed, 16 May 2018 01:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1526435894; bh=ZwU1rVb4LwHxL0TAHrv9DCTAzxrxHYfm6ek1EujJzu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=vMhaULU1cTEGxJM21dFdX2t0n8q2fVwgVYzs+Tae4x5tR5M6vU7lIQptVNArrZRnC B3/TaxHr/12xdVIEtE+Vsna2DkaZ0X1pFSNxnEp0ftgIEZ0cz4PIeAEViOEy12M4FZ rSl4dfOzQ4kYSM27aArkDYNAZHa5+PCSF+OjGXdXLXwHUjZHjFSDGH9r1Bh4hPIAJT pknqIQevalcOxSZ2bTnDj0mOZRwGtYoQ+s1bFBW+cZPhwwHHOrFqpRcEEQBs+2YccB NMA9EKQ1O5Xc9kF0Qb5B1sZ+nFjASPh32xkGXHOm7j3DuKN0czbO2dlgmrRmWborOd UeUyhyI6qJOYlIgpmScJOSJvyMhBrvIGj39pwT0j0w+Sn+YD6h7t9ew3Mbv/eVKRe0 uhg8rLNtZm6r3AOuIHSnyuen6kFL/fol6SA9ndKMaATRFO4KHUJYZZ+16mQ1B+Duvf AUnOUnMpp2mS7dYydEOOtljpGPdPWXavFnio8pJ81JHuNtVCoV5 From: "brian m. carlson" To: git@vger.kernel.org Cc: Junio C Hamano , =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= , =?UTF-8?q?Martin=20=C3=85gren?= , Eric Sunshine , Johannes Sixt Subject: [PATCH v3 01/28] t/test-lib: add an SHA1 prerequisite Date: Wed, 16 May 2018 01:56:03 +0000 Message-Id: <20180516015630.661349-2-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d In-Reply-To: <20180516015630.661349-1-sandals@crustytoothpaste.net> References: <20180516015630.661349-1-sandals@crustytoothpaste.net> X-Scanned-By: MIMEDefang 2.79 on 127.0.1.1 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 --- 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 +'