Whamcloud - gitweb
Delete the test.img file after running the resize2fs tests
[tools/e2fsprogs.git] / tests / r_move_itable / script
1 printf "resize2fs with resize_inode: "
2
3 if test -x $RESIZE2FS_EXE; then
4
5 FSCK_OPT=-yf
6 OUT=$test_name.log
7 if [ -f $test_dir/expect.gz ]; then
8         EXP=tmp_expect
9         gunzip < $test_dir/expect.gz > $EXP1
10 else
11         EXP=$test_dir/expect
12 fi
13
14 cp /dev/null $OUT
15
16 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
17
18 echo mke2fs -q -F -o Linux -b 1024 -g 256 test.img 1024 > $OUT
19 $MKE2FS -q -F -o Linux -b 1024 -g 256 $TMPFILE 1024 2>&1 \
20         | sed -e '1d' | grep -v "automatically checked" | 
21         grep -v "whichever comes first" >> $OUT 
22
23 echo resize2fs -p test.img 10000 >> $OUT
24 $RESIZE2FS -p $TMPFILE 10000 2>&1 | sed -e '1d' >> $OUT
25
26 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
27 status=$?
28 echo Exit status is $status >> $OUT.new
29 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
30 rm -f $OUT.new
31
32 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
33 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
34 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
35 $TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
36
37 echo dumpe2fs test.img >> $OUT
38 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
39
40 echo "--------------------------------" >> $OUT
41
42 echo resize2fs -p test.img 20000 >> $OUT
43 $RESIZE2FS -p $TMPFILE 20000 2>&1 | sed -e '1d' >> $OUT
44
45 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
46 status=$?
47 echo Exit status is $status >> $OUT.new
48 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
49 rm -f $OUT.new
50
51 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
52 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
53 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
54 $TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
55
56 echo dumpe2fs test.img >> $OUT
57 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
58
59 echo "--------------------------------" >> $OUT
60
61 echo resize2fs -p test.img 30000 >> $OUT
62 $RESIZE2FS -p $TMPFILE 30000 2>&1 | sed -e '1d' >> $OUT
63
64 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
65 status=$?
66 echo Exit status is $status >> $OUT.new
67 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
68 rm -f $OUT.new
69
70 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
71 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
72 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
73 $TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
74
75 echo dumpe2fs test.img >> $OUT
76 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
77
78 echo "--------------------------------" >> $OUT
79
80 echo resize2fs -p test.img 40000 >> $OUT
81 $RESIZE2FS -p $TMPFILE 40000 2>&1 | sed -e '1d' >> $OUT
82
83 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
84 status=$?
85 echo Exit status is $status >> $OUT.new
86 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
87 rm -f $OUT.new
88
89 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
90 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
91 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
92 $TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
93
94 echo dumpe2fs test.img >> $OUT
95 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
96
97 rm -f $test_name.ok $test_name.failed $TMPFILE
98
99 cmp -s $OUT $EXP
100 status=$?
101
102 if [ "$status" = 0 ] ; then
103         echo "ok"
104         touch $test_name.ok
105 else
106         echo "failed"
107         diff $DIFF_OPTS $EXP $OUT > $test_name.failed
108         rm -f tmp_expect
109 fi
110
111 unset IMAGE FSCK_OPT OUT EXP
112
113 else #if test -x $RESIZE2FS; then
114         rm -f $test_name.ok $test_name.failed
115         echo "skipped"
116 fi