OSDN Git Service

Change l7vsadm -V format
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7vsadm / l7vsadm-4-3-39.sh
1 #!/bin/bash
2 . ${SET_DEFAULT_CONF}
3
4 #Run http server
5 SorryServer1=SorryServer1
6 SorryServer1_ADDR=127.0.0.1
7 SorryServer1_PORT=50001
8 start_lighttpd -s $SorryServer1 -a $SorryServer1_ADDR -p $SorryServer1_PORT
9 if [ $? -ne 0 ]
10 then
11         echo "Test failed: start_lighttpd SorryServer1"
12         exit 1
13 fi
14
15 SorryServer2=SorryServer2
16 SorryServer2_ADDR=[::1]
17 SorryServer2_PORT=50002
18 start_lighttpd -s $SorryServer2 -a $SorryServer2_ADDR -p $SorryServer2_PORT -i
19 if [ $? -ne 0 ]
20 then
21         echo "Test failed: start_lighttpd SorryServer2"
22         exit 1
23 fi
24
25 #Add Service
26 $L7VSD
27 if [ $? -ne 0 ]
28 then
29         echo "Test failed: $L7VSD"
30         exit 1
31 fi
32 usleep 100000
33
34 $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -M
35 if [ $? -ne 0 ]
36 then
37         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -M"
38         exit 1
39 fi
40
41 $L7VSADM -A -t 127.0.0.1:40002 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} -M
42 if [ $? -ne 0 ]
43 then
44         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40002 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} -M"
45         exit 1
46 fi
47
48 $L7VSADM -A -t 127.0.0.1:40003 -m sessionless -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -T
49 if [ $? -ne 0 ]
50 then
51         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40003 -m sessionless -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -T"
52         exit 1
53 fi
54
55 $L7VSADM -A -t 127.0.0.1:40004 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} -T
56 if [ $? -ne 0 ]
57 then
58         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} -T"
59         exit 1
60 fi
61
62 RET=`$L7VSADM -V -n`
63 EXPECT="Layer-7 Virtual Server version 3.0.0
64 L7vsd Log Level:
65 Category                       Level
66 l7vsd_network                  warn
67 l7vsd_network_qos              warn
68 l7vsd_network_bandwidth        warn
69 l7vsd_network_num_connection   warn
70 l7vsd_network_access           warn
71 l7vsd_mainthread               warn
72 l7vsd_virtualservice           warn
73 l7vsd_virtualservice_thread    warn
74 l7vsd_session                  warn
75 l7vsd_session_thread           warn
76 l7vsd_realserver               warn
77 l7vsd_sorryserver              warn
78 l7vsd_module                   warn
79 l7vsd_replication              warn
80 l7vsd_replication_sendthread   warn
81 l7vsd_parameter                warn
82 l7vsd_logger                   warn
83 l7vsd_command                  warn
84 l7vsd_start_stop               warn
85 l7vsd_system                   warn
86 l7vsd_system_memory            warn
87 l7vsd_system_endpoint          warn
88 l7vsd_system_signal            warn
89 l7vsd_system_environment       warn
90 l7vsd_snmpagent                info
91 l7vsd_protocol                 warn
92 l7vsd_schedule                 warn
93
94 Replication Mode:
95 SINGLE
96
97 SNMPAgent:
98 Agent Status                   inactive
99 log trap status                none
100 log trap level                 none
101 cache update interval          none
102 start date                     none
103 last request date              none
104 last trap date                 none
105 total GET requests             none
106 total SET requests             none
107 total trap counts              none
108
109 Prot LocalAddress:Port ProtoMod Scheduler Protomod_opt_string
110   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
111 TCP 127.0.0.1:40001 sessionless rr --sorry-uri '/' --statistic 0
112   Bypass Settings:
113     Sorry Server                  127.0.0.1:50001 Masq
114     Max Connection                0
115     Sorry Flag                    off
116   SSL Settings:
117     SSL Config File               none
118   Logging Settings:
119     Access Log                    off
120     Access Log File               none
121     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
122   Socket Settings:
123     TCP_DEFER_ACCEPT              disable
124     TCP_NODELAY                   disable
125     TCP_CORK                      disable
126     TCP_QUICKACK                  disable
127   Throughput:
128     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
129     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
130   Statistics:
131     HTTP Total Requests           0
132     HTTP GET Requests             0
133     HTTP POST Requests            0
134 TCP 127.0.0.1:40002 sessionless rr --sorry-uri '/' --statistic 0
135   Bypass Settings:
136     Sorry Server                  [::1]:50002 Masq
137     Max Connection                0
138     Sorry Flag                    off
139   SSL Settings:
140     SSL Config File               none
141   Logging Settings:
142     Access Log                    off
143     Access Log File               none
144     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
145   Socket Settings:
146     TCP_DEFER_ACCEPT              disable
147     TCP_NODELAY                   disable
148     TCP_CORK                      disable
149     TCP_QUICKACK                  disable
150   Throughput:
151     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
152     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
153   Statistics:
154     HTTP Total Requests           0
155     HTTP GET Requests             0
156     HTTP POST Requests            0
157 TCP 127.0.0.1:40003 sessionless rr --sorry-uri '/' --statistic 0
158   Bypass Settings:
159     Sorry Server                  127.0.0.1:50001 Tproxy
160     Max Connection                0
161     Sorry Flag                    off
162   SSL Settings:
163     SSL Config File               none
164   Logging Settings:
165     Access Log                    off
166     Access Log File               none
167     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
168   Socket Settings:
169     TCP_DEFER_ACCEPT              disable
170     TCP_NODELAY                   disable
171     TCP_CORK                      disable
172     TCP_QUICKACK                  disable
173   Throughput:
174     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
175     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
176   Statistics:
177     HTTP Total Requests           0
178     HTTP GET Requests             0
179     HTTP POST Requests            0
180 TCP 127.0.0.1:40004 sessionless rr --sorry-uri '/' --statistic 0
181   Bypass Settings:
182     Sorry Server                  [::1]:50002 Tproxy
183     Max Connection                0
184     Sorry Flag                    off
185   SSL Settings:
186     SSL Config File               none
187   Logging Settings:
188     Access Log                    off
189     Access Log File               none
190     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
191   Socket Settings:
192     TCP_DEFER_ACCEPT              disable
193     TCP_NODELAY                   disable
194     TCP_CORK                      disable
195     TCP_QUICKACK                  disable
196   Throughput:
197     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
198     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
199   Statistics:
200     HTTP Total Requests           0
201     HTTP GET Requests             0
202     HTTP POST Requests            0"
203 if [ "${RET}" != "${EXPECT}" ]
204 then
205         echo "Test failed: $L7VSADM -V -n"
206         exit 1
207 fi
208
209 $L7VSADM -E -t 127.0.0.1:40001 -m sessionless -f 1
210 if [ $? -ne 0 ]
211 then
212         echo "Test failed: $L7VSADM -E -t 127.0.0.1:40001 -m sessionless -f 1"
213         exit 1
214 fi
215
216 $L7VSADM -E -t 127.0.0.1:40002 -m sessionless -f 1
217 if [ $? -ne 0 ]
218 then
219         echo "Test failed: $L7VSADM -E -t 127.0.0.1:40002 -m sessionless -f 1"
220         exit 1
221 fi
222
223 $L7VSADM -E -t 127.0.0.1:40003 -m sessionless -f 1
224 if [ $? -ne 0 ]
225 then
226         echo "Test failed: $L7VSADM -E -t 127.0.0.1:40003 -m sessionless -f 1"
227         exit 1
228 fi
229
230 $L7VSADM -E -t 127.0.0.1:40004 -m sessionless -f 1
231 if [ $? -ne 0 ]
232 then
233         echo "Test failed: $L7VSADM -E -t 127.0.0.1:40001 -m sessionless -f 1"
234         exit 1
235 fi
236
237 RET=`$L7VSADM -V -n`
238 EXPECT="Layer-7 Virtual Server version 3.0.0
239 L7vsd Log Level:
240 Category                       Level
241 l7vsd_network                  warn
242 l7vsd_network_qos              warn
243 l7vsd_network_bandwidth        warn
244 l7vsd_network_num_connection   warn
245 l7vsd_network_access           warn
246 l7vsd_mainthread               warn
247 l7vsd_virtualservice           warn
248 l7vsd_virtualservice_thread    warn
249 l7vsd_session                  warn
250 l7vsd_session_thread           warn
251 l7vsd_realserver               warn
252 l7vsd_sorryserver              warn
253 l7vsd_module                   warn
254 l7vsd_replication              warn
255 l7vsd_replication_sendthread   warn
256 l7vsd_parameter                warn
257 l7vsd_logger                   warn
258 l7vsd_command                  warn
259 l7vsd_start_stop               warn
260 l7vsd_system                   warn
261 l7vsd_system_memory            warn
262 l7vsd_system_endpoint          warn
263 l7vsd_system_signal            warn
264 l7vsd_system_environment       warn
265 l7vsd_snmpagent                info
266 l7vsd_protocol                 warn
267 l7vsd_schedule                 warn
268
269 Replication Mode:
270 SINGLE
271
272 SNMPAgent:
273 Agent Status                   inactive
274 log trap status                none
275 log trap level                 none
276 cache update interval          none
277 start date                     none
278 last request date              none
279 last trap date                 none
280 total GET requests             none
281 total SET requests             none
282 total trap counts              none
283
284 Prot LocalAddress:Port ProtoMod Scheduler Protomod_opt_string
285   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
286 TCP 127.0.0.1:40001 sessionless rr --sorry-uri '/' --statistic 0
287   Bypass Settings:
288     Sorry Server                  127.0.0.1:50001 Masq
289     Max Connection                0
290     Sorry Flag                    on
291   SSL Settings:
292     SSL Config File               none
293   Logging Settings:
294     Access Log                    off
295     Access Log File               none
296     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
297   Socket Settings:
298     TCP_DEFER_ACCEPT              disable
299     TCP_NODELAY                   disable
300     TCP_CORK                      disable
301     TCP_QUICKACK                  disable
302   Throughput:
303     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
304     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
305   Statistics:
306     HTTP Total Requests           0
307     HTTP GET Requests             0
308     HTTP POST Requests            0
309 TCP 127.0.0.1:40002 sessionless rr --sorry-uri '/' --statistic 0
310   Bypass Settings:
311     Sorry Server                  [::1]:50002 Masq
312     Max Connection                0
313     Sorry Flag                    on
314   SSL Settings:
315     SSL Config File               none
316   Logging Settings:
317     Access Log                    off
318     Access Log File               none
319     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
320   Socket Settings:
321     TCP_DEFER_ACCEPT              disable
322     TCP_NODELAY                   disable
323     TCP_CORK                      disable
324     TCP_QUICKACK                  disable
325   Throughput:
326     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
327     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
328   Statistics:
329     HTTP Total Requests           0
330     HTTP GET Requests             0
331     HTTP POST Requests            0
332 TCP 127.0.0.1:40003 sessionless rr --sorry-uri '/' --statistic 0
333   Bypass Settings:
334     Sorry Server                  127.0.0.1:50001 Tproxy
335     Max Connection                0
336     Sorry Flag                    on
337   SSL Settings:
338     SSL Config File               none
339   Logging Settings:
340     Access Log                    off
341     Access Log File               none
342     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
343   Socket Settings:
344     TCP_DEFER_ACCEPT              disable
345     TCP_NODELAY                   disable
346     TCP_CORK                      disable
347     TCP_QUICKACK                  disable
348   Throughput:
349     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
350     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
351   Statistics:
352     HTTP Total Requests           0
353     HTTP GET Requests             0
354     HTTP POST Requests            0
355 TCP 127.0.0.1:40004 sessionless rr --sorry-uri '/' --statistic 0
356   Bypass Settings:
357     Sorry Server                  [::1]:50002 Tproxy
358     Max Connection                0
359     Sorry Flag                    on
360   SSL Settings:
361     SSL Config File               none
362   Logging Settings:
363     Access Log                    off
364     Access Log File               none
365     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
366   Socket Settings:
367     TCP_DEFER_ACCEPT              disable
368     TCP_NODELAY                   disable
369     TCP_CORK                      disable
370     TCP_QUICKACK                  disable
371   Throughput:
372     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
373     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
374   Statistics:
375     HTTP Total Requests           0
376     HTTP GET Requests             0
377     HTTP POST Requests            0"
378 if [ "${RET}" != "${EXPECT}" ]
379 then
380         echo "Test failed: $L7VSADM -V -n"
381         exit 1
382 fi
383
384 exit 0
385