diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 09:25:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 09:25:10 +0000 |
commit | 5dced3d1b3deca80e01415a2e35dc7972dcbfae7 (patch) | |
tree | 6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /tests/r_64to32bit_meta | |
parent | Initial commit. (diff) | |
download | e2fsprogs-5dced3d1b3deca80e01415a2e35dc7972dcbfae7.tar.xz e2fsprogs-5dced3d1b3deca80e01415a2e35dc7972dcbfae7.zip |
Adding upstream version 1.47.0.upstream/1.47.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/r_64to32bit_meta')
-rw-r--r-- | tests/r_64to32bit_meta/expect | 81 | ||||
-rw-r--r-- | tests/r_64to32bit_meta/name | 1 | ||||
-rw-r--r-- | tests/r_64to32bit_meta/script | 74 |
3 files changed, 156 insertions, 0 deletions
diff --git a/tests/r_64to32bit_meta/expect b/tests/r_64to32bit_meta/expect new file mode 100644 index 0000000..7065590 --- /dev/null +++ b/tests/r_64to32bit_meta/expect @@ -0,0 +1,81 @@ +resize2fs 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 479 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 +resize2fs test.img -s +Converting the filesystem to 32-bit. +The filesystem on test.img is now 524288 (1k) blocks long. + +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize ++Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -10,13 +10,11 @@ + Inode count: 65536 + Block count: 524288 + Reserved block count: 26214 +-Overhead clusters: 32918 +-Free blocks: 852 ++Free blocks: 858 + Free inodes: 65046 + First block: 1 + Block size: 1024 + Fragment size: 1024 +-Group descriptor size: 64 + Blocks per group: 8192 + Fragments per group: 8192 + Inodes per group: 1024 +@@ -58,9 +56,9 @@ + 12:98305:-1:-1:15:31:3107 + 13:106497:-1:-1:16:32:3363 + 14:114689:-1:-1:17:33:3619 +-15:122881:-1:122881:18:34:3875 +-16:131073:-1:131073:131074:131090:131106 +-17:139265:-1:139265:131075:131091:131362 ++15:122881:-1:-1:18:34:3875 ++16:131073:-1:-1:131074:131090:131106 ++17:139265:-1:-1:131075:131091:131362 + 18:147457:-1:-1:131076:131092:131618 + 19:155649:-1:-1:131077:131093:131874 + 20:163841:-1:-1:131078:131094:132130 +@@ -90,9 +88,9 @@ + 44:360449:-1:-1:262158:262174:265250 + 45:368641:-1:-1:262159:262175:265506 + 46:376833:-1:-1:262160:262176:265762 +-47:385025:-1:385025:262161:262177:266018 +-48:393217:-1:393217:393218:393234:393250 +-49:401409:401409:401410:393219:393235:393506 ++47:385025:-1:-1:262161:262177:266018 ++48:393217:-1:-1:393218:393234:393250 ++49:401409:401409:-1:393219:393235:393506 + 50:409601:-1:-1:393220:393236:393762 + 51:417793:-1:-1:393221:393237:394018 + 52:425985:-1:-1:393222:393238:394274 +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/r_64to32bit_meta/name b/tests/r_64to32bit_meta/name new file mode 100644 index 0000000..e99ed8b --- /dev/null +++ b/tests/r_64to32bit_meta/name @@ -0,0 +1 @@ +convert meta_bg 64bit fs to 32bit fs diff --git a/tests/r_64to32bit_meta/script b/tests/r_64to32bit_meta/script new file mode 100644 index 0000000..5ee9f02 --- /dev/null +++ b/tests/r_64to32bit_meta/script @@ -0,0 +1,74 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +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,meta_bg,^resize_inode,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | 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 + +# resize it +echo "resize2fs test.img -s" >> $OUT +$RESIZE2FS -s -f $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | 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 + +# +# 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 + +rm $OUT.before $OUT.after + +unset IMAGE FSCK_OPT OUT EXP CONF |