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>
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