From: Pádraig Brady Date: Mon, 13 Jul 2026 16:50:21 +0000 (+0100) Subject: tests: dd: ensure nocache flag does not fail with pipes X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2653c5c5e2d2ee34a5ca6c6e83c9368a27b9a807;p=thirdparty%2Fcoreutils.git tests: dd: ensure nocache flag does not fail with pipes * tests/dd/nocache.sh: Whether fadvise() is called (uutils) or avoided (GNU), ensure there is no failure when nocache is only the ancillary operation being requested. Link: https://github.com/coreutils/coreutils/pull/276 --- diff --git a/tests/dd/nocache.sh b/tests/dd/nocache.sh index 405a7d12ca..154326e3e7 100755 --- a/tests/dd/nocache.sh +++ b/tests/dd/nocache.sh @@ -25,6 +25,10 @@ dd iflag=nocache oflag=nocache if=/dev/null of=/dev/null || fail=1 # We should get an error for trying to process a pipe dd count=0 | returns_ 1 dd iflag=nocache count=0 || fail=1 +# We should not get an error unless count=0. I.e., no error unless +# dropping cache is the only operation being requested. +dd count=0 | dd iflag=nocache oflag=nocache || fail=1 + # O_DIRECT is orthogonal to drop cache so mutually exclusive returns_ 1 dd iflag=nocache,direct if=/dev/null || fail=1