From nobody Tue Jun 9 08:17:46 2026 X-Original-To: dev-commits-src-branches@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 4gZMGf6xX0z6hb2G for ; Tue, 09 Jun 2026 08:17:46 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gZMGf5HsWz3DHR for ; Tue, 09 Jun 2026 08:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780993066; 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=40pxJ+Jw3XFbEjFmipGZou/f4539RkyNoJE64bOokAA=; b=cNgXgvpZpIttWtNOHVysfTht609iRIHdKYg00gcqC2lwJGbOv3AyvGRGeymnNfdLgj598a hFbxKzvWK14aHtZ9xGA2X4p0aKka8NaBUYCtRvCy3zIiMkMzVdNw88o0znshQnq7RoIkof m//KKD8S1A/f+E9J5/5KQj04XqclQlKl0O/U3NdgRcpOWCWhzOClkeRmR9dzE0Gmra/ZLp vKQ/NsX6nq0gvJt9jAKn6DIzWYwcnWsdSyXbT8sw8cIeJeSz5dZwyR4K43ggxiKQHXbaD0 o3bYb4zsIEuMNS2qwRGIe9l+BuSMTe7LiO8SrZ9Nm24S+uUP39550ghxUELxbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780993066; a=rsa-sha256; cv=none; b=DTfrCcE5sxJCh/YOCRWW1XUT2g6xMr6Cjca76DcsftBu1fwfkTQctzjirLjt3jK+H8ANId eZiYyvDaZU/kLIUcdcyXLwrOpjupTLnKk0FZwPJv/oyRctTZEDgxM1hEAiOF9wV1CXclSX CcOYhBHsCpdI7PQRnfr+QTEieGCidqcJDF72sibq+3fxp6VxH5+by50PZV+8riGjS+Kq7L FgveHghA3lD/3EXtm2CN0dQce8MatXYKOW7Ym97Nn/82U9lt8EbQeoE61rPUlCWR3R1LNx tKAFjH/Ztc2D6X7hJhVHIdJUJwQPTqqaokHBDDy5PqYnEnsD1dAKT7Z/FpoHNw== 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=1780993066; 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=40pxJ+Jw3XFbEjFmipGZou/f4539RkyNoJE64bOokAA=; b=q5UJlvG/EpAWXjAjnOGc1my0TK4fr6Kz6R04T6b9v38S9VOS/VI8TfS6ecN93LjVHNStez R+g0sCEzgn79mkq3vyF+5Ug6I5oqUXzUnO0y8D3Dx4iF6MOddWTkayHQx3NDnlzXkcmyrE rOzWIManJRfiIqKAZ/EjtxsCPfR+M/Dg0pugZez0gBTpAR6+UHKtBFgsVUci8BG8OBVY6Z mujJdpkEqACkNAKg725/eUQGFH0H/LCJKdSKsvdJuIJby5OvifDkrOce+eUUS2A+z1cFqY rSZwa72TjYSw/pwrEmz31p3Fhbbg8RfMmjdXgR+7sJ+sDQB9YPeAWuj/OErdhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gZMGf4q2Vz9tp for ; Tue, 09 Jun 2026 08:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47c83 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 09 Jun 2026 08:17:46 +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: 7062e428a627 - stable/14 - stat: Nits in stat tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/14 X-Git-Reftype: branch X-Git-Commit: 7062e428a6275d8624d27d4608424f6968d7e0f3 Auto-Submitted: auto-generated Date: Tue, 09 Jun 2026 08:17:46 +0000 Message-Id: <6a27cc2a.47c83.1e62780c@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7062e428a6275d8624d27d4608424f6968d7e0f3 commit 7062e428a6275d8624d27d4608424f6968d7e0f3 Author: Dag-Erling Smørgrav AuthorDate: 2026-04-08 15:35:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-06-09 08:10:44 +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.