From b594948509f42859565d3ac141621b0f35d806d2 Mon Sep 17 00:00:00 2001 From: sarah Date: Thu, 19 May 2011 21:52:39 -0700 Subject: [PATCH] TT-59 remove . and - from the node name Replace . and - with _ in the node name, so it can be identified as a variable in bash. Change-Id: I0ae9c8225f9181a5b374fdb3c6316e47f2569ef1 Signed-off-by: sarah Reviewed-on: http://review.whamcloud.com/376 Reviewed-by: Lai Siyao Reviewed-by: Chris Gearing Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/tests/recovery-double-scale.sh | 2 +- lustre/tests/recovery-mds-scale.sh | 2 +- lustre/tests/recovery-random-scale.sh | 4 ++-- lustre/tests/replay-vbr.sh | 10 +++++----- lustre/tests/sgpdd-survey.sh | 4 ++-- lustre/tests/test-framework.sh | 10 +++++----- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lustre/tests/recovery-double-scale.sh b/lustre/tests/recovery-double-scale.sh index 0aeb321..72b6d3c 100644 --- a/lustre/tests/recovery-double-scale.sh +++ b/lustre/tests/recovery-double-scale.sh @@ -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 :" diff --git a/lustre/tests/recovery-mds-scale.sh b/lustre/tests/recovery-mds-scale.sh index 97a1431..3ebe05b 100644 --- a/lustre/tests/recovery-mds-scale.sh +++ b/lustre/tests/recovery-mds-scale.sh @@ -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 : diff --git a/lustre/tests/recovery-random-scale.sh b/lustre/tests/recovery-random-scale.sh index 7cf84b5..b977b9c 100644 --- a/lustre/tests/recovery-random-scale.sh +++ b/lustre/tests/recovery-random-scale.sh @@ -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 diff --git a/lustre/tests/replay-vbr.sh b/lustre/tests/replay-vbr.sh index e1af41b..a5a71ec 100644 --- a/lustre/tests/replay-vbr.sh +++ b/lustre/tests/replay-vbr.sh @@ -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} diff --git a/lustre/tests/sgpdd-survey.sh b/lustre/tests/sgpdd-survey.sh index 3b27420..ac5da4d 100644 --- a/lustre/tests/sgpdd-survey.sh +++ b/lustre/tests/sgpdd-survey.sh @@ -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} diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 92f4c4f..d9c6d13 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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 -- 1.8.3.1