summaryrefslogtreecommitdiff
path: root/tests/misc/shred-exact.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/shred-exact.sh')
-rwxr-xr-xtests/misc/shred-exact.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/misc/shred-exact.sh b/tests/misc/shred-exact.sh
index 0cdc91fc0..eb30a7d69 100755
--- a/tests/misc/shred-exact.sh
+++ b/tests/misc/shred-exact.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# make sure that neither --exact nor --zero gobbles a command line argument
+# Test functionality of --exact
# Copyright (C) 2000-2013 Free Software Foundation, Inc.
@@ -20,6 +20,7 @@
print_ver_ shred
+# make sure that neither --exact nor --zero gobbles a command line argument
for opt in --exact --zero; do
echo a > a || fail=1
echo bb > b || fail=1
@@ -33,4 +34,12 @@ for opt in --exact --zero; do
test -f c && fail=1
done
+
+# make sure direct I/O is handled appropriately at end of file
+# Create a 1MiB file as we'll probably not be using blocks larger than that
+# (i.e. we want to test failed writes not at the start).
+truncate -s1MiB file.slop || framework_failure_
+truncate -s+1 file.slop || framework_failure_
+shred --exact -n1 file.slop || fail=1
+
Exit $fail