From: Pádraig Brady Date: Thu, 14 May 2026 13:25:41 +0000 (+0100) Subject: tests: shred: check shred explicit deallocation X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=32d1c41c88e8a35542f572700ea891ce9d6e830b;p=thirdparty%2Fcoreutils.git tests: shred: check shred explicit deallocation * tests/shred/shred-remove.sh: Ensure shred deallocates with read-only directories, or '-' used to represent standard output. --- diff --git a/tests/shred/shred-remove.sh b/tests/shred/shred-remove.sh index f5d7465624..6df2785617 100755 --- a/tests/shred/shred-remove.sh +++ b/tests/shred/shred-remove.sh @@ -63,8 +63,17 @@ shred: test: removed EOF compare exp out || fail=1 +# Ensure with stdout, file is deallocated but not removed +echo > $file || framework_failure_ +shred -u - > $file || fail=1 +test -e $file || fail=1 +returns_ 1 test -s $file || fail=1 + # Ensure renames are only retried for EEXIST -mkdir rodir && cd rodir && touch $file && chmod a-w . || framework_failure_ +mkdir rodir && cd rodir && echo > $file && chmod a-w . || framework_failure_ returns_ 1 timeout 10 shred -u $file || fail=1 +# Also ensure file is deallocated separately to unlink +returns_ 1 test -s $file || fail=1 + Exit $fail