From f2642a2947d1fc109c70aadbc86c6510df9b8a34 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 9 Mar 2024 14:49:55 -0700 Subject: [PATCH] LU-12597 tests: remove comma_list for MDTs part 1 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: I31509872350987564ca560ad93fdaba0443ebbe5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57183 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 9 +++------ lustre/tests/dom-performance.sh | 2 +- lustre/tests/lfsck-performance.sh | 10 ++++------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index f38ccf9..c0585d7 100755 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -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. diff --git a/lustre/tests/dom-performance.sh b/lustre/tests/dom-performance.sh index ebcb4c9..8e2ef09 100644 --- a/lustre/tests/dom-performance.sh +++ b/lustre/tests/dom-performance.sh @@ -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 diff --git a/lustre/tests/lfsck-performance.sh b/lustre/tests/lfsck-performance.sh index 0fba8f9..cb028ed 100644 --- a/lustre/tests/lfsck-performance.sh +++ b/lustre/tests/lfsck-performance.sh @@ -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" -- 1.8.3.1