summaryrefslogtreecommitdiffstats
path: root/tests/04update-metadata
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-24 14:34:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-24 14:34:34 +0000
commit946b54554e13d6a97940df936123855e0a305abc (patch)
tree80a778fbd7bb3c7858cfac572df1cb08cfa4f988 /tests/04update-metadata
parentInitial commit. (diff)
downloadmdadm-946b54554e13d6a97940df936123855e0a305abc.tar.xz
mdadm-946b54554e13d6a97940df936123855e0a305abc.zip
Adding upstream version 4.2.upstream/4.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/04update-metadata')
-rw-r--r--tests/04update-metadata48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/04update-metadata b/tests/04update-metadata
new file mode 100644
index 0000000..232fc1f
--- /dev/null
+++ b/tests/04update-metadata
@@ -0,0 +1,48 @@
+set -xe
+
+# test converting v0.90 to v1.0
+# check for different levels
+# check it fails for non-v0.90
+# check it fails during reshape or recovery
+# check it fails when bitmap is present
+
+dlist="$dev0 $dev1 $dev2 $dev3"
+
+for ls in raid0/4 linear/4 raid1/1 raid5/3 raid6/2
+do
+ s=${ls#*/} l=${ls%/*}
+ mdadm -CR --assume-clean -e 0.90 $md0 --level $l -n 4 -c 64 $dlist
+ testdev $md0 $s 19904 64
+ mdadm -S $md0
+ mdadm -A $md0 --update=metadata $dlist
+ testdev $md0 $s 19904 64 check
+ mdadm -S $md0
+done
+
+if mdadm -A $md0 --update=metadata $dlist
+then echo >&2 should fail with v1.0 metadata
+ exit 1
+fi
+
+mdadm -CR -e 0.90 $md0 --level=6 -n4 -c32 $dlist
+mdadm -S $md0
+
+if mdadm -A $md0 --update=metadata $dlist
+then echo >&2 should fail during resync
+ exit 1
+fi
+mdadm -A $md0 $dlist
+mdadm --wait $md0 || true
+mdadm -S $md0
+
+# should succeed now
+mdadm -A $md0 --update=metadata $dlist
+
+mdadm -S /dev/md0
+mdadm -CR --assume-clean -e 0.90 $md0 --level=6 -n4 -c32 $dlist --bitmap=internal
+mdadm -S $md0
+
+if mdadm -A $md0 --update=metadata $dlist
+then echo >&2 should fail when bitmap present
+ exit 1
+fi