]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid a test hang on AIX master
authorCollin Funk <collin.funk1@gmail.com>
Sat, 17 Jan 2026 22:26:26 +0000 (14:26 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Sat, 17 Jan 2026 22:26:26 +0000 (14:26 -0800)
* init.cfg (uses_strace_): New function.
(require_strace_): Use it.
tests/cksum/cksum-c.sh: Likewise.
tests/misc/read-errors.sh: Likewise.

init.cfg
tests/cksum/cksum-c.sh
tests/misc/read-errors.sh

index 82d70b77fbbf222ff9cbb4f106730e6195ba787c..f453279bfa7059973f17978c092e27b863512c37 100644 (file)
--- 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_
index b2b6c47598e0b40b87b621390efe04cc68ecf90d..cfb29f13784a13c8dd7f033f5f1a1996d276cd1a 100755 (executable)
@@ -18,6 +18,7 @@
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ cksum shuf
+uses_strace_
 
 shuf -i 1-10 > input || framework_failure_
 
index a691cd168ae719266767fdc33a03b9c97a9a8c8f..796573a1709999acfae132d322804fc8ffdac132 100755 (executable)
@@ -17,6 +17,7 @@
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+uses_strace_
 
 ! cat . >/dev/null 2>&1 || skip_ "Need unreadable directories"