aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2017-07-04 17:51:48 -0400
committerTheodore Ts'o <tytso@mit.edu>2017-07-04 17:51:48 -0400
commitb3d7751cd1bf429cb3b0060f12ac13e9827b9e88 (patch)
treefd7b84e412be6aab6df572dfda67ac3adc043116 /tests
parente8c858047be6647ff1bdd31ead721b6fbd9d3e5b (diff)
downloade2fsprogs-b3d7751cd1bf429cb3b0060f12ac13e9827b9e88.tar.gz
tests: add j_recover_csum3_64bit
Add a test to make sure we are correctly recovering 64-bit journals using the v3 checksum format. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'tests')
-rw-r--r--tests/j_recover_csum3_64bit/expect.116
-rw-r--r--tests/j_recover_csum3_64bit/expect.27
-rw-r--r--tests/j_recover_csum3_64bit/image.bz2bin0 -> 4150 bytes
-rw-r--r--tests/j_recover_csum3_64bit/name1
-rwxr-xr-xtests/j_recover_csum3_64bit/script31
5 files changed, 55 insertions, 0 deletions
diff --git a/tests/j_recover_csum3_64bit/expect.1 b/tests/j_recover_csum3_64bit/expect.1
new file mode 100644
index 000000000..6aed56a8f
--- /dev/null
+++ b/tests/j_recover_csum3_64bit/expect.1
@@ -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
+Free blocks count wrong (121285, counted=121282).
+Fix? yes
+
+Free inodes count wrong (32757, counted=32754).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 14/32768 files (0.0% non-contiguous), 9790/131072 blocks
+Exit status is 0
diff --git a/tests/j_recover_csum3_64bit/expect.2 b/tests/j_recover_csum3_64bit/expect.2
new file mode 100644
index 000000000..b7a14dad3
--- /dev/null
+++ b/tests/j_recover_csum3_64bit/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: 14/32768 files (0.0% non-contiguous), 9790/131072 blocks
+Exit status is 0
diff --git a/tests/j_recover_csum3_64bit/image.bz2 b/tests/j_recover_csum3_64bit/image.bz2
new file mode 100644
index 000000000..13b29562e
--- /dev/null
+++ b/tests/j_recover_csum3_64bit/image.bz2
Binary files differ
diff --git a/tests/j_recover_csum3_64bit/name b/tests/j_recover_csum3_64bit/name
new file mode 100644
index 000000000..8f91d97bd
--- /dev/null
+++ b/tests/j_recover_csum3_64bit/name
@@ -0,0 +1 @@
+recover 64-bit journal checksum v3
diff --git a/tests/j_recover_csum3_64bit/script b/tests/j_recover_csum3_64bit/script
new file mode 100755
index 000000000..4b0ec48e5
--- /dev/null
+++ b/tests/j_recover_csum3_64bit/script
@@ -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