From: Loic Dachary Date: Tue, 2 Dec 2014 22:16:05 +0000 (+0100) Subject: qa: cephtool/test.sh use regular strings to list tests X-Git-Tag: v0.89~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fremotes%2Floic%2Fwip-cephtool;p=ceph.git qa: cephtool/test.sh use regular strings to list tests Using the array notation to list test is error prone and more complicated to write. It also fixes a bug : only the first test of each series (MON, OSD, MDS) was run and the others were ignored. Signed-off-by: Loic Dachary --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index e8f3b38789ac..0f1df8992c45 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -1295,39 +1295,31 @@ function test_osd_bench() # set +x -MON_TESTS=( - mon_injectargs - mon_injectargs_SI - tiering - auth - auth_profiles - mon_misc - mon_mon - mon_osd - mon_osd_pool - mon_osd_pool_quota - mon_pg - mon_osd_pool_set - mon_osd_tiered_pool_set - mon_osd_erasure_code - mon_osd_misc - mon_heap_profiler -) - -OSD_TESTS=( - osd_bench -) - -MDS_TESTS=( - mds_tell - mon_mds -) - -TESTS=( - $MON_TESTS - $OSD_TESTS - $MDS_TESTS -) +MON_TESTS+=" mon_injectargs" +MON_TESTS+=" mon_injectargs_SI" +MON_TESTS+=" tiering" +MON_TESTS+=" auth" +MON_TESTS+=" auth_profiles" +MON_TESTS+=" mon_misc" +MON_TESTS+=" mon_mon" +MON_TESTS+=" mon_osd" +MON_TESTS+=" mon_osd_pool" +MON_TESTS+=" mon_osd_pool_quota" +MON_TESTS+=" mon_pg" +MON_TESTS+=" mon_osd_pool_set" +MON_TESTS+=" mon_osd_tiered_pool_set" +MON_TESTS+=" mon_osd_erasure_code" +MON_TESTS+=" mon_osd_misc" +MON_TESTS+=" mon_heap_profiler" + +OSD_TESTS+=" osd_bench" + +MDS_TESTS+=" mds_tell" +MDS_TESTS+=" mon_mds" + +TESTS+=$MON_TESTS +TESTS+=$OSD_TESTS +TESTS+=$MDS_TESTS # # "main" follows @@ -1336,7 +1328,7 @@ TESTS=( function list_tests() { echo "AVAILABLE TESTS" - for i in ${TESTS[@]}; do + for i in $TESTS; do echo " $i" done } @@ -1364,13 +1356,13 @@ while [[ $# -gt 0 ]]; do sanity_check=false ;; "--test-mon" ) - tests_to_run=("${tests_to_run[@]}" $MON_TESTS) + tests_to_run+="$MON_TESTS" ;; "--test-osd" ) - tests_to_run=("${tests_to_run[@]}" $OSD_TESTS) + tests_to_run+="$OSD_TESTS" ;; "--test-mds" ) - tests_to_run=("${tests_to_run[@]}" $MDS_TESTS) + tests_to_run+="$MDS_TESTS" ;; "-t" ) shift @@ -1379,7 +1371,7 @@ while [[ $# -gt 0 ]]; do usage ; exit 1 fi - tests_to_run=("${tests_to_run[@]}" "$1") + tests_to_run+=" $1" ;; "-h" ) usage ; @@ -1394,14 +1386,14 @@ if [[ $do_list -eq 1 ]]; then exit 0 fi -if [[ ${#tests_to_run[@]} -eq 0 ]]; then - tests_to_run=("${TESTS[@]}") +if test -z "$tests_to_run" ; then + tests_to_run="$TESTS" fi if $sanity_check ; then wait_no_osd_down fi -for i in ${tests_to_run[@]}; do +for i in $tests_to_run; do if $sanity_check ; then check_no_osd_down fi