]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid false-failure of split/filter.sh on XFS
authorJim Meyering <meyering@fb.com>
Mon, 7 Mar 2016 00:38:01 +0000 (16:38 -0800)
committerJim Meyering <meyering@fb.com>
Mon, 7 Mar 2016 03:38:21 +0000 (19:38 -0800)
* tests/split/filter.sh: Use OFF_T_MAX-1 rather than OFF_T_MAX
as the size of a test file, to avoid false failure on an XFS file
system (or any file system permitting a file of size OFF_T_MAX).
Reported as http://bugs.gnu.org/22931

tests/split/filter.sh

index a93008bb764cdbc85014c5fc850f893cf6fcb37f..bd2f2100b480800b054271ea8fa7bdd5a7d6d79c 100755 (executable)
@@ -52,9 +52,13 @@ returns_ 1 split -n 1/2 --filter='true' /dev/null 2>&1 || fail=1
 # where they would result in a non zero exit from split.
 yes | head -n200K | split -b1G --filter='head -c1 >/dev/null' || fail=1
 
+# Do not use a size of OFF_T_MAX, since split.c applies a GNU/Hurd
+# /dev/zero workaround for files of that size.  Use one less:
+N=$(expr $OFF_T_MAX - 1)
+
 # Ensure that "endless" input is ignored when all filters finish
 timeout 10 sh -c 'yes | split --filter="head -c1 >/dev/null" -n r/1' || fail=1
-if truncate -s$OFF_T_MAX zero.in; then
+if truncate -s$N zero.in; then
   timeout 10 sh -c 'split --filter="head -c1 >/dev/null" -n 1 zero.in' || fail=1
 fi