Whamcloud - gitweb
LU-17913 iokit: Fix lst.sh host mode 43/55343/2
authorChris Horn <chris.horn@hpe.com>
Thu, 6 Jun 2024 20:55:08 +0000 (14:55 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Jun 2024 01:17:00 +0000 (01:17 +0000)
The ssh command used to get primary NIDs of each test node uses a
single quote. This prevents the LCTL variable from being expanded
so the command fails. Use double quotes around this command and
make sure we return an error (non-zero) status when we are unable
to determine primary NIDs of test nodes.

Test-Parameters: trivial testlist=sanity-lnet
Fixes: c265e1c7b0 ("LU-16861 obdfilter: Exclude quotes when getting NIDs")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: Ic17d8a22baf93e205c6d7e12a0079f93222013e3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55343
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre-iokit/lst-survey/lst.sh

index f9d8dc1..3a050a4 100755 (executable)
@@ -288,20 +288,20 @@ if ${HOST_MODE}; then
        idx=0
        opts=( -o NumberOfPasswordPrompts=0 -o ConnectTimeout=5 )
        for host in ${SERVERS//,/ }; do
-               s_nids[idx]=$(ssh "${opts[@]}" "$host" '$LCTL list_nids | head -n 1')
+               s_nids[idx]=$(ssh "${opts[@]}" "$host" "$LCTL list_nids | head -n 1")
                if [[ -z ${s_nids[idx]} ]]; then
                        echo "Failed to determine primary NID of $host"
-                       exit
+                       exit 1
                fi
                idx=$((idx + 1))
        done
 
        idx=0
        for host in ${CLIENTS//,/ }; do
-               c_nids[idx]=$(ssh "${opts[@]}" "${host}" '$LCTL list_nids | head -n 1')
+               c_nids[idx]=$(ssh "${opts[@]}" "${host}" "$LCTL list_nids | head -n 1")
                if [[ -z ${c_nids[idx]} ]]; then
                        echo "Failed to determine primary NID of $host"
-                       exit
+                       exit 1
                fi
                idx=$((idx + 1))
        done