summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhilong Liu <zlliu@suse.com>2018-01-16 10:45:05 +0100
committerJes Sorensen <jsorensen@fb.com>2018-01-21 22:36:08 +0100
commit6c33d34df2b0bcacadd5c547c8c827bbfac1bd2a (patch)
treee04f4d1cdb487f0282ebbd85a1b3eda3e6e85223
parentmdadm/test: enable clustermd testing under clustermd_tests/ (diff)
downloadmdadm-6c33d34df2b0bcacadd5c547c8c827bbfac1bd2a.tar.xz
mdadm-6c33d34df2b0bcacadd5c547c8c827bbfac1bd2a.zip
mdadm/test: add '--testdir=' to switch choosing test suite
By now, mdadm has two test suites to cover traditional sofr-raid testing and clustermd testing, the '--testdir=' option supports to switch which suite to test, tests/ or clustermd_tests/. Signed-off-by: Zhilong Liu <zlliu@suse.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r--clustermd_tests/func.sh2
-rwxr-xr-xtest32
2 files changed, 28 insertions, 6 deletions
diff --git a/clustermd_tests/func.sh b/clustermd_tests/func.sh
index f88d33f8..23874245 100644
--- a/clustermd_tests/func.sh
+++ b/clustermd_tests/func.sh
@@ -1,7 +1,5 @@
#!/bin/bash
-CLUSTER_CONF=$PWD/cluster_conf
-
check_ssh()
{
NODE1="$(grep '^NODE1' $CLUSTER_CONF | cut -d'=' -f2)"
diff --git a/test b/test
index 6175c25e..4ddef382 100755
--- a/test
+++ b/test
@@ -1,14 +1,12 @@
#!/bin/bash
#
# run test suite for mdadm
-
-. tests/func.sh
-
mdadm=$PWD/mdadm
-testdir="tests"
targetdir="/var/tmp"
logdir="$targetdir"
config=/tmp/mdadm.conf
+testdir=
+devlist=
savelogs=0
exitonerror=1
@@ -114,6 +112,7 @@ do_help() {
Example for disk mode: ./test --dev=disk --disks=/dev/sda{2..15}
Options:
--tests=test1,test2,... Comma separated list of tests to run
+ --testdir= Specify testdir as tests|clustermd_tests
--raidtype= raid0|linear|raid1|raid456|raid10|ddf|imsm
--disable-multipath Disable any tests involving multipath
--disable-integrity Disable slow tests of RAID[56] consistency
@@ -134,6 +133,29 @@ parse_args() {
for i in $*
do
case $i in
+ --testdir=* )
+ case ${i##*=} in
+ tests )
+ testdir=tests
+ ;;
+ clustermd_tests )
+ testdir=clustermd_tests
+ CLUSTER_CONF="$PWD/$testdir/cluster_conf"
+ ;;
+ * )
+ echo "Unknown argument: $i"
+ do_help
+ exit 1
+ ;;
+ esac
+ ;;
+ esac
+ done
+ [ -z "$testdir" ] && testdir=tests
+ . $testdir/func.sh
+ for i in $*
+ do
+ case $i in
[0-9][0-9] )
prefix=$i
;;
@@ -147,6 +169,8 @@ parse_args() {
cleanup
exit 0
;;
+ --testdir=* )
+ ;;
--tests=* )
TESTLIST=($(echo ${i##*=} | sed -e 's/,/ /g'))
;;