From: Pádraig Brady Date: Tue, 19 May 2026 17:45:26 +0000 (+0100) Subject: tests: avoid false failures with older strace X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=157bdb2443815bda9085b0abdee609a2e1d96456;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/tests/tee/short-write.sh b/tests/tee/short-write.sh index 42709260d2..dde209b9dd 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 out 2>err exp || framework_failure_ -timeout 10 strace -qqq -o /dev/null -e trace-fds=3 \ - -e inject=write:error=EAGAIN:when=1 tee file1 out 2>err || fail=1 +returns_ 0 write_eagain tee file1 out 2>err || fail=1 compare exp file1 || fail=1 compare exp out || fail=1 compare /dev/null err || fail=1