tests: add regression tests for EA blocks with bad checksums

Add regression tests for e2fsck dealing with (a) EA block with a bad
checksum; (b) EA block with a bad magic number; and (c) EA block with
damage that isn't otherwise noticeable.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
diff --git a/tests/f_ea_bad_csum/expect.1 b/tests/f_ea_bad_csum/expect.1
new file mode 100644
index 0000000..4fc365f
--- /dev/null
+++ b/tests/f_ea_bad_csum/expect.1
@@ -0,0 +1,29 @@
+Pass 1: Checking inodes, blocks, and sizes
+Inode 12 has a bad extended attribute block 1074.  Clear? yes
+
+Inode 12, i_blocks is 2, should be 0.  Fix? yes
+
+Extended attribute in inode 13 has a hash (1631637196) which is invalid
+Clear? yes
+
+Inode 13, i_blocks is 2, should be 0.  Fix? yes
+
+Inode 14 extended attribute block 1076 passes checks, but checksum does not match block.  Fix? yes
+
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+Block bitmap differences:  -(1074--1075)
+Fix? yes
+
+Free blocks count wrong for group #0 (971, counted=973).
+Fix? yes
+
+Free blocks count wrong (971, counted=973).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 14/128 files (7.1% non-contiguous), 1075/2048 blocks
+Exit status is 1
diff --git a/tests/f_ea_bad_csum/expect.2 b/tests/f_ea_bad_csum/expect.2
new file mode 100644
index 0000000..d83fdfb
--- /dev/null
+++ b/tests/f_ea_bad_csum/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/128 files (7.1% non-contiguous), 1075/2048 blocks
+Exit status is 0
diff --git a/tests/f_ea_bad_csum/image.gz b/tests/f_ea_bad_csum/image.gz
new file mode 100644
index 0000000..e7a25c5
--- /dev/null
+++ b/tests/f_ea_bad_csum/image.gz
Binary files differ
diff --git a/tests/f_ea_bad_csum/name b/tests/f_ea_bad_csum/name
new file mode 100644
index 0000000..958b244
--- /dev/null
+++ b/tests/f_ea_bad_csum/name
@@ -0,0 +1 @@
+EA block with bad checksum (metadata_csum)