OSDN Git Service

2c2e72850ccbe901a11b312555fb3c03c39d5788
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7vsadm / l7vsadm-4-1-50.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} -T
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} -T"
38         exit 1
39 fi
40
41 $L7VSADM -A -t 127.0.0.1:40002 -m sessionless -b ${SorryServer1_ADDR}:${SorryServer1_PORT} --tproxy
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} --tproxy"
45         exit 1
46 fi
47
48 $L7VSADM -A -t 127.0.0.1:40003 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} -T
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} -T"
52         exit 1
53 fi
54
55 $L7VSADM -A -t 127.0.0.1:40004 -m sessionless -b ${SorryServer2_ADDR}:${SorryServer2_PORT} --tproxy
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} --tproxy"
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_snmpbridge               warn
91 l7vsd_protocol                 warn
92 l7vsd_schedule                 warn
93
94 Replication Mode:
95 SINGLE
96
97 SNMPAgent Connection Status:
98 non-connecting
99
100 SNMPAgent Log Level:
101 Category                       Level
102 snmpagent_start_stop           warn
103 snmpagent_manager_receive      warn
104 snmpagent_manager_send         warn
105 snmpagent_l7vsd_receive        warn
106 snmpagent_l7vsd_send           warn
107 snmpagent_logger               warn
108 snmpagent_parameter            warn
109 snmpagent_system               warn
110 snmpagent_system_memory        warn
111 snmpagent_system_endpoint      warn
112 snmpagent_system_signal        warn
113 snmpagent_system_environment   warn
114
115 Prot LocalAddress:Port ProtoMod Scheduler Protomod_opt_string
116      SorryAddress:Port Sorry_cc Sorry_flag
117      QoS-up   Throughput-up
118      QoS-down Throughput-down
119      SSL_config_file
120      Socket option
121      Access_log_flag
122      Access_log_file
123      Access_log_rotate option
124   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
125 TCP 127.0.0.1:40001 sessionless rr --sorry-uri '/'
126     ${SorryServer1_ADDR}:${SorryServer1_PORT}(Tproxy) 0 0
127     0 0
128     0 0
129     none
130     none
131     0
132     none
133     --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
134 TCP 127.0.0.1:40002 sessionless rr --sorry-uri '/'
135     ${SorryServer1_ADDR}:${SorryServer1_PORT}(Tproxy) 0 0
136     0 0
137     0 0
138     none
139     none
140     0
141     none
142     --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
143 TCP 127.0.0.1:40003 sessionless rr --sorry-uri '/'
144     ${SorryServer2_ADDR}:${SorryServer2_PORT}(Tproxy) 0 0
145     0 0
146     0 0
147     none
148     none
149     0
150     none
151     --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
152 TCP 127.0.0.1:40004 sessionless rr --sorry-uri '/'
153     ${SorryServer2_ADDR}:${SorryServer2_PORT}(Tproxy) 0 0
154     0 0
155     0 0
156     none
157     none
158     0
159     none
160     --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M"
161 if [ "${RET}" != "${EXPECT}" ]
162 then
163         echo "Test failed: $L7VSADM -V -n"
164         exit 1
165 fi
166
167 exit 0
168