Whamcloud - gitweb
LU-15412 tests: Let init_clients_lists() export client vars 94/45994/7
authorXinliang Liu <xinliang.liu@linaro.org>
Fri, 7 Jan 2022 02:41:00 +0000 (02:41 +0000)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Jun 2022 05:33:01 +0000 (05:33 +0000)
init_clients_lists() counts the value of client related variables
correctly. So let it define and export these variables.

This patch can fix sanity test 807 stuck issue when running on
multi-node Lustre cluster and CLIENTS is empty.

Also cleanup client count checking. Now CLIENTS is always set.

Change-Id: I9a5d4b9bde401e14e1d7f6f88b04c8d1c6aea11a
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Reviewed-on: https://review.whamcloud.com/45994
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
13 files changed:
lustre/tests/cfg/local.sh
lustre/tests/cfg/ncli.sh
lustre/tests/large-lun.sh
lustre/tests/large-scale.sh
lustre/tests/recovery-double-scale.sh
lustre/tests/recovery-mds-scale.sh
lustre/tests/recovery-random-scale.sh
lustre/tests/recovery-small.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-single.sh
lustre/tests/replay-vbr.sh
lustre/tests/sanityn.sh
lustre/tests/test-framework.sh

index e61bbb8..d408dec 100644 (file)
@@ -6,7 +6,6 @@ mdsfailover_HOST=${mdsfailover_HOST}
 mgs_HOST=${mgs_HOST:-$mds_HOST}
 ost_HOST=${ost_HOST:-$(hostname)}
 ostfailover_HOST=${ostfailover_HOST}
-CLIENTS=""
 # FILESET variable is used by sanity.sh to verify fileset
 # feature, tests should pass even under subdirectory namespace.
 FILESET=${FILESET:-""}
index 59ee009..23c26a2 100644 (file)
@@ -3,8 +3,6 @@
 # For multiple clients testing, we need use the cfg/ncli.sh config file, and
 # only need specify the "RCLIENTS" variable. The "CLIENTS" and "CLIENTCOUNT"
 # variables are defined in init_clients_lists(), called from cfg/ncli.sh.
-CLIENT1=${CLIENT1:-$(hostname)}
-SINGLECLIENT=$CLIENT1
 RCLIENTS=${RCLIENTS:-""}
 
 init_clients_lists
