diff options
author | wangyaoguang <sunshine.wang@huawei.com> | 2016-04-26 10:13:59 +0800 |
---|---|---|
committer | wangyaoguang <sunshine.wang@huawei.com> | 2016-04-26 11:27:54 +0800 |
commit | fc3e423277087d08fa19cb1beb43a53e6a32f427 (patch) | |
tree | ddd7e845143c7ef27f4ed59fbfc209401588b8cf /testsuites/rubbos/puppet_manifests/internal | |
parent | 4488b9d07f45c54d81f44913c9f5ec6f9bfe6086 (diff) |
read rubbos parameters from a config file
JIRA: BOTTLENECK-68
Change-Id: I0387532f2e8f1d4f03689a42efa7fe745a303eb8
Signed-off-by: wangyaoguang <sunshine.wang@huawei.com>
Diffstat (limited to 'testsuites/rubbos/puppet_manifests/internal')
-rwxr-xr-x | testsuites/rubbos/puppet_manifests/internal/run_rubbos_internal.sh | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/testsuites/rubbos/puppet_manifests/internal/run_rubbos_internal.sh b/testsuites/rubbos/puppet_manifests/internal/run_rubbos_internal.sh index 12dc17a6..25ead251 100755 --- a/testsuites/rubbos/puppet_manifests/internal/run_rubbos_internal.sh +++ b/testsuites/rubbos/puppet_manifests/internal/run_rubbos_internal.sh @@ -50,6 +50,8 @@ webservers_arr= appservers_arr= dbservers_arr= all_agents_arr= +hostname_arr= +hostip_arr= # Other variables used in this script class_nodes= @@ -60,16 +62,53 @@ read_conf() { if [ ${#line} -gt 0 ] && [ ${line:0:1} != "#" ] && [ ${line:0:1} != "[" ];then line=(${line//=/ }) case ${line[0]} in + "controller" ) + e_arr=(${line[1]//:/ }) + controller_host=${e_arr[0]} + controller_ip=${e_arr[2]} + hostname_arr=("${hostname_arr[@]}" "${e_arr[0]}") + hostip_arr=("${hostip_arr[@]}" "${e_arr[2]}");; "client_servers" ) - client_servers=${line[1]};; + elems=(${line[1]//,/ }) + for e in "${elems[@]}";do + e_arr=(${e//:/ }) + client_servers=${client_servers}${e_arr[0]}"," + hostname_arr=("${hostname_arr[@]}" "${e_arr[0]}") + hostip_arr=("${hostip_arr[@]}" "${e_arr[1]}") + done + client_servers=${client_servers%,};; "web_servers" ) - web_servers=${line[1]};; + e_arr=(${line[1]//:/ }) + web_servers=${web_servers}${e_arr[0]}"," + hostname_arr=("${hostname_arr[@]}" "${e_arr[0]}") + hostip_arr=("${hostip_arr[@]}" "${e_arr[1]}") + web_servers=${e_arr[0]};; "app_servers" ) - app_servers=${line[1]};; + elems=(${line[1]//,/ }) + for e in "${elems[@]}";do + e_arr=(${e//:/ }) + app_servers=${app_servers}${e_arr[0]}"," + hostname_arr=("${hostname_arr[@]}" "${e_arr[0]}") + hostip_arr=("${hostip_arr[@]}" "${e_arr[1]}") + done + app_servers=${app_servers%,};; "cjdbc_controller" ) - cjdbc_controller=${line[1]};; - "database_servers" ) - database_servers=${line[1]};; + if [ "x"${line[1]} != "x" ]; then + e_arr=(${line[1]//:/ }) + hostname_arr=("${hostname_arr[@]}" "${e_arr[0]}") + hostip_arr=("${hostip_arr[@]}" "${e_arr[1]}") + cjdbc_controller=${e_arr[0]} + fi + ;; + "db_servers" ) + elems=(${line[1]//,/ }) + for e in "${elems[@]}";do + e_arr=(${e//:/ }) + database_servers=${database_servers}${e_arr[0]}"," + hostname_arr=("${hostname_arr[@]}" "${e_arr[0]}") + hostip_arr=("${hostip_arr[@]}" "${e_arr[1]}") + done + database_servers=${database_servers%,};; "database_port" ) database_port=${line[1]};; "db_username" ) @@ -102,6 +141,11 @@ read_conf() { fi echo "-------------Main conf info:----------" + i=1 + while [ $i -lt ${#hostname_arr[@]} ]; do + echo ${hostip_arr[$i]}" "${hostname_arr[$i]} + let i=i+1 + done echo "clients_arr: "${clients_arr[@]} echo "bench_client: "$bench_client echo "remote_client_servers: "$remote_client_servers |