Whamcloud - gitweb
tests: clean up $DEBUGFS_EXE usage in scripts
[tools/e2fsprogs.git] / tests / r_min_itable / script
1 if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then
2         echo "$test_name: $test_description: skipped (no debugfs/resize2fs)"
3         return 0
4 fi
5
6 IMAGE=$test_dir/image.gz
7 FSCK_OPT=-yf
8 OUT=$test_name.log
9 EXP=$test_dir/expect
10
11 gunzip < $IMAGE > $TMPFILE
12
13 echo "resize2fs test" > $OUT
14
15 echo "resize2fs -M test.img" >> $OUT
16 $RESIZE2FS -M $TMPFILE 2>&1 >> $OUT.new 2>&1
17 status=$?
18 echo Exit status is $status >> $OUT.new
19
20 echo " " >> $OUT.new
21 echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new
22 $FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
23 echo Exit status is $status >> $OUT.new
24
25 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
26 rm $TMPFILE $OUT.new
27
28 #
29 # Do the verification
30 #
31
32 cmp -s $OUT $EXP
33 status=$?
34
35 if [ "$status" = 0 ] ; then
36         echo "$test_name: $test_description: ok"
37         touch $test_name.ok
38 else
39         echo "$test_name: $test_description: failed"
40         diff $DIFF_OPTS $EXP $OUT > $test_name.failed
41 fi
42
43 unset IMAGE FSCK_OPT OUT EXP