From f81cc2134d8fae6ce3cdb8d413c846d691c7cc83 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Thu, 6 Jun 2024 14:55:08 -0600 Subject: [PATCH] LU-17913 iokit: Fix lst.sh host mode 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 Change-Id: Ic17d8a22baf93e205c6d7e12a0079f93222013e3 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55343 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre-iokit/lst-survey/lst.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre-iokit/lst-survey/lst.sh b/lustre-iokit/lst-survey/lst.sh index f9d8dc1..3a050a4 100755 --- a/lustre-iokit/lst-survey/lst.sh +++ b/lustre-iokit/lst-survey/lst.sh @@ -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 -- 1.8.3.1