From: Zhilong Liu <zlliu@suse.com>
To: Jes.Sorensen@gmail.com
Cc: linux-raid@vger.kernel.org, Zhilong Liu <zlliu@suse.com>
Subject: [PATCH 5/5] mdadm/test: add new testcase for testing readonly/readwrite
Date: Mon, 28 Aug 2017 17:24:31 +0800 [thread overview]
Message-ID: <1503912271-6463-6-git-send-email-zlliu@suse.com> (raw)
In-Reply-To: <1503912271-6463-1-git-send-email-zlliu@suse.com>
This is a test case for testing --readonly and
--readwrite feature, it covers common metadata
versions and raid levels.
Signed-off-by: Zhilong Liu <zlliu@suse.com>
---
tests/00readonly | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 tests/00readonly
diff --git a/tests/00readonly b/tests/00readonly
new file mode 100644
index 0000000..28b0fa1
--- /dev/null
+++ b/tests/00readonly
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+for metadata in 0.9 1.0 1.1 1.2
+do
+ for level in linear raid0 raid1 raid4 raid5 raid6 raid10
+ do
+ mdadm -CR $md0 -l $level -n 4 --metadata=$metadata \
+ $dev1 $dev2 $dev3 $dev4 --assume-clean
+ check nosync
+ check $level
+ mdadm -ro $md0
+ check readonly
+ state=$(cat /sys/block/md0/md/array_state)
+ [ "$state" == "readonly" ] ||
+ die "array_state should be 'readonly', but is $state"
+ mdadm -w $md0
+ check $level
+ mdadm -S $md0
+ done
+done
+
+exit 0
--
2.6.6
next prev parent reply other threads:[~2017-08-28 9:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-28 9:24 [PATCH 0/5] mdadm/test: Update for mdadm test part Zhilong Liu
2017-08-28 9:24 ` [PATCH 1/5] mdadm/bitmap: examine-bitmap failed when bitmap is external mode Zhilong Liu
2017-09-01 15:20 ` Jes Sorensen
2017-08-28 9:24 ` [PATCH 2/5] mdadm/test: use the first element of array as parsing condition Zhilong Liu
2017-09-01 15:22 ` Jes Sorensen
2017-08-28 9:24 ` [PATCH 3/5] mdadm/test: get rid of the tests/testdev Zhilong Liu
2017-09-01 15:26 ` Jes Sorensen
2017-08-28 9:24 ` [PATCH 4/5] mdadm/test: get rid of tests/check Zhilong Liu
2017-09-01 15:27 ` Jes Sorensen
2017-08-28 9:24 ` Zhilong Liu [this message]
2017-09-01 15:28 ` [PATCH 5/5] mdadm/test: add new testcase for testing readonly/readwrite Jes Sorensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1503912271-6463-6-git-send-email-zlliu@suse.com \
--to=zlliu@suse.com \
--cc=Jes.Sorensen@gmail.com \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.