]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: dd: check that erroneous seeks are not done in output
authoroech3 <79379754+oech3@users.noreply.github.com>
Tue, 31 Mar 2026 06:57:58 +0000 (15:57 +0900)
committerPádraig Brady <P@draigBrady.com>
Tue, 31 Mar 2026 11:09:26 +0000 (12:09 +0100)
* tests/dd/misc.sh: Add test case for of=/dev/tty.
The same occurs for /dev/stdout, but that varies
in the test hardness so is best avoided.
https://github.com/coreutils/coreutils/pull/234

tests/dd/misc.sh

index ad13d22086f0e951d040f2d0191beb72fce474c1..e6559bf16865eabdee754b171d645a2e8077ae39 100755 (executable)
@@ -124,4 +124,10 @@ dd if=$tmp_in of=$tmp_out count=00x$big status=noxfer 2>err || fail=1
 compare /dev/null $tmp_out || fail=1
 compare err_ok err || fail=1
 
+# Ensure of=/dev/tty is possible
+if test -c /dev/tty && test -w /dev/tty; then
+  dd if=/dev/null of=/dev/tty || fail=1
+fi
+
+
 Exit $fail