# 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 :"
# 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 :
# 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 :
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
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}
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}
}
# 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 \
# 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
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