summaryrefslogtreecommitdiffstats
path: root/tests/f_del_dup_quota/script
diff options
context:
space:
mode:
Diffstat (limited to 'tests/f_del_dup_quota/script')
-rw-r--r--tests/f_del_dup_quota/script34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/f_del_dup_quota/script b/tests/f_del_dup_quota/script
new file mode 100644
index 0000000..5480c3f
--- /dev/null
+++ b/tests/f_del_dup_quota/script
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+IMAGE=$test_dir/image.bz2
+
+bzip2 -d < $IMAGE > $TMPFILE
+
+# Run fsck to fix the multiply-claimed block breakage
+FSCK_OPT=-f
+EXP1=$test_dir/expect.1
+OUT1=$test_name.1.log
+
+echo "nyyyyyyy" | E2FSCK_FORCE_INTERACTIVE=y $FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1
+echo "Exit status is $?" >> $OUT1
+
+# Run a second time to verify that fsck completely repaired everything in
+# the first run, including quota corrections
+FSCK_OPT=-fn
+EXP2=$test_dir/expect.2
+OUT2=$test_name.2.log
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2
+echo "Exit status is $?" >> $OUT2
+
+# Figure out what happened
+rm -f $test_name.failed $test_name.ok
+if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff -u $EXP1 $OUT1 >> $test_name.failed
+ diff -u $EXP2 $OUT2 >> $test_name.failed
+fi
+unset EXP1 OUT1 EXP2 OUT2 FSCK_OPT IMAGE