On 19/05/2026 03:43, Collin Funk wrote:
Pádraig Brady <[email protected]> writes:
This looks good at a quick glance.
Do we need the uses_strace_ thing in the test?
I used 'require_strace_ write' since I wanted to skip the test when
strace is not available.
When I added uses_strace_, I added a call to it in require_strace_ so
that the strace call in the checks will not wait for input when invoking
AIX's unrelated program which would hang the tests.
I don't think it uses the correct number of arguments to do that at the
moment, but I figured it may change in the future. I don't expect anyone
to remember AIX specific programs, so might as well avoid running into
that problem.
We need to have the more involved check,
as strace 5.10 on Debian 11 at least fails due to strace
not supporting all the options.
I've pushed the attached which calls uses_strace_
and also skips if all the strace options are not supported.
Marking this bug as done.
cheers,
Padraig
From 157bdb2443815bda9085b0abdee609a2e1d96456 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Tue, 19 May 2026 18:45:26 +0100
Subject: [PATCH] tests: avoid false failures with older strace
* tests/tee/short-write.sh: Check that all the required strace
options are supported, which is not the case with strace 5.10 at least.
* tests/tee/write-eagain.sh: Likewise.
---
tests/tee/short-write.sh | 13 ++++++++++---
tests/tee/write-eagain.sh | 13 ++++++++++---
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/tests/tee/short-write.sh b/tests/tee/short-write.sh
index 42709260d..dde209b9d 100755
--- a/tests/tee/short-write.sh
+++ b/tests/tee/short-write.sh
@@ -18,14 +18,21 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ tee
-require_strace_ write
+uses_strace_
printf 'abcdef' >file1-exp || framework_failure_
printf 'f' >out-exp || framework_failure_
+short_write() {
+ strace -qqq -o /dev/null --trace-fds=1 -e trace=write \
+ -e inject=write:retval=1:when=1..5 "$@"
+}
+
+short_write true || skip_ No functional strace found
+
# In coreutils-9.11, a short write would be treated as an error.
-strace -qqq -o /dev/null --trace-fds=1 -e trace=write \
- -e inject=write:retval=1:when=1..5 tee file1 >out 2>err <file1-exp || fail=1
+# Using 'returns_ 0' to avoid tracing impinging on stderr.
+returns_ 0 short_write tee file1 >out 2>err <file1-exp || fail=1
compare file1-exp file1 || fail=1
compare out-exp out || fail=1
compare /dev/null err || fail=1
diff --git a/tests/tee/write-eagain.sh b/tests/tee/write-eagain.sh
index f434ee62b..b8a7167cc 100755
--- a/tests/tee/write-eagain.sh
+++ b/tests/tee/write-eagain.sh
@@ -18,12 +18,19 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ tee
-require_strace_ write
+uses_strace_
+
+write_eagain() {
+ timeout 10 strace -qqq -o /dev/null -e trace-fds=3 \
+ -e inject=write:error=EAGAIN:when=1 "$@"
+}
+
+write_eagain true || skip_ No functional strace found
# In coreutils-9.11 the following test would infinite loop.
+# Using 'returns_ 0' to avoid tracing impinging on stderr.
echo a >exp || framework_failure_
-timeout 10 strace -qqq -o /dev/null -e trace-fds=3 \
- -e inject=write:error=EAGAIN:when=1 tee file1 <exp >out 2>err || fail=1
+returns_ 0 write_eagain tee file1 <exp >out 2>err || fail=1
compare exp file1 || fail=1
compare exp out || fail=1
compare /dev/null err || fail=1
--
2.54.0