Whamcloud - gitweb
tests, mke2fs: add option to suppress xattr copying to fix f_extent_htree
[tools/e2fsprogs.git] / tests / j_corrupt_ext_jnl_sb_csum / script
1 FSCK_OPT=-fy
2 OUT=$test_name.log
3 if [ -f $test_dir/expect.gz ]; then
4         EXP=$test_name.tmp
5         gunzip < $test_dir/expect.gz > $EXP1
6 else
7         EXP=$test_dir/expect
8 fi
9
10 bzip2 -dc < $test_dir/image.tar.bz2 | tar xf -
11 test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp $test_name.img "$JOURNAL_DUMP_DIR/$test_name.img"
12 test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp $test_name.img.jnl "$JOURNAL_DUMP_DIR/$test_name.img.jnl"
13
14 $FSCK $FSCK_OPT -N test_filesys -j $test_name.img.jnl $test_name.img > $OUT.new 2>&1
15 status=$?
16 echo Exit status is $status >> $OUT.new
17
18 $FSCK $FSCK_OPT -N test_filesys -j $test_name.img.jnl $test_name.img >> $OUT.new 2>&1
19 status=$?
20 echo Exit status is $status >> $OUT.new
21 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT
22 rm -f $TMPFILE $test_name.img $test_name.img.jnl $OUT.new
23
24 cmp -s $OUT $EXP
25 status=$?
26
27 if [ "$status" = 0 ] ; then
28         echo "$test_name: $test_description: ok"
29         touch $test_name.ok
30 else
31         echo "$test_name: $test_description: failed"
32         diff $DIFF_OPTS $EXP $OUT > $test_name.failed
33         rm -f $test_name.tmp
34 fi
35
36 unset IMAGE FSCK_OPT OUT EXP