]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: strace: consider splice a "read" syscall
authorPádraig Brady <P@draigBrady.com>
Sun, 18 Jan 2026 16:56:24 +0000 (16:56 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 18 Jan 2026 16:58:38 +0000 (16:58 +0000)
* tests/cksum/cksum-c.sh: Add 'splice' to the injection set.
* tests/misc/read-errors.sh: Likewise.
From https://github.com/coreutils/coreutils/pull/167

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

index cfb29f13784a13c8dd7f033f5f1a1996d276cd1a..49d6a84d3bb646e51574f4782eac6604a7d5ff5f 100755 (executable)
@@ -203,18 +203,19 @@ grep 'the --tag option is meaningless when verifying checksums' err || fail=1
 cksum -a md5 /dev/null | cksum --untagged --check || fail=1
 
 # Ensure I/O errors handled appropriately
-if strace -o /dev/null -P path -e /read -e fault=all:error=EIO true; then
+if strace -o /dev/null -P _ -e /read,splice -e fault=all:error=EIO true; then
   touch ok eio || framework_failure_
   cksum -a md5 eio ok > check.md5 || fail=1
   # Test one of the files being checked returns EIO
-  returns_ 1 strace -o /dev/null -P eio -e /read -e fault=all:error=EIO \
+  returns_ 1 strace -o /dev/null -P eio -e /read,splice -e fault=all:error=EIO \
    cksum --check check.md5 2>err >out || fail=1
 
   printf '%s\n' 'eio: FAILED open or read' 'ok: OK' >exp || framework_failure_
   compare exp out || fail=1
 
   # Generate the expected error using cat:
-  strace -o /dev/null -P eio -e /read -e fault=all:error=EIO cat eio 2> exp.t
+  strace -o /dev/null -P eio -e /read,splice -e fault=all:error=EIO \
+    cat eio 2> exp.t
   sed 's/cat/cksum/' < exp.t > exp && grep eio: exp && echo \
    'cksum: WARNING: 1 listed file could not be read' >>exp || framework_failure_
   compare exp err || fail=1
index 796573a1709999acfae132d322804fc8ffdac132..c05516505b1d406e151667aea7524b5405aed112 100755 (executable)
@@ -104,9 +104,9 @@ expected_failure_status_sort=2
 
 # Ensure read is called, otherwise it's a layering violation.
 # Also ensure a read error is diagnosed appropriately.
-if strace -o /dev/null -P /dev/null -e '/read' -e fault=all:error=EIO true; then
+if strace -o /dev/null -P _ -e '/read,splice' -e fault=all:error=EIO true; then
   # Get EIO error message independently from utils
-  strace -o /dev/null -P /dev/null -e '/read' -e fault=all:error=EIO \
+  strace -o /dev/null -P /dev/null -e '/read,splice' -e fault=all:error=EIO \
    $SHELL -c 'read < /dev/null' 2>&1 |
     sed -e 's/\[/: /' -e 's/\]//' -e 's/.*: //' > io.err
   strerror_eio="$(cat io.err)" && test -n "$strerror_eio" || framework_failure_
@@ -116,7 +116,7 @@ if strace -o /dev/null -P /dev/null -e '/read' -e fault=all:error=EIO true; then
     eval "expected=\$expected_failure_status_$cmd"
     test x$expected = x && expected=1
     returns_ $expected \
-     strace -f -o /dev/null -P . -e '/read' -e fault=all:error=EIO \
+     strace -f -o /dev/null -P . -e '/read,splice' -e fault=all:error=EIO \
      $SHELL -c "$reader" 2>err || fail=1
     grep -F "$strerror_eio" err >/dev/null || { cat err; fail=1; }
   done < built_readers