OSDN Git Service

Bug fix. (Line 162: /usr/sbin/l7vsd -b => /usr/sbin/l7vsd)
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7vsadm / l7vsadm-4-3-1.sh
1 #!/bin/bash
2
3 . ${SET_DEFAULT_CONF}
4
5 #Run http server
6 SorryServer1=SorryServer1
7 SorryServer1_ADDR=127.0.0.1
8 SorryServer1_PORT=50001
9 start_lighttpd -s $SorryServer1 -a $SorryServer1_ADDR -p $SorryServer1_PORT
10 if [ $? -ne 0 ]
11 then
12         echo "Test failed: start_lighttpd SorryServer1"
13         exit 1
14 fi
15
16 #Add Service
17 $L7VSD
18 if [ $? -ne 0 ]
19 then
20         echo "Test failed: $L7VSD"
21         exit 1
22 fi
23 usleep 100000
24
25 $L7VSADM -A -t 127.0.0.1:40001 -m ip -L 0 -a /var/log/l7vs/access_log
26 if [ $? -ne 0 ]
27 then
28         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m ip -L 0 -a /var/log/l7vs/access_log"
29         exit 1
30 fi
31
32
33 RET=`$L7VSADM -V -n`
34 EXPECT="Layer-7 Virtual Server version 3.0.0
35 L7vsd Log Level:
36 Category                       Level
37 l7vsd_network                  warn
38 l7vsd_network_qos              warn
39 l7vsd_network_bandwidth        warn
40 l7vsd_network_num_connection   warn
41 l7vsd_network_access           warn
42 l7vsd_mainthread               warn
43 l7vsd_virtualservice           warn
44 l7vsd_virtualservice_thread    warn
45 l7vsd_session                  warn
46 l7vsd_session_thread           warn
47 l7vsd_realserver               warn
48 l7vsd_sorryserver              warn
49 l7vsd_module                   warn
50 l7vsd_replication              warn
51 l7vsd_replication_sendthread   warn
52 l7vsd_parameter                warn
53 l7vsd_logger                   warn
54 l7vsd_command                  warn
55 l7vsd_start_stop               warn
56 l7vsd_system                   warn
57 l7vsd_system_memory            warn
58 l7vsd_system_endpoint          warn
59 l7vsd_system_signal            warn
60 l7vsd_system_environment       warn
61 l7vsd_snmpagent                info
62 l7vsd_protocol                 warn
63 l7vsd_schedule                 warn
64
65 Replication Mode:
66 SINGLE
67
68 SNMPAgent:
69 Agent Status                   inactive
70 log trap status                none
71 log trap level                 none
72 cache update interval          none
73 start date                     none
74 last request date              none
75 last trap date                 none
76 total GET requests             none
77 total SET requests             none
78 total trap counts              none
79
80 Prot LocalAddress:Port ProtoMod Scheduler Protomod_opt_string
81   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
82 TCP 127.0.0.1:40001 ip rr --timeout 3600 --no-reschedule --sorry-uri '/' --statistic 0
83   Bypass Settings:
84     Sorry Server                  none
85     Max Connection                0
86     Sorry Flag                    off
87   SSL Settings:
88     SSL Config File               none
89   Logging Settings:
90     Access Log                    off
91     Access Log File               /var/log/l7vs/access_log
92     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
93   Socket Settings:
94     TCP_DEFER_ACCEPT              disable
95     TCP_NODELAY                   disable
96     TCP_CORK                      disable
97     TCP_QUICKACK                  auto
98   Throughput:
99     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
100     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
101   Statistics:
102     HTTP Total Requests           0
103     HTTP GET Requests             0
104     HTTP POST Requests            0"
105
106 if [ "${RET}" != "${EXPECT}" ]
107 then
108         echo "Test failed: $L7VSADM -V -n"
109         exit 1
110 fi
111
112
113 $L7VSADM -E -t 127.0.0.1:40001 -m ip -s lc -u 200 -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -f 1 --tproxy -Q 1M -q 1M -L 1
114 if [ $? -ne 0 ]
115 then
116         echo "Test failed: $L7VSADM -E -t 127.0.0.1:40001 -m ip -s lc -u 200 -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -f 1 --tproxy -Q 1M -q 1M -L 1"
117         exit 1
118 fi
119
120
121 RET=`$L7VSADM -V -n`
122 EXPECT="Layer-7 Virtual Server version 3.0.0
123 L7vsd Log Level:
124 Category                       Level
125 l7vsd_network                  warn
126 l7vsd_network_qos              warn
127 l7vsd_network_bandwidth        warn
128 l7vsd_network_num_connection   warn
129 l7vsd_network_access           warn
130 l7vsd_mainthread               warn
131 l7vsd_virtualservice           warn
132 l7vsd_virtualservice_thread    warn
133 l7vsd_session                  warn
134 l7vsd_session_thread           warn
135 l7vsd_realserver               warn
136 l7vsd_sorryserver              warn
137 l7vsd_module                   warn
138 l7vsd_replication              warn
139 l7vsd_replication_sendthread   warn
140 l7vsd_parameter                warn
141 l7vsd_logger                   warn
142 l7vsd_command                  warn
143 l7vsd_start_stop               warn
144 l7vsd_system                   warn
145 l7vsd_system_memory            warn
146 l7vsd_system_endpoint          warn
147 l7vsd_system_signal            warn
148 l7vsd_system_environment       warn
149 l7vsd_snmpagent                info
150 l7vsd_protocol                 warn
151 l7vsd_schedule                 warn
152
153 Replication Mode:
154 SINGLE
155
156 SNMPAgent:
157 Agent Status                   inactive
158 log trap status                none
159 log trap level                 none
160 cache update interval          none
161 start date                     none
162 last request date              none
163 last trap date                 none
164 total GET requests             none
165 total SET requests             none
166 total trap counts              none
167
168 Prot LocalAddress:Port ProtoMod Scheduler Protomod_opt_string
169   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
170 TCP 127.0.0.1:40001 ip lc --timeout 3600 --no-reschedule --sorry-uri '/' --statistic 0
171   Bypass Settings:
172     Sorry Server                  127.0.0.1:50001 Tproxy
173     Max Connection                200
174     Sorry Flag                    on
175   SSL Settings:
176     SSL Config File               none
177   Logging Settings:
178     Access Log                    on
179     Access Log File               /var/log/l7vs/access_log
180     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
181   Socket Settings:
182     TCP_DEFER_ACCEPT              disable
183     TCP_NODELAY                   disable
184     TCP_CORK                      disable
185     TCP_QUICKACK                  auto
186   Throughput:
187     Current Upload / Limit        0.000000 Mbps / 1.000000 Mbps
188     Current Download / Limit      0.000000 Mbps / 1.000000 Mbps
189   Statistics:
190     HTTP Total Requests           0
191     HTTP GET Requests             0
192     HTTP POST Requests            0"
193
194 if [ "${RET}" != "${EXPECT}" ]
195 then
196         echo "Test failed: $L7VSADM -V -n"
197         exit 1
198 fi
199 exit 0
200