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

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