summaryrefslogtreecommitdiffstats
path: root/tests/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-07-13 15:45:53 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-07-13 15:45:53 -0400
commitca58dff781a0da2bae04cccb40965deab30447be (patch)
treeeeba3b2927305b0c391aa86a90ec75723c199fa2 /tests/tests.sh
parentb8903ff0720d207661c6b879635496be15b1fb1b (diff)
downloadbfs-ca58dff781a0da2bae04cccb40965deab30447be.tar.xz
tests: Limit path lengths passed to mkdir
FreeBSD limits mkdir() to 1023 bytes, not 4096.
Diffstat (limited to 'tests/tests.sh')
-rwxr-xr-xtests/tests.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/tests.sh b/tests/tests.sh
index 96af49c..dce421a 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -1067,17 +1067,20 @@ function make_deep() {
name="${name}${name}${name}${name}"
name="${name:0:255}"
- # 4 * 4 * 256 - 1 == 4095 == PATH_MAX - 1
+ # 4 * 256 - 1 == 1023
local names="$name/$name/$name/$name"
- names="$names/$names/$names/$names"
for i in {0..9} A B C D E F; do
(
mkdir "$1/$i"
cd "$1/$i"
- mkdir -p "$names"
- cd "$names"
+ # 4 * 1024 == 4096 == PATH_MAX
+ for _ in {1..4}; do
+ mkdir -p "$names"
+ cd "$names"
+ done
+
$TOUCH "$name"
)
done