Blame SOURCES/0039-tests-fix-raid0-tests-for-0.90-metadata.patch

c0f891
From 14c2161edb77d7294199e8aa7daa9f9d1d0ad5d7 Mon Sep 17 00:00:00 2001
c0f891
From: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
c0f891
Date: Wed, 22 Jun 2022 14:25:14 -0600
37f2b0
Subject: [PATCH 39/83] tests: fix raid0 tests for 0.90 metadata
c0f891
c0f891
Some of the test cases fail because raid0 creation fails with the error,
c0f891
"0.90 metadata does not support layouts for RAID0" added by commit,
c0f891
329dfc28debb. Fix some of the test cases by switching from raid0 to
c0f891
linear level for 0.9 metadata where possible.
c0f891
c0f891
Signed-off-by: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
c0f891
Signed-off-by: Himanshu Madhani <himanshu.madhani@oracle.com>
c0f891
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
c0f891
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
c0f891
---
c0f891
 tests/00raid0           | 4 ++--
c0f891
 tests/00readonly        | 4 ++++
c0f891
 tests/03r0assem         | 6 +++---
c0f891
 tests/04r0update        | 4 ++--
c0f891
 tests/04update-metadata | 2 +-
c0f891
 5 files changed, 12 insertions(+), 8 deletions(-)
c0f891
c0f891
diff --git a/tests/00raid0 b/tests/00raid0
c0f891
index e6b21cc4..9b8896cb 100644
c0f891
--- a/tests/00raid0
c0f891
+++ b/tests/00raid0
c0f891
@@ -20,8 +20,8 @@ mdadm -S $md0
c0f891
 # now same again with different chunk size
c0f891
 for chunk in 4 32 256
c0f891
 do
c0f891
-  mdadm -CR $md0 -e0.90 -l raid0 --chunk $chunk -n3 $dev0 $dev1 $dev2
c0f891
-  check raid0
c0f891
+  mdadm -CR $md0 -e0.90 -l linear --chunk $chunk -n3 $dev0 $dev1 $dev2
c0f891
+  check linear
c0f891
   testdev $md0 3 $mdsize0 $chunk
c0f891
   mdadm -S $md0
c0f891
 
c0f891
diff --git a/tests/00readonly b/tests/00readonly
c0f891
index 28b0fa13..39202487 100644
c0f891
--- a/tests/00readonly
c0f891
+++ b/tests/00readonly
c0f891
@@ -4,6 +4,10 @@ for metadata in 0.9 1.0 1.1 1.2
c0f891
 do
c0f891
 	for level in linear raid0 raid1 raid4 raid5 raid6 raid10
c0f891
 	do
c0f891
+		if [[ $metadata == "0.9" && $level == "raid0" ]];
c0f891
+		then
c0f891
+			continue
c0f891
+		fi
c0f891
 		mdadm -CR $md0 -l $level -n 4 --metadata=$metadata \
c0f891
 			$dev1 $dev2 $dev3 $dev4 --assume-clean
c0f891
 		check nosync
c0f891
diff --git a/tests/03r0assem b/tests/03r0assem
c0f891
index 6744e322..44df0645 100644
c0f891
--- a/tests/03r0assem
c0f891
+++ b/tests/03r0assem
c0f891
@@ -68,9 +68,9 @@ mdadm -S $md2
c0f891
 ### Now for version 0...
c0f891
 
c0f891
 mdadm --zero-superblock $dev0 $dev1 $dev2
c0f891
-mdadm -CR $md2 -l0 --metadata=0.90 -n3 $dev0 $dev1 $dev2
c0f891
-check raid0
c0f891
-tst="testdev $md2 3 $mdsize0 512"
c0f891
+mdadm -CR $md2 -llinear --metadata=0.90 -n3 $dev0 $dev1 $dev2
c0f891
+check linear
c0f891
+tst="testdev $md2 3 $mdsize0 1"
c0f891
 $tst
c0f891
 
c0f891
 uuid=`mdadm -Db $md2 | sed 's/.*UUID=//'`
c0f891
diff --git a/tests/04r0update b/tests/04r0update
c0f891
index 73ee3b9f..b95efb06 100644
c0f891
--- a/tests/04r0update
c0f891
+++ b/tests/04r0update
c0f891
@@ -1,7 +1,7 @@
c0f891
 
c0f891
 # create a raid0, re-assemble with a different super-minor
c0f891
-mdadm -CR -e 0.90 $md0 -l0 -n3 $dev0 $dev1 $dev2
c0f891
-testdev $md0 3 $mdsize0 512
c0f891
+mdadm -CR -e 0.90 $md0 -llinear -n3 $dev0 $dev1 $dev2
c0f891
+testdev $md0 3 $mdsize0 1
c0f891
 minor1=`mdadm -E $dev0 | sed -n -e 's/.*Preferred Minor : //p'`
c0f891
 mdadm -S /dev/md0
c0f891
 
c0f891
diff --git a/tests/04update-metadata b/tests/04update-metadata
c0f891
index 232fc1ff..08c14af7 100644
c0f891
--- a/tests/04update-metadata
c0f891
+++ b/tests/04update-metadata
c0f891
@@ -8,7 +8,7 @@ set -xe
c0f891
 
c0f891
 dlist="$dev0 $dev1 $dev2 $dev3"
c0f891
 
c0f891
-for ls in raid0/4 linear/4 raid1/1 raid5/3 raid6/2
c0f891
+for ls in linear/4 raid1/1 raid5/3 raid6/2
c0f891
 do
c0f891
   s=${ls#*/} l=${ls%/*}
c0f891
   mdadm -CR --assume-clean -e 0.90 $md0 --level $l -n 4 -c 64 $dlist
c0f891
-- 
37f2b0
2.38.1
c0f891