From 6ea69c3e52923048f837f17160f2984f7596ccde Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 9 Mar 2024 14:38:35 -0700 Subject: [PATCH] LU-12597 tests: remove comma_list for OSTs part 1 Most places that use $(osts_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: I01509872350987564ca560ad93fdaba0413ebbe5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56844 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 19 +++++++++---------- lustre/tests/lfsck-performance.sh | 4 ++-- lustre/tests/lnet-selftest.sh | 2 +- lustre/tests/mds-survey.sh | 7 ++----- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index d993b57..780e4d3 100755 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -4107,7 +4107,7 @@ test_41b() { run_test 41b "mount mds with --nosvc and --nomgs on first mount" test_41c() { - local oss_list=$(comma_list $(osts_nodes)) + local osts=$(osts_nodes) (( "$MDS1_VERSION" >= $(version_code 2.15.62.4) )) || skip "Need MDS >= 2.15.62.4 for parallel device locking" @@ -4170,7 +4170,7 @@ test_41c() { # OST concurrent start - do_rpc_nodes $oss_list "lsmod | grep -q libcfs" || + do_rpc_nodes $osts "lsmod | grep -q libcfs" || error "OST concurrent start: libcfs module not loaded" local ost1dev=$(ostdevname 1) @@ -6204,8 +6204,8 @@ test_69() { setup mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed" - do_nodes $(comma_list $(osts_nodes)) $LCTL set_param \ - seq.*OST*-super.width=$DATA_SEQ_MAX_WIDTH + do_nodes $(osts_nodes) \ + $LCTL set_param seq.*OST*-super.width=$DATA_SEQ_MAX_WIDTH # use OST0000 since it probably has the most creations local OSTNAME=$(ostname_from_index 0) @@ -8780,8 +8780,8 @@ test_101a() { setup mkdir_on_mdt0 $DIR1/$tdir - do_nodes $(comma_list $(osts_nodes)) $LCTL set_param \ - seq.*OST*-super.width=$DATA_SEQ_MAX_WIDTH + do_nodes $(osts_nodes) \ + $LCTL set_param seq.*OST*-super.width=$DATA_SEQ_MAX_WIDTH createmany -o $DIR1/$tdir/$tfile-%d 50000 & createmany_pid=$! # MDT->OST reconnection causes MDT<->OST last_id synchornisation @@ -9112,8 +9112,8 @@ test_106() { setup_noconfig lfs df -i mkdir -p $DIR/$tdir || error "create $tdir failed" - do_nodes $(comma_list $(osts_nodes)) $LCTL set_param \ - seq.*OST*-super.width=$DATA_SEQ_MAX_WIDTH + do_nodes $(osts_nodes) \ + $LCTL set_param seq.*OST*-super.width=$DATA_SEQ_MAX_WIDTH lfs setstripe -c 1 -i 0 $DIR/$tdir #define OBD_FAIL_CAT_RECORDS 0x1312 do_facet mds1 $LCTL set_param fail_loc=0x1312 fail_val=$repeat @@ -9898,13 +9898,12 @@ cleanup_113() { # Error out with mount info error_113() { - local server_nodes=$(comma_list $(mdts_nodes) $(osts_nodes)) local err=$1 echo "--Client Mount Info--" mount | grep -i lustre echo "--Server Mount Info--" - do_nodes $server_nodes mount | grep -i lustre + do_nodes $(tgts_nodes) mount | grep -i lustre error $err } diff --git a/lustre/tests/lfsck-performance.sh b/lustre/tests/lfsck-performance.sh index b3c343e..0fba8f9 100644 --- a/lustre/tests/lfsck-performance.sh +++ b/lustre/tests/lfsck-performance.sh @@ -482,7 +482,7 @@ run_test 4a "Single MDS lfsck layout performance (routine case) without load" test_4b() { echo "Inject failure stub to simulate dangling reference" #define OBD_FAIL_LFSCK_DANGLING 0x1610 - do_nodes $(comma_list $(osts_nodes)) $LCTL set_param fail_loc=0x1610 + do_nodes $(osts_nodes) "$LCTL set_param fail_loc=0x1610" t4_test } @@ -559,7 +559,7 @@ run_test 5a "lfsck layout performance (routine case) without load for DNE" test_5b() { echo "Inject failure stub to simulate dangling reference" #define OBD_FAIL_LFSCK_DANGLING 0x1610 - do_nodes $(comma_list $(osts_nodes)) $LCTL set_param fail_loc=0x1610 + do_nodes $(osts_nodes) "$LCTL set_param fail_loc=0x1610" t5_test } diff --git a/lustre/tests/lnet-selftest.sh b/lustre/tests/lnet-selftest.sh index cb0f45b..31a0e16 100755 --- a/lustre/tests/lnet-selftest.sh +++ b/lustre/tests/lnet-selftest.sh @@ -43,7 +43,7 @@ esac LOAD_MODULES_REMOTE=true load_modules -nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)") +nodes=$(tgts_nodes) lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")} lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")} interim_umount=false diff --git a/lustre/tests/mds-survey.sh b/lustre/tests/mds-survey.sh index cf83b44..e3ae854 100644 --- a/lustre/tests/mds-survey.sh +++ b/lustre/tests/mds-survey.sh @@ -56,7 +56,6 @@ adjust_inode() { file_count=$(adjust_inode) -ost_count=$($LCTL dl | grep -c osc) # first unmount all the lustre clients cleanup_mount $MOUNT @@ -115,10 +114,8 @@ test_1() { run_test 1 "Metadata survey with zero-stripe" test_2() { - local mdscount=$(get_node_count "$(mdts_nodes)") - - [ $mdscount -gt 1 ] && skip_env "Only run this test on single MDS" - [ $ost_count -eq 0 ] && skip_env "Need to mount OST to test" + (( $MDSCOUNT == 1 )) || skip_env "Only run this test on single MDS" + $LCTL dl | grep -q osc || skip_env "need local client mount" mds_survey_run "mdd" "1" } -- 1.8.3.1