]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm/test: Add '--raidtype=' to run different raidlevel cases
authorZhilong Liu <zlliu@suse.com>
Wed, 14 Jun 2017 13:02:52 +0000 (21:02 +0800)
committerJes Sorensen <jsorensen@fb.com>
Mon, 10 Jul 2017 17:33:19 +0000 (13:33 -0400)
It supports to specify the argument of "--raidtype"
to run the different raid level cases. Details refer
to the do_help() usage.
For example: ./test --raidtype=raid1
could execute all the raid1 test cases under tests/.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
test

diff --git a/test b/test
index 7ee523baec8c94ee95ba0a2e0763ec2d5490ebf1..df2eeab8de2cb86330a085a7155aa9d8ac093f4d 100755 (executable)
--- a/test
+++ b/test
@@ -385,6 +385,7 @@ do_help() {
        Usage: $0 [options]
        Options:
                --tests=test1,test2,...     Comma separated list of tests to run
+               --raidtype=                 raid0|linear|raid1|raid456|raid10|ddf|imsm
                --disable-multipath         Disable any tests involving multipath
                --disable-integrity         Disable slow tests of RAID[56] consistency
                --logdir=directory          Directory to save all logfiles in
@@ -419,6 +420,36 @@ parse_args() {
                --tests=* )
                        TESTLIST=($(echo ${i##*=} | sed -e 's/,/ /g'))
                        ;;
+               --raidtype=* )
+                       case ${i##*=} in
+                       raid0 )
+                               TESTLIST=($(ls $testdir | grep "[0-9][0-9]r0\|raid0"))
+                               ;;
+                       linear )
+                               TESTLIST=($(ls $testdir | grep "linear"))
+                               ;;
+                       raid1 )
+                               TESTLIST=($(ls $testdir | grep "[0-9][0-9]r1\|raid1" | grep -vi raid10))
+                               ;;
+                       raid456 )
+                               TESTLIST=($(ls $testdir | grep "[0-9][0-9]r[4-6]\|raid[4-6]"))
+                               ;;
+                       raid10 )
+                               TESTLIST=($(ls $testdir | grep "[0-9][0-9]r10\|raid10"))
+                               ;;
+                       ddf )
+                               TESTLIST=($(ls $testdir | grep "[0-9][0-9]ddf"))
+                               ;;
+                       imsm )
+                               TESTLIST=($(ls $testdir | grep "[0-9][0-9]imsm"))
+                               ;;
+                       * )
+                               echo "Unknown argument: $i"
+                               do_help
+                               exit 1
+                               ;;
+                       esac
+                       ;;
                --logdir=* )
                        logdir="${i##*=}"
                        ;;