1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-26 02:30:35 +02:00
Files
coreutils/tests/shred/remove
T

44 lines
960 B
Bash
Raw Normal View History

1999-12-13 15:03:51 +00:00
#!/bin/sh
1999-12-15 10:15:36 +00:00
# Exercise a bug that was fixed in shred-4.0l
1999-12-13 15:03:51 +00:00
if test "$VERBOSE" = yes; then
set -x
shred --version
fi
tmp=t-shred.$$
1999-12-15 10:15:36 +00:00
# The length of the basename is what matters.
# In this case, shred would try to rename the file 256^10 times
# before terminating.
file=$tmp/0123456789
1999-12-13 15:03:51 +00:00
framework_failure=0
mkdir $tmp || framework_failure=1
touch $file || framework_failure=1
1999-12-13 15:03:51 +00:00
chmod u-w $tmp || framework_failure=1
if test $framework_failure = 1; then
echo 'failure in testing framework'
exit 1
fi
(echo foo >> $tmp/file) >/dev/null 2>&1 && {
echo '********************************************'
echo 'NOTICE: This test case cannot be run as root.'
echo '********************************************'
exit 77
}
1999-12-13 15:03:51 +00:00
fail=0
1999-12-15 10:15:36 +00:00
# This would take so long that it appears to infloop
# when using version from fileutils-4.0k.
# When the command completes, expect it to fail.
shred -u $file > /dev/null 2>&1 && fail=1
1999-12-13 15:03:51 +00:00
1999-12-13 22:37:15 +00:00
chmod u+w $tmp
1999-12-13 15:03:51 +00:00
rm -rf $tmp
exit $fail