Whamcloud - gitweb
LU-12597 tests: remove comma_list for MDTs part 1 83/57183/3
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 9 Mar 2024 21:49:55 +0000 (14:49 -0700)
committerOleg Drokin <green@whamcloud.com>
Sun, 2 Feb 2025 06:27:00 +0000 (06:27 +0000)
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 <adilger@whamcloud.com>
Change-Id: I31509872350987564ca560ad93fdaba0443ebbe5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57183
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/dom-performance.sh
lustre/tests/lfsck-performance.sh

index f38ccf9..c0585d7 100755 (executable)
@@ -5636,8 +5636,7 @@ test_56b() {
        start_ost || error "Unable to start first ost"
        start_ost2 || error "Unable to start second ost"
 
-       do_nodes $(comma_list $(mdts_nodes)) \
-               "$LCTL set_param mdt.*.enable_remote_dir=1 \
+       do_nodes $(mdts_nodes) "$LCTL set_param mdt.*.enable_remote_dir=1 \
                mdt.*.enable_remote_dir_gid=-1"
 
        mount_client $MOUNT || error "Unable to mount client"
@@ -7484,8 +7483,7 @@ test_82a() { # LU-4665
        done
 
        # Collect debug information - start of test
-       do_nodes $(comma_list $(mdts_nodes)) \
-                  $LCTL get_param osp.*.prealloc_*_id
+       do_nodes $(mdts_nodes) "$LCTL get_param osp.*.prealloc_*_id"
 
        mount_client $MOUNT || error "mount client $MOUNT failed"
        wait_osts_up
@@ -7494,8 +7492,7 @@ test_82a() { # LU-4665
        check_lfs_df_ret_val $? || error "$LFS df $MOUNT failed"
        mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed"
 
-       stack_trap "do_nodes $(comma_list $(mdts_nodes)) \
-                  $LCTL get_param osp.*.prealloc_*_id || true" EXIT
+       stack_trap "do_nodes $(mdts_nodes) $LCTL get_param osp.*.prealloc_*_id"
 
        # 1. If the file does not exist, new file will be created
        #    with specified OSTs.
index ebcb4c9..8e2ef09 100644 (file)
@@ -374,7 +374,7 @@ run_compbench() {
 dp_test_run() {
        local test=$1
        local facets=$(get_facets MDS)
-       local nodes=$(comma_list $(mdts_nodes))
+       local nodes=$(mdts_nodes)
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
 
        save_lustre_params $facets "mdt.*.dom_lock" >> $p
index 0fba8f9..cb028ed 100644 (file)
@@ -857,6 +857,7 @@ namespace_gen_set() {
 t7_test() {
        local local_loc=$1
        local saved_mdscount=$MDSCOUNT
+       local mdts=$(mdts_nodes)
 
        [ $MDSCOUNT -le 8 ] ||
                error "Too much MDT, test data set on each MDT may be unbalance"
@@ -871,8 +872,7 @@ t7_test() {
                echo "+++++ Start cycle mdscount=$MDSCOUNT at: $(date) +++++"
                echo
 
-               for ((j = $MINSUBDIR; j <= $MAXSUBDIR;
-                     j = $((j + MINSUBDIR)))); do
+               for ((j = $MINSUBDIR; j <= $MAXSUBDIR; j += MINSUBDIR)); do
                        echo "formatall"
                        formatall > /dev/null ||
                                error "(2) Fail to formatall, subdirs=${j}"
@@ -887,8 +887,7 @@ t7_test() {
                        $LFS setstripe -c 1 -i -1 $LFSCKDIR ||
                                error "(5) Fail to setstripe on $LFSCKDIR"
 
-                       do_nodes $(comma_list $(mdts_nodes)) \
-                               $LCTL set_param fail_loc=$local_loc
+                       do_nodes $mdts $LCTL set_param fail_loc=$local_loc
 
                        local RC=0
                        namespace_gen_set ${j} || RC=$?
@@ -900,8 +899,7 @@ t7_test() {
                        [ $RC -eq 0 ] ||
                                error "(7) LFSCK failed with $RC, subdirs=${j}"
 
-                       do_nodes $(comma_list $(mdts_nodes)) \
-                               $LCTL set_param fail_loc=0
+                       do_nodes $mdts $LCTL set_param fail_loc=0
                done
 
                echo "stopall"