From: Collin Funk Date: Sat, 17 Jan 2026 22:26:26 +0000 (-0800) Subject: tests: avoid a test hang on AIX X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1d13a499a5de898af8a21dc9e8a975018478830;p=thirdparty%2Fcoreutils.git tests: avoid a test hang on AIX * init.cfg (uses_strace_): New function. (require_strace_): Use it. tests/cksum/cksum-c.sh: Likewise. tests/misc/read-errors.sh: Likewise. --- diff --git a/init.cfg b/init.cfg index 82d70b77fb..f453279bfa 100644 --- a/init.cfg +++ b/init.cfg @@ -246,6 +246,8 @@ require_strace_() { test $# = 1 || framework_failure_ + uses_strace_ + strace -V < /dev/null > /dev/null 2>&1 || skip_ 'no strace program' @@ -837,4 +839,15 @@ bad_unicode () env printf '\xC3|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n' } +# AIX has a 'strace' program unrelated to the one we care about. Avoid +# executing it since it will run forever until manually killed when given +# three to seven arguments. +uses_strace_ () +{ + strace true > /dev/null 2>&1 + if test $? -ne 0; then + strace () { false; } + fi +} + sanitize_path_ diff --git a/tests/cksum/cksum-c.sh b/tests/cksum/cksum-c.sh index b2b6c47598..cfb29f1378 100755 --- a/tests/cksum/cksum-c.sh +++ b/tests/cksum/cksum-c.sh @@ -18,6 +18,7 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ cksum shuf +uses_strace_ shuf -i 1-10 > input || framework_failure_ diff --git a/tests/misc/read-errors.sh b/tests/misc/read-errors.sh index a691cd168a..796573a170 100755 --- a/tests/misc/read-errors.sh +++ b/tests/misc/read-errors.sh @@ -17,6 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src +uses_strace_ ! cat . >/dev/null 2>&1 || skip_ "Need unreadable directories"