* tests/csplit/csplit-io-err.sh: Adjust determination of ENOSPC.
* tests/csplit/split-io-err.sh: Likewise.
* tests/fold/fold-zero-width.sh: Verify full ENOSPC message.
* tests/tac/tac-continue.sh: Likewise.
* tests/misc/io-errors.sh: Likewise.
* tests/misc/write-errors.sh: Likewise.
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ csplit
+getlimits_
cp -sf /dev/full xx01 || skip_ '/dev/full is required'
-# Get the wording of the OS-dependent ENOSPC message
-returns_ 1 seq 1 >/dev/full 2>msgt || framework_failure_
-sed 's/seq: write error: //' msgt > msg || framework_failure_
-
# Create the expected error message
-{ printf "%s" "csplit: xx01: " ; cat msg ; } > exp || framework_failure_
+printf '%s\n' "csplit: xx01: $ENOSPC" > exp || framework_failure_
# the 'csplit' command should fail with exit code 1
seq 2 | returns_ 1 csplit - 1 2> err || fail=1
test "$LOCALE_FR_UTF8" != none || skip_ "French UTF-8 locale not available"
-LC_ALL=$LOCALE_FR_UTF8
-export LC_ALL
+# Only set LC_CTYPE so messages are not translated
+# as we're verifying $ENOSPC below
+unset LC_ALL
+LC_CTYPE=$LOCALE_FR_UTF8
+export LC_CTYPE
test $(env printf '\u200B' | wc -L) -eq 0 ||
skip_ "character width mismatch"
"(ulimit -v $(($vm+12000)) && fold 2>err >/dev/full)"
ret=$?
test -f err || skip_ 'shell ulimit failure'
- { test $ret = 124 || ! grep 'space' err >/dev/null; } &&
+ { test $ret = 124 || ! grep "$ENOSPC" err >/dev/null; } &&
{ fail=1; cat err; echo "fold didn't diagnose ENOSPC" >&2; }
done
}
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ env
+getlimits_
if ! test -w /dev/full || ! test -c /dev/full; then
skip_ '/dev/full is required'
rm -f full.err || framework_failure_
timeout 10 env --default-signal=PIPE $SHELL -c \
"(env $writer 2>full.err >/dev/full)"
- { test $? = 124 || ! grep -E 'write error|space' full.err >/dev/null; } &&
+ { test $? = 124 || ! grep -E "write error|$ENOSPC" full.err >/dev/null; } &&
{ fail=1; cat full.err; echo "$writer: failed to exit" >&2; }
# Check closed pipe handling
rm -f full.err || framework_failure_
timeout 10 env --default-signal=PIPE $SHELL -c \
"($ulimit && $writer 2>full.err >/dev/full)"
- { test $? = 124 || ! grep 'space' full.err >/dev/null; } &&
+ { test $? = 124 || ! grep "$ENOSPC" full.err >/dev/null; } &&
{ fail=1; cat full.err; echo "$writer: failed to exit" >&2; }
# Check closed pipe handling
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
+getlimits_
cp -sf /dev/full xaa || skip_ '/dev/full is required'
-# Get the wording of the OS-dependent ENOSPC message
-returns_ 1 seq 1 >/dev/full 2>msgt || framework_failure_
-sed 's/seq: write error: //' msgt > msg || framework_failure_
-
# Create the expected error message
-{ printf "%s" "split: xaa: " ; cat msg ; } > exp || framework_failure_
+printf '%s\n' "split: xaa: $ENOSPC" > exp || framework_failure_
# the 'split' command should fail with exit code 1
seq 2 | returns_ 1 split -b 1 2> err || fail=1
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ tac
require_root_
+getlimits_
cwd=$(pwd)
cleanup_() { cd /; umount "$cwd/full_tmp"; }
# Make sure we diagnose the failure but continue to subsequent files
yes | TMPDIR=$cwd/full_tmp timeout 10 tac - five >out 2>err && fail=1
-{ test $? = 124 || ! grep 'space' err >/dev/null; } && fail=1
+{ test $? = 124 || ! grep "$ENOSPC" err >/dev/null; } && fail=1
compare exp out || fail=1
Exit $fail