* tests/head/head-write-error.sh: Verify ENOSPC is output.
* tests/misc/yes.sh: Likewise.
---
tests/head/head-write-error.sh | 10 ++++------
tests/misc/yes.sh | 6 +++---
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/tests/head/head-write-error.sh b/tests/head/head-write-error.sh
index afa2807d7..3244adf83 100755
--- a/tests/head/head-write-error.sh
+++ b/tests/head/head-write-error.sh
@@ -19,6 +19,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ head
+getlimits_
if ! test -w /dev/full || ! test -c /dev/full; then
skip_ '/dev/full is required'
@@ -29,21 +30,18 @@ fi
yes | head -c10M > bigseek || framework_failure_
# This is the single output diagnostic expected,
-# (without the possibly varying :strerror(ENOSPC) suffix).
-printf '%s\n' "head: error writing 'standard output'" > exp
+printf '%s\n' "head: error writing 'standard output': $ENOSPC" > exp
# Memory is bounded in these cases
for item in lines bytes; do
for N in 0 1; do
# pipe case
- yes | returns_ 1 timeout 10s head --$item=-$N > /dev/full 2> errt || fail=1
- sed 's/\(head:.*\):.*/\1/' errt > err
+ yes | returns_ 1 timeout 10s head --$item=-$N > /dev/full 2> err || fail=1
compare exp err || fail=1
# seekable case
- returns_ 1 timeout 10s head --$item=-$N bigseek > /dev/full 2> errt \
+ returns_ 1 timeout 10s head --$item=-$N bigseek > /dev/full 2> err \
|| fail=1
- sed 's/\(head:.*\):.*/\1/' errt > err
compare exp err || fail=1
done
done
diff --git a/tests/misc/yes.sh b/tests/misc/yes.sh
index 59a6de55f..ba340c9fa 100755
--- a/tests/misc/yes.sh
+++ b/tests/misc/yes.sh
@@ -18,6 +18,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ yes
+getlimits_
# Check basic operation
test "$(yes | head -n1)" = 'y' || fail=1
@@ -47,11 +48,10 @@ fi
if test -w /dev/full && test -c /dev/full; then
# The single output diagnostic expected,
# (without the possibly varying :strerror(ENOSPC) suffix).
- printf '%s\n' "yes: standard output" > exp
+ printf '%s\n' "yes: standard output: $ENOSPC" > exp
for size in 1 16384; do
- returns_ 1 yes "$(printf %${size}s '')" >/dev/full 2>errt || fail=1
- sed 's/\(yes:.*\):.*/\1/' errt > err
+ returns_ 1 yes "$(printf %${size}s '')" >/dev/full 2>err || fail=1
compare exp err || fail=1
done
fi
--
2.52.0