From 49206900aad567bf7e8c6f466943c1283c4f8e5d Mon Sep 17 00:00:00 2001 From: grev <grev> Date: Fri, 1 Aug 2008 18:46:57 +0000 Subject: [PATCH] b=16264 i=Adilger new t-f init clients list fn --- lustre/tests/cfg/ncli.sh | 8 +------- lustre/tests/test-framework.sh | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lustre/tests/cfg/ncli.sh b/lustre/tests/cfg/ncli.sh index 6dfae9b18b..ce2a6498b9 100644 --- a/lustre/tests/cfg/ncli.sh +++ b/lustre/tests/cfg/ncli.sh @@ -3,14 +3,8 @@ CLIENT1=${CLIENT1:-`hostname`} SINGLECLIENT=$CLIENT1 RCLIENTS=${RCLIENTS:-""} -CLIENTS=`comma_list $SINGLECLIENT $RCLIENTS` -REMOTECLIENTS=($RCLIENTS) -for ((i=0; $i<${#REMOTECLIENTS[@]}; i++)); do - varname=CLIENT$((i + 2)) - eval $varname=${REMOTECLIENTS[i]} -done -CLIENTCOUNT=$((${#REMOTECLIENTS[@]} + 1)) +init_clients_lists [ -n "$RCLIENTS" -a "$PDSH" = "no_dsh" ] && \ error "tests for remote clients $RCLIENTS needs pdsh != do_dsh " || true diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 321d8f3d2a..b60ac0e187 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1806,6 +1806,29 @@ nodes_list () { echo $myNODES_sort } +init_clients_lists () { + # Sanity check: exclude the local client from RCLIENTS + local rclients=$(echo " $RCLIENTS " | sed -re "s/\s+$HOSTNAME\s+/ /g") + + # Sanity check: exclude the dup entries + rclients=$(for i in $rclients; do echo $i; done | sort -u) + + local clients="$SINGLECLIENT $HOSTNAME $rclients" + + # Sanity check: exclude the dup entries from CLIENTS + # for those configs which has SINGLCLIENT set to local client + clients=$(for i in $clients; do echo $i; done | sort -u) + + CLIENTS=`comma_list $clients` + local -a remoteclients=($rclients) + for ((i=0; $i<${#remoteclients[@]}; i++)); do + varname=CLIENT$((i + 2)) + eval $varname=${remoteclients[i]} + done + + CLIENTCOUNT=$((${#remoteclients[@]} + 1)) +} + is_patchless () { lctl get_param version | grep -q patchless -- GitLab