Whamcloud - gitweb
debian: build with V=1 for more information in buildd logs
[tools/e2fsprogs.git] / tests / f_resize_inode / script
1 if test -x $DEBUGFS_EXE; then
2
3 printf "e2fsck with resize_inode: "
4 FSCK_OPT=-yf
5 OUT=$test_name.log
6 if [ -f $test_dir/expect.gz ]; then
7         EXP=tmp_expect
8         gunzip < $test_dir/expect.gz > $EXP1
9 else
10         EXP=$test_dir/expect
11 fi
12
13 cp /dev/null $OUT
14
15 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
16
17 echo mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT
18 $MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 2>&1 \
19         | sed -e '1d' | grep -v "automatically checked" | 
20         grep -v 'Discarding device blocks' |
21         grep -v "whichever comes first" >> $OUT 
22
23 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
24 status=$?
25 echo Exit status is $status >> $OUT.new
26 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
27 rm -f $OUT.new
28
29 echo ----------------------------------------------- >> $OUT
30
31 echo " " >> $OUT
32 echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img" > $OUT.new
33 $DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1
34 status=$?
35 echo Exit status is $status >> $OUT.new
36 sed -e '2d' $OUT.new >> $OUT
37
38 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
39 status=$?
40 echo Exit status is $status >> $OUT.new
41 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
42 rm -f $OUT.new
43
44 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
45 status=$?
46 echo Exit status is $status >> $OUT.new
47 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
48 rm -f $OUT.new
49
50 echo ----------------------------------------------- >> $OUT
51
52 echo " " >> $OUT
53 echo "debugfs -R ''clri <7>'' -w test.img" > $OUT.new
54 $DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1
55 status=$?
56 echo Exit status is $status >> $OUT.new
57 sed -e '2d' $OUT.new >> $OUT
58
59 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
60 status=$?
61 echo Exit status is $status >> $OUT.new
62 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
63 rm -f $OUT.new
64
65 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
66 status=$?
67 echo Exit status is $status >> $OUT.new
68 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
69 rm -f $OUT.new
70
71 echo ----------------------------------------------- >> $OUT
72
73 echo " " >> $OUT
74 echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img" > $OUT.new
75 $DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1
76 status=$?
77 echo Exit status is $status >> $OUT.new
78 sed -e '2d' $OUT.new >> $OUT
79
80 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
81 status=$?
82 echo Exit status is $status >> $OUT.new
83 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
84 rm -f $OUT.new
85
86 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
87 status=$?
88 echo Exit status is $status >> $OUT.new
89 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
90 rm -f $OUT.new
91
92 echo ----------------------------------------------- >> $OUT
93
94 echo " " >> $OUT
95 echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img" > $OUT.new
96 $DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1
97 status=$?
98 echo Exit status is $status >> $OUT.new
99 sed -e '2d' $OUT.new >> $OUT
100
101 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
102 status=$?
103 echo Exit status is $status >> $OUT.new
104 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
105 rm -f $OUT.new
106
107 echo ----------------------------------------------- >> $OUT
108
109 echo " " >> $OUT
110 echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img" > $OUT.new
111 $DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1
112 status=$?
113 echo Exit status is $status >> $OUT.new
114 sed -e '2d' $OUT.new >> $OUT
115
116 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
117 status=$?
118 echo Exit status is $status >> $OUT.new
119 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
120 rm -f $OUT.new
121
122 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
123 status=$?
124 echo Exit status is $status >> $OUT.new
125 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $OUT
126 rm -f $OUT.new
127
128
129 rm -f $test_name.ok $test_name.failed
130 cmp -s $OUT $EXP
131 status=$?
132
133 if [ "$status" = 0 ] ; then
134         echo "ok"
135         touch $test_name.ok
136 else
137         echo "failed"
138         diff $DIFF_OPTS $EXP $OUT > $test_name.failed
139         rm -f tmp_expect
140 fi
141
142 unset IMAGE FSCK_OPT OUT EXP
143
144 else #if test -x $DEBUGFS_EXE; then
145         rm -f $test_name.ok $test_name.failed
146         echo "skipped"
147 fi