summaryrefslogtreecommitdiffstats
path: root/tests/f_resize_inode
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/f_resize_inode/expect159
-rw-r--r--tests/f_resize_inode/script115
-rw-r--r--tests/f_resize_inode_meta_bg/expect.170
-rw-r--r--tests/f_resize_inode_meta_bg/expect.27
-rw-r--r--tests/f_resize_inode_meta_bg/image.gzbin0 -> 21467 bytes
-rw-r--r--tests/f_resize_inode_meta_bg/name1
6 files changed, 352 insertions, 0 deletions
diff --git a/tests/f_resize_inode/expect b/tests/f_resize_inode/expect
new file mode 100644
index 0000000..c12c92c
--- /dev/null
+++ b/tests/f_resize_inode/expect
@@ -0,0 +1,159 @@
+mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384
+Creating filesystem with 16384 1k blocks and 4096 inodes
+Superblock backups stored on blocks:
+ 1025, 3073, 5121, 7169, 9217
+
+Allocating group tables: done
+Writing inode tables: 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
+test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks
+Exit status is 0
+-----------------------------------------------
+
+debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img
+Exit status is 0
+Resize inode not valid. Recreate? yes
+
+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
+Free blocks count wrong for group #0 (685, counted=686).
+Fix? yes
+
+Free blocks count wrong (13764, counted=13765).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks
+Exit status is 1
+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
+test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks
+Exit status is 0
+-----------------------------------------------
+
+debugfs -R ''clri <7>'' -w test.img
+Exit status is 0
+Resize inode not valid. Recreate? yes
+
+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
+Free blocks count wrong for group #0 (685, counted=686).
+Fix? yes
+
+Free blocks count wrong (13764, counted=13765).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks
+Exit status is 1
+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
+test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks
+Exit status is 0
+-----------------------------------------------
+
+debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img
+Exit status is 0
+Resize inode not valid. Recreate? yes
+
+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
+Free blocks count wrong for group #0 (685, counted=686).
+Fix? yes
+
+Free blocks count wrong (13764, counted=13765).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks
+Exit status is 1
+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
+test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks
+Exit status is 0
+-----------------------------------------------
+
+debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img
+Exit status is 0
+ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
+../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks...
+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
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks
+Exit status is 1
+-----------------------------------------------
+
+debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img
+Exit status is 0
+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
+Block bitmap differences: -(35--258) -(1059--1282) -(3107--3330) -(5155--5378) -(7203--7426) -(9251--9474)
+Fix? yes
+
+Free blocks count wrong for group #0 (686, counted=910).
+Fix? yes
+
+Free blocks count wrong for group #1 (700, counted=924).
+Fix? yes
+
+Free blocks count wrong for group #3 (700, counted=924).
+Fix? yes
+
+Free blocks count wrong for group #5 (700, counted=924).
+Fix? yes
+
+Free blocks count wrong for group #7 (700, counted=924).
+Fix? yes
+
+Free blocks count wrong for group #9 (700, counted=924).
+Fix? yes
+
+Free blocks count wrong (13765, counted=15109).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 11/4096 files (0.0% non-contiguous), 1275/16384 blocks
+Exit status is 1
+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
+test_filesys: 11/4096 files (0.0% non-contiguous), 1275/16384 blocks
+Exit status is 0
diff --git a/tests/f_resize_inode/script b/tests/f_resize_inode/script
new file mode 100644
index 0000000..58915a7
--- /dev/null
+++ b/tests/f_resize_inode/script
@@ -0,0 +1,115 @@
+test_description="e2fsck with resize_inode"
+if ! test -x $DEBUGFS_EXE; then
+ echo "$test_name: $test_description: skipped (no debugfs)"
+ return 0
+fi
+
+FSCK_OPT=-yf
+OUT=$test_name.log
+if [ -f $test_dir/expect.gz ]; then
+ EXP=$test_name.tmp
+ gunzip < $test_dir/expect.gz > $EXP1
+else
+ EXP=$test_dir/expect
+fi
+
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+
+echo mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT.new
+$MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 >> $OUT.new 2>&1
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+echo ----------------------------------------------- >> $OUT.new
+
+echo " " >> $OUT.new
+echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img" >> $OUT.new
+$DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+echo ----------------------------------------------- >> $OUT.new
+
+echo " " >> $OUT.new
+echo "debugfs -R ''clri <7>'' -w test.img" >> $OUT.new
+$DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+echo ----------------------------------------------- >> $OUT.new
+
+echo " " >> $OUT.new
+echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img" >> $OUT.new
+$DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+echo ----------------------------------------------- >> $OUT.new
+
+echo " " >> $OUT.new
+echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img" >> $OUT.new
+$DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+echo ----------------------------------------------- >> $OUT.new
+
+echo " " >> $OUT.new
+echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img" >> $OUT.new
+$DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+
+$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+sed -f $cmd_dir/filter.sed $OUT.new > $OUT
+rm -f $OUT.new
+
+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
+ rm -f tmp_expect
+fi
+
+unset IMAGE FSCK_OPT OUT EXP
diff --git a/tests/f_resize_inode_meta_bg/expect.1 b/tests/f_resize_inode_meta_bg/expect.1
new file mode 100644
index 0000000..e248083
--- /dev/null
+++ b/tests/f_resize_inode_meta_bg/expect.1
@@ -0,0 +1,70 @@
+Resize_inode and meta_bg features are enabled. Those features are
+not compatible. Resize inode should be disabled. Fix? yes
+
+Resize_inode not enabled, but the resize inode is non-zero. Clear? yes
+
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+First entry '' (inode=348) in directory inode 2 (???) should be '.'
+Fix? yes
+
+Missing '..' in directory inode 2.
+Fix? yes
+
+Directory inode 2, block #0, offset 860: directory corrupted
+Salvage? yes
+
+Entry '' in ??? (2) has rec_len of 0, should be 12.
+Fix? yes
+
+Directory inode 11, block #0, offset 0: directory corrupted
+Salvage? yes
+
+Missing '.' in directory inode 11.
+Fix? yes
+
+Missing '..' in directory inode 11.
+Fix? yes
+
+Directory inode 11, block #1, offset 0: directory corrupted
+Salvage? yes
+
+Directory inode 11, block #2, offset 0: directory corrupted
+Salvage? yes
+
+Entry '' in ??? (11) has a zero-length name.
+Clear? yes
+
+Directory inode 11, block #3, offset 864: directory corrupted
+Salvage? yes
+
+Entry '' in ??? (11) has rec_len of 0, should be 12.
+Fix? yes
+
+Pass 3: Checking directory connectivity
+'..' in / (2) is <The NULL inode> (0), should be / (2).
+Fix? yes
+
+Unconnected directory inode 11 (was in /)
+Connect to /lost+found? yes
+
+/lost+found not found. Create? yes
+
+Pass 3A: Optimizing directories
+Pass 4: Checking reference counts
+Inode 11 ref count is 3, should be 2. Fix? yes
+
+Pass 5: Checking group summary information
+Block bitmap differences: -246
+Fix? yes
+
+Free blocks count wrong for group #0 (160, counted=161).
+Fix? yes
+
+Free blocks count wrong (2714, counted=2715).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 12/960 files (0.0% non-contiguous), 1125/3840 blocks
+Exit status is 1
diff --git a/tests/f_resize_inode_meta_bg/expect.2 b/tests/f_resize_inode_meta_bg/expect.2
new file mode 100644
index 0000000..0df9a40
--- /dev/null
+++ b/tests/f_resize_inode_meta_bg/expect.2
@@ -0,0 +1,7 @@
+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
+test_filesys: 12/960 files (0.0% non-contiguous), 1125/3840 blocks
+Exit status is 0
diff --git a/tests/f_resize_inode_meta_bg/image.gz b/tests/f_resize_inode_meta_bg/image.gz
new file mode 100644
index 0000000..9966a7c
--- /dev/null
+++ b/tests/f_resize_inode_meta_bg/image.gz
Binary files differ
diff --git a/tests/f_resize_inode_meta_bg/name b/tests/f_resize_inode_meta_bg/name
new file mode 100644
index 0000000..9493654
--- /dev/null
+++ b/tests/f_resize_inode_meta_bg/name
@@ -0,0 +1 @@
+conflicting features resize_inode and meta_bg