OSDN Git Service

5b62f834646b747b66713fdd3e5b8a791151dec4
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7vsadm / l7vsadm-4-1-49.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 ${SorryServer1_ADDR}:${SorryServer1_PORT} --masq
42 if [ $? -ne 0 ]
43 then
44         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40002 -m sessionless -b ${SorryServer1_ADDR}:${SorryServer1_PORT} --masq"
45         exit 1
46 fi
47
48 $L7VSADM -A -t 127.0.0.1:40003 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} -M
49 if [ $? -ne 0 ]
50 then
51         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40003 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} -M"
52         exit 1
53 fi
54
55 $L7VSADM -A -t 127.0.0.1:40004 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} --masq
56 if [ $? -ne 0 ]
57 then
58         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer1_ADDR}:${SorryServer1_PORT} --masq"
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                  127.0.0.1:50001 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                  [::1]:50002 Masq
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 Masq
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 exit 0
210