Whamcloud - gitweb
LU-12597 tests: remove comma_list for OSTs part 1 44/56844/2
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 9 Mar 2024 21:38:35 +0000 (14:38 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 2 Jan 2025 20:49:36 +0000 (20:49 +0000)
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 <adilger@whamcloud.com>
Change-Id: I01509872350987564ca560ad93fdaba0413ebbe5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56844
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/tests/lfsck-performance.sh
lustre/tests/lnet-selftest.sh
lustre/tests/mds-survey.sh

index d993b57..780e4d3 100755 (executable)
@@ -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
 }
index b3c343e..0fba8f9 100644 (file)
@@ -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
 }
index cb0f45b..31a0e16 100755 (executable)
@@ -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
index cf83b44..e3ae854 100644 (file)
@@ -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"
 }