1os=$(uname -s) 2if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then 3 # creates a 96GB filesystem 4 echo "$test_name: $test_description: skipped: skipped for $os" 5 return 0 6fi 7 8if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then 9 echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" 10 return 0 11fi 12 13FSCK_OPT=-yf 14OUT=$test_name.log 15if [ -f $test_dir/expect.gz ]; then 16 EXP=$test_name.tmp 17 gunzip < $test_dir/expect.gz > $EXP1 18else 19 EXP=$test_dir/expect 20fi 21 22dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 23 24echo mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 1024000 > $OUT 25$MKE2FS -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 \ 26 $TMPFILE 1024000 >> $OUT 2>&1 27 28echo resize2fs -p test.img 100000000 >> $OUT 29$RESIZE2FS -p $TMPFILE 100000000 >> $OUT 2>&1 30 31$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 32status=$? 33echo Exit status is $status >> $OUT 34 35$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 36$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 37$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 38$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 39 40echo dumpe2fs -h test.img >> $OUT 41$DUMPE2FS -h $TMPFILE >> $OUT 2>&1 42sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n Inode bitmap/, Inode bitmap/g' < $OUT > $OUT.new 43mv $OUT.new $OUT 44rm -f $TMPFILE 45 46cmp -s $OUT $EXP 47status=$? 48 49if [ "$status" = 0 ] ; then 50 echo "$test_name: $test_description: ok" 51 touch $test_name.ok 52else 53 echo "$test_name: $test_description: failed" 54 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 55 rm -f $test_name.tmp 56fi 57 58unset IMAGE FSCK_OPT OUT EXP 59