• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then
2	echo "$test_name: $test_description: skipped (no debugfs/resize2fs)"
3	return 0
4fi
5
6FSCK_OPT=-yf
7OUT=$test_name.log
8if [ -f $test_dir/expect.gz ]; then
9	EXP=$test_name.tmp
10	gunzip < $test_dir/expect.gz > $EXP1
11else
12	EXP=$test_dir/expect
13fi
14
15dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
16
17echo mke2fs -q -F -o Linux -b 1024 -g 256 -O ^resize_inode test.img 1024 > $OUT.new
18$MKE2FS -q -F -o Linux -b 1024 -g 256 -O ^resize_inode $TMPFILE 1024 >> $OUT.new 2>&1
19
20echo dumpe2fs test.img >> $OUT.new
21$DUMPE2FS $TMPFILE >> $OUT.new 2>&1
22
23echo resize2fs -p test.img 10000 >> $OUT.new
24$RESIZE2FS -p $TMPFILE 10000 >> $OUT.new 2>&1
25
26$FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT.new 2>&1
27status=$?
28echo Exit status is $status >> $OUT.new
29
30$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
31$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
32$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
33$TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
34
35echo dumpe2fs test.img >> $OUT.new
36$DUMPE2FS $TMPFILE >> $OUT.new 2>&1
37
38echo "--------------------------------" >> $OUT.new
39
40echo resize2fs -p test.img 20000 >> $OUT.new
41$RESIZE2FS -p $TMPFILE 20000 >> $OUT.new 2>&1
42
43$FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT.new 2>&1
44status=$?
45echo Exit status is $status >> $OUT.new
46
47$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
48$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
49$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
50$TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
51
52echo dumpe2fs test.img >> $OUT.new
53$DUMPE2FS $TMPFILE >> $OUT.new 2>&1
54
55echo "--------------------------------" >> $OUT.new
56
57echo resize2fs -p test.img 30000 >> $OUT.new
58$RESIZE2FS -p $TMPFILE 30000 >> $OUT.new 2>&1
59
60$FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT.new 2>&1
61status=$?
62echo Exit status is $status >> $OUT.new
63
64$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
65$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
66$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
67$TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
68
69echo dumpe2fs test.img >> $OUT.new
70$DUMPE2FS $TMPFILE >> $OUT.new 2>&1
71
72echo "--------------------------------" >> $OUT.new
73
74echo resize2fs -p test.img 40000 >> $OUT.new
75$RESIZE2FS -p $TMPFILE 40000 >> $OUT.new 2>&1
76
77$FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT.new 2>&1
78status=$?
79echo Exit status is $status >> $OUT.new
80
81$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
82$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
83$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
84$TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
85
86echo dumpe2fs test.img >> $OUT.new
87$DUMPE2FS $TMPFILE >> $OUT.new 2>&1
88sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n  Inode bitmap/, Inode bitmap/g' < $OUT.new > $OUT
89rm -f $TMPFILE $OUT.new
90
91cmp -s $OUT $EXP
92status=$?
93
94if [ "$status" = 0 ] ; then
95	echo "$test_name: $test_description: ok"
96	touch $test_name.ok
97else
98	echo "$test_name: $test_description: failed"
99	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
100	rm -f $test_name.tmp
101fi
102
103unset IMAGE FSCK_OPT OUT EXP
104