Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 1 | From 14c2161edb77d7294199e8aa7daa9f9d1d0ad5d7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com> |
| 3 | Date: Wed, 22 Jun 2022 14:25:14 -0600 |
| 4 | Subject: [PATCH] tests: fix raid0 tests for 0.90 metadata |
| 5 | |
| 6 | Some of the test cases fail because raid0 creation fails with the error, |
| 7 | "0.90 metadata does not support layouts for RAID0" added by commit, |
| 8 | 329dfc28debb. Fix some of the test cases by switching from raid0 to |
| 9 | linear level for 0.9 metadata where possible. |
| 10 | |
| 11 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=14c2161edb77d7294199e8aa7daa9f9d1d0ad5d7] |
| 12 | |
| 13 | Signed-off-by: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com> |
| 14 | Signed-off-by: Himanshu Madhani <himanshu.madhani@oracle.com> |
| 15 | Signed-off-by: Logan Gunthorpe <logang@deltatee.com> |
| 16 | Signed-off-by: Jes Sorensen <jes@trained-monkey.org> |
| 17 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> |
| 18 | --- |
| 19 | tests/00raid0 | 4 ++-- |
| 20 | tests/00readonly | 4 ++++ |
| 21 | tests/03r0assem | 6 +++--- |
| 22 | tests/04r0update | 4 ++-- |
| 23 | tests/04update-metadata | 2 +- |
| 24 | 5 files changed, 12 insertions(+), 8 deletions(-) |
| 25 | |
| 26 | diff --git a/tests/00raid0 b/tests/00raid0 |
| 27 | index e6b21cc4..9b8896cb 100644 |
| 28 | --- a/tests/00raid0 |
| 29 | +++ b/tests/00raid0 |
| 30 | @@ -20,8 +20,8 @@ mdadm -S $md0 |
| 31 | # now same again with different chunk size |
| 32 | for chunk in 4 32 256 |
| 33 | do |
| 34 | - mdadm -CR $md0 -e0.90 -l raid0 --chunk $chunk -n3 $dev0 $dev1 $dev2 |
| 35 | - check raid0 |
| 36 | + mdadm -CR $md0 -e0.90 -l linear --chunk $chunk -n3 $dev0 $dev1 $dev2 |
| 37 | + check linear |
| 38 | testdev $md0 3 $mdsize0 $chunk |
| 39 | mdadm -S $md0 |
| 40 | |
| 41 | diff --git a/tests/00readonly b/tests/00readonly |
| 42 | index 28b0fa13..39202487 100644 |
| 43 | --- a/tests/00readonly |
| 44 | +++ b/tests/00readonly |
| 45 | @@ -4,6 +4,10 @@ for metadata in 0.9 1.0 1.1 1.2 |
| 46 | do |
| 47 | for level in linear raid0 raid1 raid4 raid5 raid6 raid10 |
| 48 | do |
| 49 | + if [[ $metadata == "0.9" && $level == "raid0" ]]; |
| 50 | + then |
| 51 | + continue |
| 52 | + fi |
| 53 | mdadm -CR $md0 -l $level -n 4 --metadata=$metadata \ |
| 54 | $dev1 $dev2 $dev3 $dev4 --assume-clean |
| 55 | check nosync |
| 56 | diff --git a/tests/03r0assem b/tests/03r0assem |
| 57 | index 6744e322..44df0645 100644 |
| 58 | --- a/tests/03r0assem |
| 59 | +++ b/tests/03r0assem |
| 60 | @@ -68,9 +68,9 @@ mdadm -S $md2 |
| 61 | ### Now for version 0... |
| 62 | |
| 63 | mdadm --zero-superblock $dev0 $dev1 $dev2 |
| 64 | -mdadm -CR $md2 -l0 --metadata=0.90 -n3 $dev0 $dev1 $dev2 |
| 65 | -check raid0 |
| 66 | -tst="testdev $md2 3 $mdsize0 512" |
| 67 | +mdadm -CR $md2 -llinear --metadata=0.90 -n3 $dev0 $dev1 $dev2 |
| 68 | +check linear |
| 69 | +tst="testdev $md2 3 $mdsize0 1" |
| 70 | $tst |
| 71 | |
| 72 | uuid=`mdadm -Db $md2 | sed 's/.*UUID=//'` |
| 73 | diff --git a/tests/04r0update b/tests/04r0update |
| 74 | index 73ee3b9f..b95efb06 100644 |
| 75 | --- a/tests/04r0update |
| 76 | +++ b/tests/04r0update |
| 77 | @@ -1,7 +1,7 @@ |
| 78 | |
| 79 | # create a raid0, re-assemble with a different super-minor |
| 80 | -mdadm -CR -e 0.90 $md0 -l0 -n3 $dev0 $dev1 $dev2 |
| 81 | -testdev $md0 3 $mdsize0 512 |
| 82 | +mdadm -CR -e 0.90 $md0 -llinear -n3 $dev0 $dev1 $dev2 |
| 83 | +testdev $md0 3 $mdsize0 1 |
| 84 | minor1=`mdadm -E $dev0 | sed -n -e 's/.*Preferred Minor : //p'` |
| 85 | mdadm -S /dev/md0 |
| 86 | |
| 87 | diff --git a/tests/04update-metadata b/tests/04update-metadata |
| 88 | index 232fc1ff..08c14af7 100644 |
| 89 | --- a/tests/04update-metadata |
| 90 | +++ b/tests/04update-metadata |
| 91 | @@ -8,7 +8,7 @@ set -xe |
| 92 | |
| 93 | dlist="$dev0 $dev1 $dev2 $dev3" |
| 94 | |
| 95 | -for ls in raid0/4 linear/4 raid1/1 raid5/3 raid6/2 |
| 96 | +for ls in linear/4 raid1/1 raid5/3 raid6/2 |
| 97 | do |
| 98 | s=${ls#*/} l=${ls%/*} |
| 99 | mdadm -CR --assume-clean -e 0.90 $md0 --level $l -n 4 -c 64 $dlist |
| 100 | -- |
| 101 | 2.25.1 |
| 102 | |