Whamcloud - gitweb
tests: clean up $DEBUGFS_EXE usage in scripts
[tools/e2fsprogs.git] / tests / j_long_revoke_trans_mcsum_64bit / script
1 if ! test -x $DEBUGFS_EXE; then
2         echo "$test_name: $test_description: skipped (no debugfs)"
3         return 0
4 fi
5
6 FSCK_OPT=-fy
7 OUT=$test_name.log
8 if [ -f $test_dir/expect.gz ]; then
9         EXP=$test_name.tmp
10         gunzip < $test_dir/expect.gz > $EXP1
11 else
12         EXP=$test_dir/expect
13 fi
14
15 cp /dev/null $OUT
16
17 $MKE2FS -F -o Linux -b 1024 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE 524288 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT 2>&1
18
19 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
20 status=$?
21 echo Exit status is $status >> $OUT.new
22 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
23 rm -f $OUT.new
24
25 $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT
26
27 echo "debugfs write journal" >> $OUT
28 echo "jo -c" > $TMPFILE.cmd
29 echo "jw -b 262-4358 /dev/zero" >> $TMPFILE.cmd
30 echo "jc" >> $TMPFILE.cmd
31 echo "jo" >> $TMPFILE.cmd
32 echo "jw -r 262-4358" >> $TMPFILE.cmd
33 echo "jc" >> $TMPFILE.cmd
34 #$DEBUGFS -w $TMPFILE -f $TMPFILE.cmd >> $OUT 2>&1
35 $DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null
36 sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT
37 rm -rf $OUT.new
38
39 $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT
40
41 test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img"
42 echo "logdump -c" > $TMPFILE.cmd
43 $DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
44 rm -rf $TMPFILE.cmd
45
46 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
47 status=$?
48 echo Exit status is $status >> $OUT.new
49 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
50 rm -f $OUT.new
51
52 rm -f $TMPFILE
53
54 cmp -s $OUT $EXP
55 status=$?
56
57 if [ "$status" = 0 ] ; then
58         echo "$test_name: $test_description: ok"
59         touch $test_name.ok
60 else
61         echo "$test_name: $test_description: failed"
62         diff $DIFF_OPTS $EXP $OUT > $test_name.failed
63         rm -f $test_name.tmp
64 fi
65
66 unset IMAGE FSCK_OPT OUT EXP