summaryrefslogtreecommitdiffstats
path: root/tests/r_64to32bit
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/r_64to32bit/expect99
-rw-r--r--tests/r_64to32bit/name1
-rw-r--r--tests/r_64to32bit/script74
-rw-r--r--tests/r_64to32bit_meta/expect81
-rw-r--r--tests/r_64to32bit_meta/name1
-rw-r--r--tests/r_64to32bit_meta/script74
6 files changed, 330 insertions, 0 deletions
diff --git a/tests/r_64to32bit/expect b/tests/r_64to32bit/expect
new file mode 100644
index 0000000..eb609fb
--- /dev/null
+++ b/tests/r_64to32bit/expect
@@ -0,0 +1,99 @@
+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 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
+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 resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
++Filesystem features: has_journal ext_attr resize_inode dir_index filetype 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: 35246
+-Free blocks: 571
++Free blocks: 589
+ Free inodes: 65048
+ First block: 1
+ Block size: 1024
+ Fragment size: 1024
+-Group descriptor size: 64
+ Reserved GDT blocks: 256
+ Blocks per group: 8192
+ Fragments per group: 8192
+@@ -44,16 +42,16 @@
+
+
+ group:block:super:gdt:bbitmap:ibitmap:itable
+-0:1:1:2-5:262:278:294
+-1:8193:8193:8194-8197:263:279:550
++0:1:1:2-3:262:278:294
++1:8193:8193:8194-8195:263:279:550
+ 2:16385:-1:-1:264:280:806
+-3:24577:24577:24578-24581:265:281:1062
++3:24577:24577:24578-24579:265:281:1062
+ 4:32769:-1:-1:266:282:1318
+-5:40961:40961:40962-40965:267:283:1574
++5:40961:40961:40962-40963:267:283:1574
+ 6:49153:-1:-1:268:284:1830
+-7:57345:57345:57346-57349:269:285:2086
++7:57345:57345:57346-57347:269:285:2086
+ 8:65537:-1:-1:270:286:2342
+-9:73729:73729:73730-73733:271:287:2598
++9:73729:73729:73730-73731:271:287:2598
+ 10:81921:-1:-1:272:288:2854
+ 11:90113:-1:-1:273:289:3110
+ 12:98305:-1:-1:274:290:3366
+@@ -69,9 +67,9 @@
+ 22:180225:-1:-1:131079:131095:132641
+ 23:188417:-1:-1:131080:131096:132897
+ 24:196609:-1:-1:131081:131097:133153
+-25:204801:204801:204802-204805:131082:131098:133409
++25:204801:204801:204802-204803:131082:131098:133409
+ 26:212993:-1:-1:131083:131099:133665
+-27:221185:221185:221186-221189:131084:131100:133921
++27:221185:221185:221186-221187:131084:131100:133921
+ 28:229377:-1:-1:131085:131101:134177
+ 29:237569:-1:-1:131086:131102:134433
+ 30:245761:-1:-1:131087:131103:134689
+@@ -93,7 +91,7 @@
+ 46:376833:-1:-1:262159:262175:265761
+ 47:385025:-1:-1:262160:262176:266017
+ 48:393217:-1:-1:393217:393233:393249
+-49:401409:401409:401410-401413:393218:393234:393505
++49:401409:401409:401410-401411:393218:393234:393505
+ 50:409601:-1:-1:393219:393235:393761
+ 51:417793:-1:-1:393220:393236:394017
+ 52:425985:-1:-1:393221:393237:394273
+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/name b/tests/r_64to32bit/name
new file mode 100644
index 0000000..4c82371
--- /dev/null
+++ b/tests/r_64to32bit/name
@@ -0,0 +1 @@
+convert flex_bg 64bit fs to 32bit fs
diff --git a/tests/r_64to32bit/script b/tests/r_64to32bit/script
new file mode 100644
index 0000000..df2b545
--- /dev/null
+++ b/tests/r_64to32bit/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,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
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