diff options
Diffstat (limited to 'tests/f_opt_extent')
-rw-r--r-- | tests/f_opt_extent/expect | 55 | ||||
-rw-r--r-- | tests/f_opt_extent/name | 1 | ||||
-rw-r--r-- | tests/f_opt_extent/script | 64 |
3 files changed, 120 insertions, 0 deletions
diff --git a/tests/f_opt_extent/expect b/tests/f_opt_extent/expect new file mode 100644 index 0000000..9d2021e --- /dev/null +++ b/tests/f_opt_extent/expect @@ -0,0 +1,55 @@ +tune2fs metadata_csum test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +Exit status is 0 +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + + + +Change in FS metadata: +@@ -11,7 +11,7 @@ + Block count: 524288 + Reserved block count: 26214 + Overhead clusters: 35246 +-Free blocks: 570 ++Free blocks: 567 + Free inodes: 65047 + First block: 1 + Block size: 1024 +@@ -50,8 +50,8 @@ + Block bitmap at 262 (+261) + Inode bitmap at 278 (+277) + Inode table at 294-549 (+293) +- 21 free blocks, 535 free inodes, 3 directories, 535 unused inodes +- Free blocks: 4414-4434 ++ 18 free blocks, 535 free inodes, 3 directories, 535 unused inodes ++ Free blocks: 4417-4434 + Free inodes: 490-1024 + Group 1: (Blocks 8193-16384) [INODE_UNINIT] + Backup superblock at 8193, Group descriptors at 8194-8197 +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +Exit status is 0 diff --git a/tests/f_opt_extent/name b/tests/f_opt_extent/name new file mode 100644 index 0000000..7d4389c --- /dev/null +++ b/tests/f_opt_extent/name @@ -0,0 +1 @@ +optimize extent tree diff --git a/tests/f_opt_extent/script b/tests/f_opt_extent/script new file mode 100644 index 0000000..001c727 --- /dev/null +++ b/tests/f_opt_extent/script @@ -0,0 +1,64 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit,metadata_csum + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = /xyz + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check +$FSCK -fyD -N test_filesys $TMPFILE >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF |