[Ocfs2-test-devel] [PATCH 1/1] Add new cases for fsck-tests to test newly added checking code in fsck.ocfs2:Revised

tristan tristan.ye at oracle.com
Wed Aug 13 00:23:58 PDT 2008


After adding new corrupt codes in fswreck,add  testcases in fsck-tests
accordingly to test newly added checking codes in fsck.ocfs2.

Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---

Index: ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.45.stdout
===================================================================
--- ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.45.stdout
(revision 0)
+++ ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.45.stdout
(revision 0)
@@ -0,0 +1,25 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               8d a0 35 81 7e 98 4a 52 8d bd 72 92 37 2d 32 89 
+  number of blocks:   262144
+  bytes per block:    1024
+  number of clusters: 65536
+  bytes per cluster:  4096
+  max slots:          4
+
+ at DEVICE@ was run with -f, check forced.
+Pass 0a: Checking cluster allocation chains
+Pass 0b: Checking inode allocation chains
+Pass 0c: Checking extent block allocation chains
+Pass 1: Checking inodes and blocks.
+[INLINE_DATA_COUNT_INVALID] Inode 16863 is inline file and its id_count
is 0 which should be 824. Correct this count? y
+[INODE_SIZE] Inode 16863has a size of 825 which exceeds the max inline
data size 824. Correct the file size? y
+[INODE_CLUSTERS] Inode 16863 has 1 clusters but it has inline data flag
set. Correct the number of clusters? y
+[INLINE_DATA_COUNT_INVALID] Inode 16864 is inline file and its id_count
is 0 which should be 824. Correct this count? y
+[INODE_SIZE] Inode 16864has a size of 825 which exceeds the max inline
data size 824. Correct the file size? y
+[INODE_CLUSTERS] Inode 16864 has 1 clusters but it has inline data flag
set. Correct the number of clusters? y
+Pass 2: Checking directory entries.
+Pass 3: Checking directory connectivity.
+Pass 4a: checking for orphaned inodes
+Pass 4b: Checking inodes link counts.
+All passes succeeded.
Index: ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.44.stdout
===================================================================
--- ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.44.stdout
(revision 0)
+++ ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.44.stdout
(revision 0)
@@ -0,0 +1,21 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               b6 9a 0a bf 4f b7 45 33 a2 61 8f ab 93 f3 f0 5f 
+  number of blocks:   262144
+  bytes per block:    1024
+  number of clusters: 65536
+  bytes per cluster:  4096
+  max slots:          4
+
+ at DEVICE@ was run with -f, check forced.
+Pass 0a: Checking cluster allocation chains
+Pass 0b: Checking inode allocation chains
+Pass 0c: Checking extent block allocation chains
+Pass 1: Checking inodes and blocks.
+[INLINE_DATA_FLAG_INVALID] Inode 16883 has inline flag set but the
volume doesn't support it. Clear it? y
+[INLINE_DATA_FLAG_INVALID] Inode 16884 has inline flag set but the
volume doesn't support it. Clear it? y
+Pass 2: Checking directory entries.
+Pass 3: Checking directory connectivity.
+Pass 4a: checking for orphaned inodes
+Pass 4b: Checking inodes link counts.
+All passes succeeded.
Index: ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.45.stdout
===================================================================
--- ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.45.stdout
(revision 0)
+++ ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.45.stdout
(revision 0)
@@ -0,0 +1,25 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               04 31 ee 61 f6 02 44 ac a1 0b be a8 c7 59 6c b8 
+  number of blocks:   1048576
+  bytes per block:    4096
+  number of clusters: 1048576
+  bytes per cluster:  4096
+  max slots:          4
+
+ at DEVICE@ was run with -f, check forced.
+Pass 0a: Checking cluster allocation chains
+Pass 0b: Checking inode allocation chains
+Pass 0c: Checking extent block allocation chains
+Pass 1: Checking inodes and blocks.
+[INLINE_DATA_COUNT_INVALID] Inode 16851 is inline file and its id_count
is 0 which should be 3896. Correct this count? y
+[INODE_SIZE] Inode 16851has a size of 3897 which exceeds the max inline
data size 3896. Correct the file size? y
+[INODE_CLUSTERS] Inode 16851 has 1 clusters but it has inline data flag
set. Correct the number of clusters? y
+[INLINE_DATA_COUNT_INVALID] Inode 16852 is inline file and its id_count
is 0 which should be 3896. Correct this count? y
+[INODE_SIZE] Inode 16852has a size of 3897 which exceeds the max inline
data size 3896. Correct the file size? y
+[INODE_CLUSTERS] Inode 16852 has 1 clusters but it has inline data flag
set. Correct the number of clusters? y
+Pass 2: Checking directory entries.
+Pass 3: Checking directory connectivity.
+Pass 4a: checking for orphaned inodes
+Pass 4b: Checking inodes link counts.
+All passes succeeded.
Index: ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.44.stdout
===================================================================
--- ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.44.stdout
(revision 0)
+++ ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.44.stdout
(revision 0)
@@ -0,0 +1,21 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               f4 54 89 d1 04 97 4b 52 a7 b6 8c 73 26 77 22 d3 
+  number of blocks:   1048576
+  bytes per block:    4096
+  number of clusters: 1048576
+  bytes per cluster:  4096
+  max slots:          4
+
+ at DEVICE@ was run with -f, check forced.
+Pass 0a: Checking cluster allocation chains
+Pass 0b: Checking inode allocation chains
+Pass 0c: Checking extent block allocation chains
+Pass 1: Checking inodes and blocks.
+[INLINE_DATA_FLAG_INVALID] Inode 16857 has inline flag set but the
volume doesn't support it. Clear it? y
+[INLINE_DATA_FLAG_INVALID] Inode 16858 has inline flag set but the
volume doesn't support it. Clear it? y
+Pass 2: Checking directory entries.
+Pass 3: Checking directory connectivity.
+Pass 4a: checking for orphaned inodes
+Pass 4b: Checking inodes link counts.
+All passes succeeded.
Index: ocfs2-test/programs/fsck-tests/fsck-test.sh
===================================================================
--- ocfs2-test/programs/fsck-tests/fsck-test.sh	(revision 183)
+++ ocfs2-test/programs/fsck-tests/fsck-test.sh	(working copy)
@@ -193,6 +193,10 @@
 DISK_SIZE="small"
 LOG_DIR=""
 
