aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2026-04-18 12:48:04 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2026-04-18 12:48:04 +0000
commitd618ba314d1452c1cb4360e15ae1c80adac48306 (patch)
tree1423d4790e19be17e348873e6bfabf09512cc7de
parent9899c8da0c19e66bedf37dd914e13880089877e2 (diff)
du: Set BLOCKSIZE before running tests
Several testcases assume BLOCKSIZE=K, so set it at the top of the script. This fixes an issue where the tests would sometimes fail when run under sudo. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D56476
-rwxr-xr-xusr.bin/du/tests/du_test.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh
index 58ff1c3ecbd8..16accdcb42a1 100755
--- a/usr.bin/du/tests/du_test.sh
+++ b/usr.bin/du/tests/du_test.sh
@@ -23,6 +23,10 @@
# SUCH DAMAGE.
#
+# This is the default in a FreeBSD login session, but may be unset if
+# run under sudo or in a different environment.
+export BLOCKSIZE=K
+
require_sparse_file_support()
{
if ! getconf MIN_HOLE_SIZE "$(pwd)"; then