Whamcloud - gitweb
b=16264
authorgrev <grev>
Fri, 1 Aug 2008 18:46:57 +0000 (18:46 +0000)
committergrev <grev>
Fri, 1 Aug 2008 18:46:57 +0000 (18:46 +0000)
i=Adilger
new t-f init clients list fn

lustre/tests/cfg/ncli.sh
lustre/tests/test-framework.sh

index 6dfae9b..ce2a649 100644 (file)
@@ -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
index 321d8f3..b60ac0e 100644 (file)
@@ -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