index 153d0bb..d2e6244 100644 (file)
@@ -265,7 +265,6 @@ test_2 () {
 run_test 2 "run llverfs on OST ldiskfs/zfs filesystem"
 
 test_3 () {
-       [ -z "$CLIENTS" ] && skip_env "CLIENTS not defined, skipping"
        [ -z "$MPIRUN" ] && skip_env "MIPRUN not defined, skipping"
        [ -z "$MDSRATE" ] && skip_env "MDSRATE not defined, skipping"
        [ ! -x $MDSRATE ] && skip_env "$MDSRATE not built, skipping"
index 7973edb..ff913b7 100644 (file)
@@ -17,7 +17,6 @@ build_test_filter
 
 remote_mds_nodsh && skip "remote MDS with nodsh"
 
-[ -z "$CLIENTS" ] && skip_env "$TESTSUITE: Need two or more clients"
 [ $CLIENTCOUNT -lt 2 ] &&
        skip_env "$TESTSUITE: Need 2+ clients, have only $CLIENTCOUNT"
 
index 82dce37..6ab75f2 100644 (file)
@@ -26,7 +26,7 @@ build_test_filter
 remote_mds_nodsh && skip_env "remote MDS with nodsh"
 remote_ost_nodsh && skip_env "remote OST with nodsh"
 
-[ -z "$CLIENTS" -o $CLIENTCOUNT -lt 3 ] &&
+[$CLIENTCOUNT -lt 3 ] &&
        skip_env "need three or more clients"
 
 if [ -z "$SHARED_DIRECTORY" ] || ! check_shared_dir $SHARED_DIRECTORY; then
index cf1325b..34d9d51 100644 (file)
@@ -23,7 +23,7 @@ build_test_filter
 remote_mds_nodsh && skip_env "remote MDS with nodsh" && exit 0
 remote_ost_nodsh && skip_env "remote OST with nodsh" && exit 0
 
-[ -z "$CLIENTS" -o $CLIENTCOUNT -lt 3 ] &&
+[ $CLIENTCOUNT -lt 3 ] &&
     skip_env "need three or more clients" && exit 0
 
 if [ -z "$SHARED_DIRECTORY" ] || ! check_shared_dir $SHARED_DIRECTORY; then
index c3b2d4e..f1116d6 100644 (file)
@@ -27,7 +27,7 @@ build_test_filter
 remote_mds_nodsh && skip_env "remote MDS with nodsh" && exit 0
 remote_ost_nodsh && skip_env "remote OST with nodsh" && exit 0
 
-[ -z "$CLIENTS" -o $CLIENTCOUNT -lt 3 ] &&
+[ $CLIENTCOUNT -lt 3 ] &&
     skip_env "need three or more clients" && exit 0
 
 if [ -z "$SHARED_DIRECTORY" ] || ! check_shared_dir $SHARED_DIRECTORY; then
index dbaa788..8a0fefd 100755 (executable)
@@ -2793,7 +2793,6 @@ test_133() {
 run_test 133 "don't fail on flock resend"
 
 test_134() {
-       [ -z "$CLIENTS" ] && skip "Need two or more clients" && return
        [ $CLIENTCOUNT -lt 2 ] &&
                { skip "Need 2+ clients, have $CLIENTCOUNT" && return; }
 
index 6547a39..e6af26f 100755 (executable)
@@ -550,7 +550,6 @@ test_21b_sub () {
 }
 
 test_21b() {
-       [ -z "$CLIENTS" ] && skip "Need two or more clients" && return
        [ $CLIENTCOUNT -lt 2 ] &&
                { skip "Need 2+ clients, have $CLIENTCOUNT" && return; }
 
index db6eac3..a0ac037 100755 (executable)
@@ -2042,8 +2042,6 @@ at_cleanup
 
 # start multi-client tests
 test_70a () {
-       [ -z "$CLIENTS" ] &&
-               { skip "Need two or more clients." && return; }
        [ $CLIENTCOUNT -lt 2 ] &&
                { skip "Need two or more clients, have $CLIENTCOUNT" && return; }
 
@@ -2406,8 +2404,6 @@ test_70f_cleanup() {
 test_70f() {
 #      [ x$ost1failover_HOST = x$ost_HOST ] &&
 #              { skip "Failover host not defined" && return; }
-#      [ -z "$CLIENTS" ] &&
-#              { skip "CLIENTS are not specified." && return; }
 #      [ $CLIENTCOUNT -lt 2 ] &&
 #              { skip "Need 2 or more clients, have $CLIENTCOUNT" && return; }
 
index 7955f4c..4c0f697 100755 (executable)
@@ -1009,7 +1009,6 @@ test_10b() { # former test_2b
        local post
        local var=${SINGLEMDS}_svc
 
-       [ -n "$CLIENTS" ] || { skip "Need two or more clients" && exit 0; }
        [ $CLIENTCOUNT -ge 2 ] || \
                { skip "Need two or more clients, have $CLIENTCOUNT" && \
                        exit 0; }
index 197ac87..160a234 100755 (executable)
@@ -993,7 +993,6 @@ print_jbd_stat () {
 test_33a() {
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
 
-       [ -z "$CLIENTS" ] && skip "Need two or more clients, have $CLIENTS"
        [ $CLIENTCOUNT -lt 2 ] &&
                skip "Need two or more clients, have $CLIENTCOUNT"
 
@@ -1044,7 +1043,6 @@ run_test 33a "commit on sharing, cross crete/delete, 2 clients, benchmark"
 test_33b() {
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
 
-       [ -n "$CLIENTS" ] || { skip "Need two or more clients" && return 0; }
        [ $CLIENTCOUNT -ge 2 ] ||
                { skip "Need two or more clients, have $CLIENTCOUNT" &&
                                                                return 0; }
@@ -1200,7 +1198,6 @@ test_33d() {
 run_test 33d "DNE distributed operation should trigger COS"
 
 test_33e() {
-       [ -n "$CLIENTS" ] || skip "Need two or more clients"
        [ $CLIENTCOUNT -ge 2 ] ||
                skip "Need two or more clients, have $CLIENTCOUNT"
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
index 2776488..1f7c6a3 100755 (executable)
@@ -7203,20 +7203,23 @@ init_clients_lists () {
     # Sanity check: exclude the dup entries
     RCLIENTS=$(for i in ${rclients//,/ }; do echo $i; done | sort -u)
 
-    clients="$SINGLECLIENT $HOSTNAME $RCLIENTS"
+       export CLIENT1=${CLIENT1:-$HOSTNAME}
+       export SINGLECLIENT=$CLIENT1
+
+       clients="$SINGLECLIENT $HOSTNAME $RCLIENTS"
 
     # Sanity check: exclude the dup entries from CLIENTS
     # for those configs which has SINGLCLIENT set to local client
     clients=$(for i in $clients; do echo $i; done | sort -u)
 
-    CLIENTS=$(comma_list $clients)
+       export CLIENTS=$(comma_list $clients)
     local -a remoteclients=($RCLIENTS)
     for ((i=0; $i<${#remoteclients[@]}; i++)); do
             varname=CLIENT$((i + 2))
-            eval $varname=${remoteclients[i]}
+                       eval export $varname=${remoteclients[i]}
     done
 
-    CLIENTCOUNT=$((${#remoteclients[@]} + 1))
+       export CLIENTCOUNT=$((${#remoteclients[@]} + 1))
 }
 
 get_random_entry () {