* 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.
---
 tests/csplit/csplit-io-err.sh | 7 ++-----
 tests/fold/fold-zero-width.sh | 2 +-
 tests/misc/io-errors.sh       | 3 ++-
 tests/misc/write-errors.sh    | 2 +-
 tests/split/split-io-err.sh   | 7 ++-----
 tests/tac/tac-continue.sh     | 3 ++-
 6 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/tests/csplit/csplit-io-err.sh b/tests/csplit/csplit-io-err.sh
index 783d2b2c9..6902f11e8 100755
--- a/tests/csplit/csplit-io-err.sh
+++ b/tests/csplit/csplit-io-err.sh
@@ -18,15 +18,12 @@
 
 . "${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
diff --git a/tests/fold/fold-zero-width.sh b/tests/fold/fold-zero-width.sh
index b4787eae0..4371e8b55 100755
--- a/tests/fold/fold-zero-width.sh
+++ b/tests/fold/fold-zero-width.sh
@@ -58,7 +58,7 @@ vm=$(get_min_ulimit_v_ fold /dev/null) && {
      "(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
 }
diff --git a/tests/misc/io-errors.sh b/tests/misc/io-errors.sh
index aa514f67c..e1f03f595 100755
--- a/tests/misc/io-errors.sh
+++ b/tests/misc/io-errors.sh
@@ -18,6 +18,7 @@
 
 . "${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'
@@ -80,7 +81,7 @@ while read writer; do
   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
diff --git a/tests/misc/write-errors.sh b/tests/misc/write-errors.sh
index 3773dda39..20ba0ab1c 100755
--- a/tests/misc/write-errors.sh
+++ b/tests/misc/write-errors.sh
@@ -82,7 +82,7 @@ while read writer; do
   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
diff --git a/tests/split/split-io-err.sh b/tests/split/split-io-err.sh
index 3eb9dbb93..2e3b3f632 100755
--- a/tests/split/split-io-err.sh
+++ b/tests/split/split-io-err.sh
@@ -18,15 +18,12 @@
 
 . "${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
diff --git a/tests/tac/tac-continue.sh b/tests/tac/tac-continue.sh
index 678c07799..4123755f2 100755
--- a/tests/tac/tac-continue.sh
+++ b/tests/tac/tac-continue.sh
@@ -21,6 +21,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ tac
 require_root_
+getlimits_
 
 cwd=$(pwd)
 cleanup_() { cd /; umount "$cwd/full_tmp"; }
@@ -37,7 +38,7 @@ seq 5 > five && seq 5 -1 1 > exp || framework_failure_
 
 # 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
-- 
2.52.0


Reply via email to