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/j_ext_long_trans | |
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/j_ext_long_trans')
-rw-r--r-- | tests/j_ext_long_trans/expect | 106 | ||||
-rw-r--r-- | tests/j_ext_long_trans/name | 1 | ||||
-rw-r--r-- | tests/j_ext_long_trans/script | 62 |
3 files changed, 169 insertions, 0 deletions
diff --git a/tests/j_ext_long_trans/expect b/tests/j_ext_long_trans/expect new file mode 100644 index 0000000..ea3c87f --- /dev/null +++ b/tests/j_ext_long_trans/expect @@ -0,0 +1,106 @@ +Creating filesystem with 262144 1k blocks and 0 inodes +Superblock backups stored on blocks: + +Zeroing journal device: +Creating filesystem with 262144 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +debugfs add journal device/UUID +debugfs: feature has_journal +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize +debugfs: ssv journal_dev 0x9999 +debugfs: ssv journal_uuid 1db3f677-6832-4adb-bafc-8e4059c30a34 +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/16384 files (0.0% non-contiguous), 6239/262144 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Ext2 superblock header found. +Journal starts at block 3, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 3 +Found expected sequence 1, type 1 (descriptor block) at block 128 +Found expected sequence 1, type 1 (descriptor block) at block 253 +Found expected sequence 1, type 1 (descriptor block) at block 378 +Found expected sequence 1, type 1 (descriptor block) at block 503 +Found expected sequence 1, type 1 (descriptor block) at block 628 +Found expected sequence 1, type 1 (descriptor block) at block 753 +Found expected sequence 1, type 1 (descriptor block) at block 878 +Found expected sequence 1, type 1 (descriptor block) at block 1003 +Found expected sequence 1, type 1 (descriptor block) at block 1128 +Found expected sequence 1, type 1 (descriptor block) at block 1253 +Found expected sequence 1, type 1 (descriptor block) at block 1378 +Found expected sequence 1, type 1 (descriptor block) at block 1503 +Found expected sequence 1, type 1 (descriptor block) at block 1628 +Found expected sequence 1, type 1 (descriptor block) at block 1753 +Found expected sequence 1, type 1 (descriptor block) at block 1878 +Found expected sequence 1, type 1 (descriptor block) at block 2003 +Found expected sequence 1, type 1 (descriptor block) at block 2128 +Found expected sequence 1, type 1 (descriptor block) at block 2253 +Found expected sequence 1, type 1 (descriptor block) at block 2378 +Found expected sequence 1, type 1 (descriptor block) at block 2503 +Found expected sequence 1, type 1 (descriptor block) at block 2628 +Found expected sequence 1, type 1 (descriptor block) at block 2753 +Found expected sequence 1, type 1 (descriptor block) at block 2878 +Found expected sequence 1, type 1 (descriptor block) at block 3003 +Found expected sequence 1, type 1 (descriptor block) at block 3128 +Found expected sequence 1, type 1 (descriptor block) at block 3253 +Found expected sequence 1, type 1 (descriptor block) at block 3378 +Found expected sequence 1, type 1 (descriptor block) at block 3503 +Found expected sequence 1, type 1 (descriptor block) at block 3628 +Found expected sequence 1, type 1 (descriptor block) at block 3753 +Found expected sequence 1, type 1 (descriptor block) at block 3878 +Found expected sequence 1, type 1 (descriptor block) at block 4003 +Found expected sequence 1, type 1 (descriptor block) at block 4128 +Found expected sequence 1, type 2 (commit block) at block 4135 +No magic number at block 4136: end of journal. +debugfs fsck +test_filesys: recovering journal +Resize inode not valid. Recreate? yes + +Pass 1: Checking inodes, blocks, and sizes +Root inode is not a directory. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Root inode not allocated. Allocate? yes + +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +(1--259) +275 +(291--418) +2341 +Fix? yes + +Free blocks count wrong for group #0 (5838, counted=5851). +Fix? yes + +Free blocks count wrong (255903, counted=255916). +Fix? yes + +Inode bitmap differences: +1 +(3--10) +Fix? yes + +Free inodes count wrong for group #0 (500, counted=501). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (16372, counted=16373). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 6228/262144 blocks +Exit status is 1 diff --git a/tests/j_ext_long_trans/name b/tests/j_ext_long_trans/name new file mode 100644 index 0000000..8ae5722 --- /dev/null +++ b/tests/j_ext_long_trans/name @@ -0,0 +1 @@ +transaction nuking free space w/ ext. journal diff --git a/tests/j_ext_long_trans/script b/tests/j_ext_long_trans/script new file mode 100644 index 0000000..f19fb89 --- /dev/null +++ b/tests/j_ext_long_trans/script @@ -0,0 +1,62 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +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 + +JNLFILE=$TMPFILE.jnl + +touch $JNLFILE +$MKE2FS -F -o Linux -b 1024 -O journal_dev -T ext4 -U 1db3f677-6832-4adb-bafc-8e4059c30a34 $JNLFILE 262144 > $OUT.new 2>&1 +$MKE2FS -F -o Linux -b 1024 -O ^has_journal -T ext4 $TMPFILE 262144 >> $OUT.new 2>&1 + +echo "debugfs add journal device/UUID" >> $OUT.new +$DEBUGFS -w -f - $TMPFILE <<- EOF >> $OUT.new 2>&1 + feature has_journal + ssv journal_dev 0x9999 + ssv journal_uuid 1db3f677-6832-4adb-bafc-8e4059c30a34 +EOF + +$FSCK -fy -N test_filesys -j $JNLFILE $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -f $JNLFILE" > $TMPFILE.cmd +echo "jw -b 259-4356 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$JNLFILE" "$JOURNAL_DUMP_DIR/$test_name.img.jnl" +echo "logdump -c -f $JNLFILE" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +echo "debugfs fsck" >> $OUT.new +$FSCK -fy -N test_filesys -j $JNLFILE $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e 's/logdump -c -f.*/logdump -c/g' $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $JNLFILE $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 $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP JNLFILE |