From bcc2a165fc2c762c4ebbe78537b54dccd6e0dec1 Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Thu, 20 Feb 2020 15:50:32 +0300 Subject: [PATCH 1/1] LU-13269 tests: make lnet-selftest.sh more flexible 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 Reviewed-by: Chris Horn Reviewed-by: Vladimir Saveliev Change-Id: I0111a4386b3d8acb022db11f11a0be970864696d Reviewed-on: https://review.whamcloud.com/37640 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Vladimir Saveliev Reviewed-by: Alexey Lyashkov Reviewed-by: Oleg Drokin --- lustre/tests/lnet-selftest.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lustre/tests/lnet-selftest.sh b/lustre/tests/lnet-selftest.sh index 6155c8b..4d655f6 100755 --- a/lustre/tests/lnet-selftest.sh +++ b/lustre/tests/lnet-selftest.sh @@ -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" \ -- 1.8.3.1