Whamcloud - gitweb
LU-13269 tests: make lnet-selftest.sh more flexible 40/37640/2
authorElena Gryaznova <elena.gryaznova@hpe.com>
Thu, 20 Feb 2020 12:50:32 +0000 (15:50 +0300)
committerOleg Drokin <green@whamcloud.com>
Sun, 1 Mar 2020 05:37:36 +0000 (05:37 +0000)
lnet-selftest.sh adds both LST tests: from client to server and
from server to client, but sometimes we are interesting to execute
the tests only from server or only from client.

Patch allows to set required "from" parameter via lst_FROM variable.
The following values are used:
lst_FROM=c : add the tests from clients to server only
lst_FROM=s : add the tests from server to clients only

Test-Parameters: testlist=lnet-selftest envdefinitions=lst_FROM=c
Cray-bug-id: LUS-8178
Signed-off-by: Elena Gryaznova <elena.gryaznova@hpe.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@hpe.com>
Change-Id: I0111a4386b3d8acb022db11f11a0be970864696d
Reviewed-on: https://review.whamcloud.com/37640
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/lnet-selftest.sh

index 6155c8b..4d655f6 100755 (executable)
@@ -42,6 +42,8 @@ lst_TESTS=${lst_TESTS:-"write read ping"}
 # "simple" -> LST_BRW_CHECK_SIMPLE
 lst_CHECK=${lst_CHECK:-"full"}
 
+lst_FROM=${lst_FROM:-"cs"}
+
 case $lst_CHECK in
        full|simple) check="check=$lst_CHECK";;
        none) check="";;
@@ -115,14 +117,23 @@ test_smoke_sub () {
     echo "$LST add_group s $(nids_list $servers)"
     echo "$LST add_batch b"
 
+       declare -a tests
+
+       case $lst_FROM in
+               c) tests[0]="${nc}:${ns} --from c --to s";;
+               s) tests[0]="${ns}:${nc} --from s --to c";;
+               cs)tests[0]="${nc}:${ns} --from c --to s"
+                  tests[1]="${ns}:${nc} --from s --to c";;
+               *) error Unknown flag $lst_FROM;;
+       esac
+
        pre="$LST add_test --batch b --loop $lst_LOOP "
        for t in $lst_TESTS; do
                for s in $lst_SIZES; do
                        for c in $lst_CONCR; do
-                               for d in "${nc}:${ns} --from c --to s" \
-                                       "${ns}:${nc} --from s --to c"; do
+                               for ((i=0; i<${#tests[@]}; i++)); do
                                        echo -n "$pre --concurrency $c"\
-                                               " --distribute $d "
+                                               " --distribute ${tests[i]} "
                                        case $t in
                                                read|write)
                                                        echo -n "brw $t" \