Whamcloud - gitweb
TT-59 remove . and - from the node name
authorsarah <sarah@whamcloud.com>
Fri, 20 May 2011 04:52:39 +0000 (21:52 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 26 May 2011 16:12:55 +0000 (09:12 -0700)
Replace . and - with _ in the node name, so it can be identified
as a variable in bash.

Change-Id: I0ae9c8225f9181a5b374fdb3c6316e47f2569ef1
Signed-off-by: sarah <sarah@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/376
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Chris Gearing <chris@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/recovery-double-scale.sh
lustre/tests/recovery-mds-scale.sh
lustre/tests/recovery-random-scale.sh
lustre/tests/replay-vbr.sh
lustre/tests/sgpdd-survey.sh
lustre/tests/test-framework.sh

index 0aeb321..72b6d3c 100644 (file)
@@ -209,7 +209,7 @@ summary_and_cleanup () {
         # actually failed though.  the first node in the END_RUN_NODE is
         # the one we are really interested in.
         if [ -n "$END_RUN_NODE" ]; then
-            var=$(client_var_name $END_RUN_NODE)_load
+            var=$(node_var_name $END_RUN_NODE)_load
             echo "Client load failed on node $END_RUN_NODE"
             echo
             echo "client $END_RUN_NODE load debug output :"
index 97a1431..3ebe05b 100644 (file)
@@ -119,7 +119,7 @@ summary_and_cleanup () {
     # actually failed though.  the first node in the END_RUN_NODE is
     # the one we are really interested in.
         if [ -n "$END_RUN_NODE" ]; then
-            var=$(client_var_name $END_RUN_NODE)_load
+            var=$(node_var_name $END_RUN_NODE)_load
             echo "Client load failed on node $END_RUN_NODE" 
             echo
             echo "client $END_RUN_NODE load stdout and debug files :
index 7cf84b5..b977b9c 100644 (file)
@@ -123,7 +123,7 @@ summary_and_cleanup () {
     # actually failed though.  the first node in the END_RUN_NODE is
     # the one we are really interested in.
         if [ -n "$END_RUN_NODE" ]; then
-            var=$(client_var_name $END_RUN_NODE)_load
+            var=$(node_var_name $END_RUN_NODE)_load
             echo "Client load failed on node $END_RUN_NODE"
             echo
             echo "client $END_RUN_NODE load stdout and debug files :
@@ -222,7 +222,7 @@ while [ $ELAPSED -lt $DURATION -a ! -e $END_RUN_FILE ]; do
     it_time_start=$(date +%s)
     
     FAIL_CLIENT=$(get_random_entry $NODES_TO_USE)
-    client_var=$(client_var_name $FAIL_CLIENT)_nums
+    client_var=$(node_var_name $FAIL_CLIENT)_nums
 
     # store the list of failed clients
     # lists are comma separated
index e1af41b..a5a71ec 100644 (file)
@@ -61,17 +61,17 @@ rmultiop_start() {
     local multiop_pid
     multiop_pid=$(do_node $client cat $pid_file)
     [ -n "$multiop_pid" ] || error "$client : Can not get multiop_pid from $pid_file "
-    eval export $(client_var_name $client)_multiop_pid=$multiop_pid
-    eval export $(client_var_name $client)_do_node_pid=$pid
-    local var=$(client_var_name $client)_multiop_pid
+    eval export $(node_var_name $client)_multiop_pid=$multiop_pid
+    eval export $(node_var_name $client)_do_node_pid=$pid
+    local var=$(node_var_name $client)_multiop_pid
     echo client $client multiop_bg started multiop_pid=${!var}
     return $?
 }
 
 rmultiop_stop() {
     local client=$1
-    local multiop_pid=$(client_var_name $client)_multiop_pid
-    local do_node_pid=$(client_var_name $client)_do_node_pid
+    local multiop_pid=$(node_var_name $client)_multiop_pid
+    local do_node_pid=$(node_var_name $client)_do_node_pid
 
     echo "Stopping multiop_pid=${!multiop_pid} (kill ${!multiop_pid} on $client)"
     do_node $client kill -USR1 ${!multiop_pid}
index 3b27420..ac5da4d 100644 (file)
@@ -46,13 +46,13 @@ run_sgpdd_facets () {
     for facet in ${facets//,/ }; do
         local host=$(facet_host $facet)
         local dev=${facet}_dev
-        local var=${host}_devs
+        local var=$(node_var_name ${host}_devs)
         eval ${var}=$(expand_list ${!var} ${!dev})
         facetshosts=$(expand_list $facetshosts $host)
     done
 
     for host in ${facetshosts//,/ }; do
-        var=${host}_devs
+        var=$(node_var_name ${host}_devs)
         echo "=== $facets === $host === ${!var} ==="
         local scsidevs=${!var}
         run_sgpdd_host $host ${scsidevs}
index 92f4c4f..d9c6d13 100644 (file)
@@ -1028,14 +1028,14 @@ check_progs_installed () {
 }
 
 # recovery-scale functions
-client_var_name() {
-    echo __$(echo $1 | tr '-' 'X')
+node_var_name() {
+    echo __$(echo $1 | tr '-' '_' | tr '.' '_')
 }
 
 start_client_load() {
     local client=$1
     local load=$2
-    local var=$(client_var_name $client)_load
+    local var=$(node_var_name $client)_load
     eval export ${var}=$load
 
     do_node $client "PATH=$PATH MOUNT=$MOUNT ERRORS_OK=$ERRORS_OK \
@@ -1066,7 +1066,7 @@ start_client_loads () {
 # only for remote client 
 check_client_load () {
     local client=$1
-    local var=$(client_var_name $client)_load
+    local var=$(node_var_name $client)_load
     local TESTLOAD=run_${!var}.sh
 
     ps auxww | grep -v grep | grep $client | grep -q "$TESTLOAD" || return 1
@@ -1140,7 +1140,7 @@ restart_client_loads () {
         check_client_load $client
         rc=${PIPESTATUS[0]}
         if [ "$rc" != 0 -a "$expectedfail" ]; then
-            local var=$(client_var_name $client)_load
+            local var=$(node_var_name $client)_load
             start_client_load $client ${!var}
             echo "Restarted client load ${!var}: on $client. Checking ..."
             check_client_load $client