From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 2EDC61F453 for ; Fri, 8 Feb 2019 22:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727132AbfBHWfP (ORCPT ); Fri, 8 Feb 2019 17:35:15 -0500 Received: from cloud.peff.net ([104.130.231.41]:38192 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726894AbfBHWfO (ORCPT ); Fri, 8 Feb 2019 17:35:14 -0500 Received: (qmail 27628 invoked by uid 109); 8 Feb 2019 22:35:14 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Fri, 08 Feb 2019 22:35:14 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 27894 invoked by uid 111); 8 Feb 2019 22:35:23 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) SMTP; Fri, 08 Feb 2019 17:35:23 -0500 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Fri, 08 Feb 2019 17:35:12 -0500 Date: Fri, 8 Feb 2019 17:35:12 -0500 From: Jeff King To: "Randall S. Becker" Cc: "'brian m. carlson'" , 'Junio C Hamano' , git@vger.kernel.org, 'Linux Kernel' , git-packagers@googlegroups.com Subject: Re: [Breakage] Git v2.21.0-rc0 - t5318 (NonStop) Message-ID: <20190208223512.GA2135@sigill.intra.peff.net> References: <000f01d4bf9e$a508eab0$ef1ac010$@nexbridge.com> <20190208165052.GC23461@sigill.intra.peff.net> <001101d4bfd6$b9430230$2bc90690$@nexbridge.com> <20190208180321.GB27673@sigill.intra.peff.net> <002501d4bfde$b26e6050$174b20f0$@nexbridge.com> <20190208191519.GF27673@sigill.intra.peff.net> <002b01d4bfe4$2d617f40$88247dc0$@nexbridge.com> <20190208193157.GA30952@sigill.intra.peff.net> <20190208220714.GG11927@genre.crustytoothpaste.net> <005901d4bffb$6d0c34c0$47249e40$@nexbridge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <005901d4bffb$6d0c34c0$47249e40$@nexbridge.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Feb 08, 2019 at 05:12:43PM -0500, Randall S. Becker wrote: > On February 8, 2019 17:07, brian m. carlson wrote: > > On Fri, Feb 08, 2019 at 02:31:57PM -0500, Jeff King wrote: > > > > It is available AFAIK on Linux, POSIX, and Windows under Cygwin. > > > > That's more than /dev/zero has anyway. I have the patch ready if you > > > > want it. > > > > > > Is it POSIX? Certainly truncate() is, but I didn't think the > > > command-line tool was. If it really is available everywhere, then > > > yeah, I'd be fine with it. > > > > It's not. POSIX doesn't specify the command, and macOS lacks it, I believe. > > I'm happy to modify the test (it is in one spot), to make a decision based on: > a) whether /dev/zero exists > b) whether the system is a NonStop > c) something else > > What would you all prefer? It doesn't matter to me one way or another, > as long as I can get the dependency to /dev/zero removed so tests will > run here. For the case in t5318, I think we can just put the NULs in a file. Does this work on your platform? --- diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 16d10ebce8..6d0ccc7eba 100755 --- a/t/t5318-commit-graph.sh +++ b/t/t5318-commit-graph.sh @@ -383,7 +383,8 @@ corrupt_graph_and_verify() { cp $objdir/info/commit-graph commit-graph-backup && printf "$data" | dd of="$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc && dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=0 && - dd if=/dev/zero of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=$(($orig_size - $zero_pos)) && + gen_zero_bytes $(($orig_size - $zero_pos)) >zeroes && + dd if=zeroes of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" && test_must_fail git commit-graph verify 2>test_err && grep -v "^+" test_err >err && test_i18ngrep "$grepstr" err diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 92cf8f812c..4afab14431 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1302,3 +1302,8 @@ test_set_port () { port=$(($port + ${GIT_TEST_STRESS_JOB_NR:-0})) eval $var=$port } + +# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes). +gen_zero_bytes () { + perl -e 'print "\0" x $ARGV[0]' "$@" +} For the others that need infinite zeroes, I think using "yes" makes more sense, though we could also teach this function to accept an "infinity" parameter. -Peff