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

tristan tristan.ye at oracle.com
Mon Aug 11 22:54:21 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,22 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               49 9b d1 19 43 86 4a 47 83 57 e3 29 44 58 5e 95 
+  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
+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.47.stdout
===================================================================
--- ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.47.stdout
(revision 0)
+++ ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.47.stdout
(revision 0)
@@ -0,0 +1,22 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               f1 7c 67 04 ac bf 4f d7 a4 7a 3b cc a6 5b 0f 1c 
+  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
+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,20 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               ad c9 78 dc ca f1 4e 7a bf 72 24 b6 8f 76 0f c9 
+  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
+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.46.stdout
===================================================================
--- ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.46.stdout
(revision 0)
+++ ocfs2-test/programs/fsck-tests/small-disk/fsck.ocfs2.46.stdout
(revision 0)
@@ -0,0 +1,20 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               7e 87 9f c1 05 6f 4f 29 8e 88 a1 2d 83 ef db 49 
+  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
+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,22 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               1a bc 61 db 1f 80 42 7c 88 95 cb d5 0c 2a 1f f6 
+  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
+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.47.stdout
===================================================================
--- ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.47.stdout
(revision 0)
+++ ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.47.stdout
(revision 0)
@@ -0,0 +1,22 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               36 7b 65 0e 04 ca 49 54 b0 34 c8 c7 67 61 d5 be 
+  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
+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,20 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               73 eb ff 36 2a f6 43 fd 8d 2b e1 00 fb a0 75 a4 
+  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
+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.46.stdout
===================================================================
--- ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.46.stdout
(revision 0)
+++ ocfs2-test/programs/fsck-tests/medium-disk/fsck.ocfs2.46.stdout
(revision 0)
@@ -0,0 +1,20 @@
+Checking OCFS2 filesystem in @DEVICE@:
+  label:              <NONE>
+  uuid:               09 05 2d bf 9d 4c 4e e4 ba c1 b9 79 35 4e 01 96 
+  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
+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,9 @@
 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
@@ -347,7 +350,23 @@
 	"$FSCK_BIN" -V >"$STDOUT" 2>"$STDERR"
 	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" ;;
+		"46")	;;
+		"47")	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()
 {
@@ -393,11 +412,14 @@
 	dd if=/dev/zero of=$DEVICE bs=1M count=4 &>"$STDOUT"
 	test_info "dd if=/dev/zero of=$DEVICE bs=1M count=4"
 	test_fail_if_bad "$?" "dd failed" || return
+	
+	#add --fs-features support for mkfs
+	gen_fs_features ${corrupt}
 
-	test_info mkfs.ocfs2 -b "${mkfs_profile[0]}" -C "${mkfs_profile[1]}" \
+	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