OSDN Git Service

714bba5bf9ff483008a6cf1ff5adce2e9331d9d4
[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                  disable
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 if [ "${RET}" != "${EXPECT}" ]
106 then
107         echo "Test failed: $L7VSADM -V -n"
108         exit 1
109 fi
110
111
112 $L7VSADM -E -t 127.0.0.1:40001 -m ip -s lc -u 200 -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -f 1 -T -Q 1M -q 1M -L 1
113 if [ $? -ne 0 ]
114 then
115         echo "Test failed: $L7VSADM -E -t 127.0.0.1:40001 -m ip -s lc -u 200 -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -f 1 -T -Q 1M -q 1M -L 1"
116         exit 1
117 fi
118
119
120 RET=`$L7VSADM -V -n`
121 EXPECT="Layer-7 Virtual Server version 3.0.0
122 L7vsd Log Level:
123 Category                       Level
124 l7vsd_network                  warn
125 l7vsd_network_qos              warn
126 l7vsd_network_bandwidth        warn
127 l7vsd_network_num_connection   warn
128 l7vsd_network_access           warn
129 l7vsd_mainthread               warn
130 l7vsd_virtualservice           warn
131 l7vsd_virtualservice_thread    warn
132 l7vsd_session                  warn
133 l7vsd_session_thread           warn
134 l7vsd_realserver               warn
135 l7vsd_sorryserver              warn
136 l7vsd_module                   warn
137 l7vsd_replication              warn
138 l7vsd_replication_sendthread   warn
139 l7vsd_parameter                warn
140 l7vsd_logger                   warn
141 l7vsd_command                  warn
142 l7vsd_start_stop               warn
143 l7vsd_system                   warn
144 l7vsd_system_memory            warn
145 l7vsd_system_endpoint          warn
146 l7vsd_system_signal            warn
147 l7vsd_system_environment       warn
148 l7vsd_snmpagent                info
149 l7vsd_protocol                 warn
150 l7vsd_schedule                 warn
151
152 Replication Mode:
153 SINGLE
154
155 SNMPAgent:
156 Agent Status                   inactive
157 log trap status                none
158 log trap level                 none
159 cache update interval          none
160 start date                     none
161 last request date              none
162 last trap date                 none
163 total GET requests             none
164 total SET requests             none
165 total trap counts              none
166
167 Prot LocalAddress:Port ProtoMod Scheduler Protomod_opt_string
168   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
169 TCP 127.0.0.1:40001 ip lc --timeout 3600 --no-reschedule --sorry-uri '/' --statistic 0
170   Bypass Settings:
171     Sorry Server                  127.0.0.1:50001 Tproxy
172     Max Connection                200
173     Sorry Flag                    on
174   SSL Settings:
175     SSL Config File               none
176   Logging Settings:
177     Access Log                    on
178     Access Log File               /var/log/l7vs/access_log
179     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
180   Socket Settings:
181     TCP_DEFER_ACCEPT              disable
182     TCP_NODELAY                   disable
183     TCP_CORK                      disable
184     TCP_QUICKACK                  disable
185   Throughput:
186     Current Upload / Limit        0.000000 Mbps / 8.000000 Mbps
187     Current Download / Limit      0.000000 Mbps / 8.000000 Mbps
188   Statistics:
189     HTTP Total Requests           0
190     HTTP GET Requests             0
191     HTTP POST Requests            0"
192 if [ "${RET}" != "${EXPECT}" ]
193 then
194         echo "Test failed: $L7VSADM -V -n"
195         exit 1
196 fi
197 exit 0
198