Merge "Change PTL informatin in INFO"
[bottlenecks.git] / testsuites / rubbos / rubbos_scripts / 1-1-1 / scripts / run.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 set -x
12
13 cd /bottlenecks/rubbos/rubbos_scripts/1-1-1
14 source set_bottlenecks_rubbos_env.sh
15 cd /bottlenecks/rubbos/rubbos_scripts/1-1-1/scripts
16 # Transfer all sub scripts to target hosts
17 echo "*** scp scripts *************************************************"
18
19 scp_options="-o StrictHostKeyChecking=no -o BatchMode=yes"
20
21 scp $scp_options CONTROL_rubbos_exec.sh  $CONTROL_HOST:/tmp
22
23 if true; then
24 for script in BENCHMARK_rubbos_install.sh BENCHMARK_install.sh \
25               BENCHMARK_configure.sh BENCHMARK_uninstall.sh \
26               BENCHMARK_rubbos_uninstall.sh
27 do
28     scp $scp_options $script $BENCHMARK_HOST:/tmp
29 done
30 fi
31
32 if true; then
33 for i in {1..4}
34 do
35     for script in CLIENT${i}_rubbos_install.sh CLIENT${i}_install.sh \
36                   CLIENT${i}_configure.sh CLIENT${i}_uninstall.sh \
37                   CLIENT${i}_rubbos_uninstall.sh
38     do
39         CLIENT_HOST=`printenv CLIENT${i}_HOST`
40         scp $scp_options $script $CLIENT_HOST:/tmp
41     done
42 done
43 fi
44
45 if true; then
46 for script in HTTPD_install.sh HTTPD_rubbos_install.sh \
47               HTTPD_configure.sh HTTPD_ignition.sh \
48               HTTPD_stop.sh HTTPD_rubbos_uninstall.sh \
49               HTTPD_uninstall.sh
50 do
51     scp $scp_options $script $HTTPD_HOST:/tmp
52 done
53 fi
54
55 if true; then
56 for script in TOMCAT1_install.sh TOMCAT1_rubbos_install.sh \
57               TOMCAT1_configure.sh TOMCAT1_rubbosSL_configure.sh \
58               TOMCAT1_ignition.sh TOMCAT1_stop.sh \
59               TOMCAT1_rubbos_uninstall.sh TOMCAT1_uninstall.sh
60 do
61     scp $scp_options $script $TOMCAT1_HOST:/tmp
62 done
63 fi
64
65 if true; then
66 for script in MYSQL1_install.sh MYSQL1_rubbos_install.sh \
67               MYSQL1_configure.sh MYSQL1_reset.sh \
68               MYSQL1_ignition.sh MYSQL1_stop.sh \
69               MYSQL1_rubbos_uninstall.sh \
70               MYSQL1_uninstall.sh
71 do
72     scp $scp_options $script $MYSQL1_HOST:/tmp
73 done
74 fi
75
76 # Prepare software packages
77 echo "*** prepare software packages ***"
78 ./MYSQL1_pkg_prepare.sh
79 ./TOMCAT1_pkg_prepare.sh
80 ./HTTPD_pkg_prepare.sh
81 ./BENCHMARK_pkg_prepare.sh
82 for i in {1..4}
83 do
84     ./CLIENT${i}_pkg_prepare.sh
85 done
86
87 # Install and Configure and run Apache, Tomcat, CJDBC, and MySQL
88 echo "*** install scripts & configure & execute ***********************"
89
90 ssh root@$MYSQL1_HOST chmod 770 /tmp/MYSQL1_install.sh
91 ssh $MYSQL1_HOST /tmp/MYSQL1_install.sh
92
93 ssh root@$TOMCAT1_HOST chmod 770 /tmp/TOMCAT1_install.sh
94 ssh $TOMCAT1_HOST /tmp/TOMCAT1_install.sh
95
96 ssh root@$HTTPD_HOST chmod 770 /tmp/HTTPD_install.sh
97 ssh $HTTPD_HOST /tmp/HTTPD_install.sh
98
99 ssh root@$MYSQL1_HOST chmod 770 /tmp/MYSQL1_rubbos_install.sh
100 ssh $MYSQL1_HOST /tmp/MYSQL1_rubbos_install.sh
101
102 ssh root@$TOMCAT1_HOST chmod 770 /tmp/TOMCAT1_rubbos_install.sh
103 ssh $TOMCAT1_HOST /tmp/TOMCAT1_rubbos_install.sh
104
105 ssh root@$HTTPD_HOST chmod 770 /tmp/HTTPD_rubbos_install.sh
106 ssh $HTTPD_HOST /tmp/HTTPD_rubbos_install.sh
107
108 ssh root@$BENCHMARK_HOST chmod 770 /tmp/BENCHMARK_rubbos_install.sh
109 ssh $BENCHMARK_HOST /tmp/BENCHMARK_rubbos_install.sh
110
111 for i in {1..4}
112 do
113     CLIENT_HOST=`printenv CLIENT${i}_HOST`
114     ssh root@$CLIENT_HOST chmod 770 /tmp/CLIENT${i}_rubbos_install.sh
115     ssh $CLIENT_HOST /tmp/CLIENT${i}_rubbos_install.sh
116 done
117
118 ssh root@$BENCHMARK_HOST chmod 770 /tmp/BENCHMARK_install.sh
119 ssh $BENCHMARK_HOST /tmp/BENCHMARK_install.sh
120
121 for i in {1..4}
122 do
123     CLIENT_HOST=`printenv CLIENT${i}_HOST`
124     ssh root@$CLIENT_HOST chmod 770 /tmp/CLIENT${i}_install.sh
125     ssh $CLIENT_HOST /tmp/CLIENT${i}_install.sh
126 done
127
128 ssh root@$MYSQL1_HOST chmod 770 /tmp/MYSQL1_configure.sh
129 ssh $MYSQL1_HOST /tmp/MYSQL1_configure.sh &
130 sleep 60
131
132 ssh root@$TOMCAT1_HOST chmod 770 /tmp/TOMCAT1_configure.sh
133 ssh $TOMCAT1_HOST /tmp/TOMCAT1_configure.sh
134
135 ssh root@$HTTPD_HOST chmod 770 /tmp/HTTPD_configure.sh
136 ssh $HTTPD_HOST /tmp/HTTPD_configure.sh
137
138 ssh root@$BENCHMARK_HOST chmod 770 /tmp/BENCHMARK_configure.sh
139 ssh $BENCHMARK_HOST /tmp/BENCHMARK_configure.sh
140
141 for i in {1..4}
142 do
143     CLIENT_HOST=`printenv CLIENT${i}_HOST`
144     ssh root@$CLIENT_HOST chmod 770 /tmp/CLIENT${i}_configure.sh
145     ssh $CLIENT_HOST /tmp/CLIENT${i}_configure.sh
146 done
147
148 ssh root@$TOMCAT1_HOST chmod 770 /tmp/TOMCAT1_rubbosSL_configure.sh
149 ssh $TOMCAT1_HOST /tmp/TOMCAT1_rubbosSL_configure.sh
150
151 ssh $CONTROL_HOST /tmp/CONTROL_rubbos_exec.sh
152
153 set +x