tests: test recovery of 32 and 64-bit journals with the v2 checksum

Add tests to ensure that we know how to recover journals with the
csum_v2 feature set.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
crypto
Darrick J. Wong 2014-09-08 16:13:28 -07:00 committed by Theodore Ts'o
parent 490e1f5201
commit 821fc8ca32
10 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,16 @@
test_filesys: recovering journal
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: +(1--259) +265 +(274--275) +281 +(290--418) +(1059--1186) +(2211--2352)
Fix? yes
Inode bitmap differences: +(1--11)
Fix? yes
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks
Exit status is 0

View File

@ -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: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks
Exit status is 0

Binary file not shown.

View File

@ -0,0 +1 @@
recover 32-bit journal checksum v2

View File

@ -0,0 +1,31 @@
#!/bin/bash
FSCK_OPT=-fy
IMAGE=$test_dir/image.bz2
bzip2 -d < $IMAGE > $TMPFILE
# Run fsck to fix things?
EXP1=$test_dir/expect.1
OUT1=$test_name.1.log
rm -rf $test_name.failed $test_name.ok
$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1
echo "Exit status is $?" >> $OUT1
# Run a second time
EXP2=$test_dir/expect.2
OUT2=$test_name.2.log
$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2
echo "Exit status is $?" >> $OUT2
# Figure out what happened
if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then
echo "$test_name: $test_description: ok"
touch $test_name.ok
else
echo "$test_name: $test_description: failed"
diff -u $EXP1 $OUT1 >> $test_name.failed
diff -u $EXP2 $OUT2 >> $test_name.failed
fi

View File

@ -0,0 +1,16 @@
test_filesys: recovering journal
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: +(1--259) +265 +(274--275) +281 +(290--418) +(1059--1186) +(2211--2352)
Fix? yes
Inode bitmap differences: +(1--11)
Fix? yes
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks
Exit status is 0

View File

@ -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: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks
Exit status is 0

Binary file not shown.

View File

@ -0,0 +1 @@
recover 64-bit journal checksum v2

View File

@ -0,0 +1,31 @@
#!/bin/bash
FSCK_OPT=-fy
IMAGE=$test_dir/image.bz2
bzip2 -d < $IMAGE > $TMPFILE
# Run fsck to fix things?
EXP1=$test_dir/expect.1
OUT1=$test_name.1.log
rm -rf $test_name.failed $test_name.ok
$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1
echo "Exit status is $?" >> $OUT1
# Run a second time
EXP2=$test_dir/expect.2
OUT2=$test_name.2.log
$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2
echo "Exit status is $?" >> $OUT2
# Figure out what happened
if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then
echo "$test_name: $test_description: ok"
touch $test_name.ok
else
echo "$test_name: $test_description: failed"
diff -u $EXP1 $OUT1 >> $test_name.failed
diff -u $EXP2 $OUT2 >> $test_name.failed
fi