From: Andreas Dilger Date: Wed, 9 Oct 2024 21:48:06 +0000 (-0600) Subject: LU-12597 tests: remove comma_list for MDTs part 3 X-Git-Tag: 2.16.52~33 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ceee271cddc3a911a54415d7e5a125c25e6ab35b;p=fs%2Flustre-release.git LU-12597 tests: remove comma_list for MDTs part 3 Most places that use $(mdts_nodes) also call $(comma_list ...) at the same time. Rather than returning a space-separated list of nodes from those functions, instead return a comma-separated list suitable for use by do_nodes() and similar functions calling pdsh internally. This avoids the repeated calls to comma_list() and makes the tests easier to read. Also, since comma_list() internally deduplicates the node list, it isn't necessary to do that in the callers. A few tests need to convert comma-separated osts_nodes into space-separated nodes. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: I33509872350987564ca560ad93fdaba0443ebbe5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57326 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-krb5.sh b/lustre/tests/sanity-krb5.sh index f92ee45..bd313d5 100755 --- a/lustre/tests/sanity-krb5.sh +++ b/lustre/tests/sanity-krb5.sh @@ -302,6 +302,7 @@ test_5() { local file2=$DIR/$tdir/$tfile-2 local file3=$DIR/$tdir/$tfile-3 local wait_time=$((TIMEOUT + TIMEOUT / 2)) + local mdts=$(mdts_nodes) mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed" chmod 0777 $DIR/$tdir || error "chmod $DIR/$tdir failed" @@ -314,9 +315,9 @@ test_5() { $RUNAS $LFS flushctx $MOUNT || error "can't flush context (1)" # stop lsvcgssd - send_sigint $(comma_list $(mdts_nodes)) $LSVCGSSD + send_sigint $mdts $LSVCGSSD sleep 5 - check_gss_daemon_nodes $(comma_list $(mdts_nodes)) $LSVCGSSD && + check_gss_daemon_nodes $mdts $LSVCGSSD && error "$LSVCGSSD still running (1)" # daemon should restart automatically, at least on newer servers @@ -335,16 +336,16 @@ test_5() { fi # stop lsvcgssd - send_sigint $(comma_list $(mdts_nodes)) $LSVCGSSD + send_sigint $mdts $LSVCGSSD sleep 5 - check_gss_daemon_nodes $(comma_list $(mdts_nodes)) $LSVCGSSD && + check_gss_daemon_nodes $mdts $LSVCGSSD && error "$LSVCGSSD still running (2)" # restart lsvcgssd, expect touch succeed echo "restart $LSVCGSSD and recovering" - start_gss_daemons $(comma_list $(mdts_nodes)) $LSVCGSSD "-vvv" + start_gss_daemons $mdts $LSVCGSSD "-vvv" sleep 5 - check_gss_daemon_nodes $(comma_list $(mdts_nodes)) $LSVCGSSD + check_gss_daemon_nodes $mdts $LSVCGSSD $RUNAS touch $file3 || error "should not fail now" [ -f $file3 ] || error "$file3 not found" } diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh index 0990236..36217cd 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -1236,7 +1236,7 @@ init_router_test_vars() { local rnodes_required ((rnodes_required=routers_required+rpeers_required)) # all remote nodes, including some that may not be used - local rnodes_all=( $(remote_nodes_list) ) + local rnodes_all=( $(remote_nodes_list | tr ',' ' ') ) [[ -z $rnodes_all || "${#rnodes_all[@]}" -lt $rnodes_required ]] && skip "Need at least $rnodes_required remote nodes" \ "found \"${rnodes_all[@]}\"" @@ -2033,7 +2033,7 @@ setup_health_test() { LNIDS=( $($LCTL list_nids | xargs echo) ) - RNODE=$(awk '{print $1}' <<<$rnodes) + RNODE=(${rnodes//,/ }) RNIDS=( $(do_node $RNODE $LCTL list_nids | xargs echo) ) if [[ -z ${RNIDS[@]} ]]; then @@ -2691,7 +2691,7 @@ test_212() { [[ -z $my_nid ]] && error "Failed to get primary NID for local host $HOSTNAME" - local rnode=$(awk '{print $1}' <<<$rnodes) + local rnode=(${rnodes//,/ }) local rnodenids=$(do_node $rnode $LCTL list_nids | xargs echo) local rloaded=false diff --git a/lustre/tests/sanity-lsnapshot.sh b/lustre/tests/sanity-lsnapshot.sh index 8aa21c1..b05d45c 100755 --- a/lustre/tests/sanity-lsnapshot.sh +++ b/lustre/tests/sanity-lsnapshot.sh @@ -28,7 +28,7 @@ require_dsh_ost || exit 0 check_and_setup_lustre do_facet mgs $LCTL set_param debug=+snapshot -do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param debug=+snapshot +do_nodes $(mdts_nodes) "$LCTL set_param debug=+snapshot" lss_gen_conf lss_cleanup @@ -374,7 +374,7 @@ run_test 4 "create/delete snapshot after MGS remount" lss_cleanup do_facet mgs $LCTL set_param debug=-snapshot -do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param debug=-snapshot +do_nodes $(mdts_nodes) "$LCTL set_param debug=-snapshot" complete_test $SECONDS check_and_cleanup_lustre exit_status