From nobody Wed Apr 15 07:53:52 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fwYLS3qkWz6ZTDL for ; Wed, 15 Apr 2026 07:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwYLS2bnzz49YB for ; Wed, 15 Apr 2026 07:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776239632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N+Vqm4/FAmdChYBau9bRYm6bXXYEcK0ThXUdCux6zaU=; b=vG9OHmIsIVOn2PPvCwQkRFYGTMsGBKNKKjlqNgOlSRZws12dS/X8P3XjW0YwME/bCyYf4O i5PMK1C8TRRylklSBj3Y5BceTiH8Ak6ROvXvxJiYAx9xi+4UdeMEdS8Apgs9ghKhSCehOm PR9Jn5yBP8QYhdP9W05bjBCBq5MhAfzILwhCm+UFvCAYPO4pk4020xN4O2uV9I5wrO7s7B hMbREqhuzdWQedPmE3hT842q0z4g+UN27N3CWUUNk2ICGXa/yoB8xhHwc/C8vbcNRvEqD4 3fLgbdtyygkoSi4dufM/lGF8hDg83YgepIvzPaMO9lwIhp9y/ouB9mvUY9ui4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776239632; a=rsa-sha256; cv=none; b=O+3g1hEepggRpQS9i79yLdQ45n1ulCdx49gepfEYueT7MM7v30/nSmcesF5XUvBdj5lMIB I53t0HqaVLOERD2wvWt6FfzbOvB0k53ikdBBiEInEanexCKJAv+Ut5Nu/B4fOC8AHuGbjH snXRDQVaiaz6PjUVS5uLTML5w57uGC2M1zTuZ7R2RfeHLoVGdb9ogYywPYsKfjds3t1vkZ fG574moCYlKluAd6eleue6aL1RBBmNy5D/rcYk2jQteExdnraUTBnlpuo4I8uhyB+ucpAC hQ9DVkgL5bKsVtnZhJXNhfkhGofaDbtMCJSoCU0MKKSpOhrj26/1CIuF+zAKwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776239632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N+Vqm4/FAmdChYBau9bRYm6bXXYEcK0ThXUdCux6zaU=; b=Rms4wHpPFbLFzPIpt/vg6TKKIScvtQe6M+Kysh3N22UScoMMpDhLj8UJzzDhUS8c4DF+Bw 4CJkS1p2wl9fjLXlgALC3Y3KxCljk/Gk/iK1OcyWqGTXU2CfESSBPGEb8ezPObaHD6EXTh u3pEbz2LtKm4dlC2XW+jSHPKRuSViRsEzSIG9NZZQ8n4OxHkRIK/nSQKZ9wwEMuenZRuyn zo4/W2COb3dgmArQlinulZBd7MPmjs2q/AUjJma88pg4bofpywGGCp9TxMMi2qGvnqAUdl l3khTQoN6EeFh1qvaFX6L18B8LGBm/RYVLTK3PCROB0oSJXX+MZCp5QEtejkjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwYLS277zz1Qgm for ; Wed, 15 Apr 2026 07:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45765 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 07:53:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 94d4be9a166a - stable/15 - stat: Nits in stat tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 94d4be9a166ab8761e607f8cce1a9402b8438892 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 07:53:52 +0000 Message-Id: <69df4410.45765.4773ec79@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=94d4be9a166ab8761e607f8cce1a9402b8438892 commit 94d4be9a166ab8761e607f8cce1a9402b8438892 Author: Dag-Erling Smørgrav AuthorDate: 2026-04-08 15:35:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-15 07:52:19 +0000 stat: Nits in stat tests * Use ourselves as test file instead of /COPYRIGHT, which may or may not be present in the test environment. * atf-check understands \n in strings, use it. * Some file systems don't like creating small holes, so create large ones instead. This means we need two variables: ps (page size) is the minimum size of a data region and the alignment for a hole, while hs (hole size) is the minimum size of the holes we create. This makes no difference on FreeBSD but makes it easier to port the test to other platforms. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D56304 (cherry picked from commit 8cbd3949297d56e3960dcde73bd7e2277ac4bee8) --- usr.bin/stat/tests/stat_test.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/usr.bin/stat/tests/stat_test.sh b/usr.bin/stat/tests/stat_test.sh index afe698575034..6043686396be 100755 --- a/usr.bin/stat/tests/stat_test.sh +++ b/usr.bin/stat/tests/stat_test.sh @@ -54,6 +54,7 @@ h_flag_head() } h_flag_body() { + file=$(realpath $0) # POSIX defines a hole as “[a] contiguous region of bytes # within a file, all having the value of zero” and requires # that “all seekable files shall have a virtual hole starting @@ -82,27 +83,27 @@ h_flag_body() atf_check -o inline:"$((ps)) .\n" stat -h . atf_check -o inline:"$((ps)) ." stat -hn . - # For a file, prints a list of holes. + # For a file, prints a list of holes. Some file systems don't + # like creating small holes, so we create large ones instead. + hs=$((16*1024*1024)) atf_check truncate -s 0 foo atf_check -o inline:"0 foo" \ stat -hn foo - atf_check truncate -s "$((ps))" foo - atf_check -o inline:"0-$((ps-1)) foo" \ + atf_check truncate -s "$((hs))" foo + atf_check -o inline:"0-$((hs-1)) foo" \ stat -hn foo - atf_check dd status=none if=/COPYRIGHT of=foo \ - oseek="$((ps))" bs=1 count=1 - atf_check -o inline:"0-$((ps-1)),$((ps+1)) foo" \ + atf_check dd status=none if="${file}" of=foo \ + oseek="$((hs))" bs=1 count=1 + atf_check -o inline:"0-$((hs-1)),$((hs+1)) foo" \ stat -hn foo - atf_check truncate -s "$((ps*3))" foo - atf_check -o inline:"0-$((ps-1)),$((ps*2))-$((ps*3-1)) foo" \ + atf_check truncate -s "$((hs*3))" foo + atf_check -o inline:"0-$((hs-1)),$((hs+ps))-$((hs*3-1)) foo" \ stat -hn foo # Test multiple files. - atf_check dd status=none if=/COPYRIGHT of=bar + atf_check dd status=none if="${file}" of=bar sz=$(stat -f%z bar) - atf_check -o inline:"0-$((ps-1)),$((ps*2))-$((ps*3-1)) foo -$((sz)) bar -" \ + atf_check -o inline:"0-$((hs-1)),$((hs+ps))-$((hs*3-1)) foo\n$((sz)) bar\n" \ stat -h foo bar # For a device, fail.