+declare -a FS_FEATURES=""
+FS_FEATURES_OPTION="--fs-features="
+FS_FEATURES_ARGS=""
+
 #
 # ext_setup		Guess the position of fsck.ocfs2, fswreck and fill
 #			FSCK_BIN, FSWRECK_BIN
@@ -348,6 +352,22 @@
 	test_pass_or_fail 0
 }
 
+#add --fs-feature support for mkfs
+function gen_fs_features()
+{
+        local corrupt="$1"
+        case "$corrupt" in
+                "44")   ;;
+                "45")   FS_FEATURES="inline-data" ;;
+                *)      ;;
+        esac
+
+        for item in $FS_FEATURES;do
+                FS_FEATURES_ARGS="${FS_FEATURES_OPTION}${item}
${FS_FEATURES_ARGS}"
+        done
+
+}
+
 #	$2	Disk size, should be ``small'', ``medium'' or ``large''.
 function corrupt_test()
 {
@@ -394,10 +414,13 @@
 	test_info "dd if=/dev/zero of=$DEVICE bs=1M count=4"
 	test_fail_if_bad "$?" "dd failed" || return
 
-	test_info mkfs.ocfs2 -b "${mkfs_profile[0]}" -C "${mkfs_profile[1]}" \
+	#add --fs-features support for mkfs
+        gen_fs_features ${corrupt}
+
+	test_info mkfs.ocfs2 ${FS_FEATURES_ARGS} -b "${mkfs_profile[0]}" -C
"${mkfs_profile[1]}" \
 		-N "${mkfs_profile[2]}" -J "size=${mkfs_profile[3]}" \
 		"$DEVICE" "${mkfs_profile[4]}"
-	yes | "$MKFS_BIN" -b "${mkfs_profile[0]}" -C "${mkfs_profile[1]}" \
+	yes | "$MKFS_BIN" ${FS_FEATURES_ARGS} -b "${mkfs_profile[0]}" -C
"${mkfs_profile[1]}" \
 		-N "${mkfs_profile[2]}" -J "size=${mkfs_profile[3]}" \
 		"$DEVICE" "${mkfs_profile[4]}" &>"$STDOUT"
 	test_fail_if_bad "$?" "mkfs failed" || return




More information about the Ocfs2-test-devel mailing list