]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: dd: ensure nocache flag does not fail with pipes
authorPádraig Brady <P@draigBrady.com>
Mon, 13 Jul 2026 16:50:21 +0000 (17:50 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 13 Jul 2026 16:55:26 +0000 (17:55 +0100)
* 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
tests/dd/nocache.sh

index 405a7d12caebfc8da6a52097c1c3409895cf9a56..154326e3e71c9f1106b503da699e6c13e2de1554 100755 (executable)
@@ -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