]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: cksum: use more general strace syscall injection
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 12 Jan 2026 15:11:22 +0000 (15:11 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 12 Jan 2026 15:13:57 +0000 (15:13 +0000)
* tests/cksum/cksum-c.sh: Match "read" with a regex
to match any of the read syscall variants.

tests/cksum/cksum-c.sh

index 2e93ad6e1f4d7bd5b5b87c813107295e3974502c..b2b6c47598e0b40b87b621390efe04cc68ecf90d 100755 (executable)
@@ -202,18 +202,18 @@ 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 fault=read:error=EIO true; then
+if strace -o /dev/null -P path -e /read -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 fault=read:error=EIO \
+  returns_ 1 strace -o /dev/null -P eio -e /read -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 fault=read:error=EIO cat eio 2> exp.t
+  strace -o /dev/null -P eio -e /read -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