]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: dd: avoid a false test failure on Solaris 11.4
authorCollin Funk <collin.funk1@gmail.com>
Tue, 20 Jan 2026 02:26:45 +0000 (18:26 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Tue, 20 Jan 2026 02:26:45 +0000 (18:26 -0800)
* tests/dd/fail-ftruncate-fstat.sh: Replace the message used by Solaris
11.4 for strerror (EPERM) with the one we expect.

tests/dd/fail-ftruncate-fstat.sh

index 381d329ae0c2c14521a137dd5bd200671d8c0a78..1d4edb36e244797a05703f969a1caf32736d190b 100755 (executable)
@@ -58,12 +58,15 @@ yes | head -n 2048 | tr -d '\n' > out || framework_failure_
 cp out exp-out || framework_failure_
 
 LD_PRELOAD=$LD_PRELOAD:./k.so dd if=/dev/zero of=out count=1 \
-                              seek=1 status=none 2>err
+                              seek=1 status=none 2>errt
 ret=$?
 
 test -f x && test -f y \
   || skip_ "internal test failure: maybe LD_PRELOAD doesn't work?"
 
+# Solaris 11.4 gives a different, but reasonable, error message here.
+sed 's/Insufficient privileges/Operation not permitted/g' < errt > err
+
 # After ftruncate fails, we use fstat to get the file type.
 echo "dd: cannot fstat 'out': Operation not permitted" > exp
 compare exp err || fail=1