OSDN Git Service

trunk整理
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7vsadm / l7vsadm-3-2-1.sh
1 #!/bin/bash
2
3 . ${SET_DEFAULT_CONF}
4
5 #Run http server
6 RealServer1=RealServer1
7 RealServer1_ADDR=127.0.0.1
8 RealServer1_PORT=50001
9 start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT
10 if [ $? -ne 0 ]
11 then
12         echo "Test failed: start_lighttpd RealServer1"
13         exit 1
14 fi
15
16 RealServer2=RealServer2
17 RealServer2_ADDR=127.0.0.1
18 RealServer2_PORT=50002
19 start_lighttpd -s $RealServer2 -a $RealServer2_ADDR -p $RealServer2_PORT
20 if [ $? -ne 0 ]
21 then
22         echo "Test failed: start_lighttpd RealServer2"
23         exit 1
24 fi
25
26 #Add Service
27 $L7VSD
28 if [ $? -ne 0 ]
29 then
30         echo "Test failed: $L7VSD"
31         exit 1
32 fi
33 usleep 100000
34
35 $L7VSADM -A -t localhost6:40001 -m sessionless
36 if [ $? -ne 0 ]
37 then
38         echo "Test failed: $L7VSADM -A -t localhost4:40001 -m sessionless"
39         exit 1
40 fi
41
42 $L7VSADM -a -t localhost6:40001 -m sessionless -r localhost6:${RealServer1_PORT} -w 3
43 if [ $? -ne 0 ]
44 then
45         echo "Test failed: $L7VSADM -a -t localhost4:40001 -m sessionless -r localhost4:${RealServer1_PORT} -w 3"
46         exit 1
47 fi
48
49 $L7VSADM -a -t localhost6:40001 -m sessionless -r localhost6:${RealServer2_PORT} -w 0
50 if [ $? -ne 0 ]
51 then
52         echo "Test failed: $L7VSADM -a -t localhost4:40001 -m sessionless -r localhost4:${RealServer2_PORT} -w 0"
53         exit 1
54 fi
55
56
57 RET=`$L7VSADM -V`
58
59 EXPECT="Layer-7 Virtual Server version 3.0.1
60 L7vsd Log Level:
61 Category                       Level
62 l7vsd_network                  warn
63 l7vsd_network_qos              warn
64 l7vsd_network_bandwidth        warn
65 l7vsd_network_num_connection   warn
66 l7vsd_network_access           warn
67 l7vsd_mainthread               warn
68 l7vsd_virtualservice           warn
69 l7vsd_virtualservice_thread    warn
70 l7vsd_session                  warn
71 l7vsd_session_thread           warn
72 l7vsd_realserver               warn
73 l7vsd_sorryserver              warn
74 l7vsd_module                   warn
75 l7vsd_replication              warn
76 l7vsd_replication_sendthread   warn
77 l7vsd_parameter                warn
78 l7vsd_logger                   warn
79 l7vsd_command                  warn
80 l7vsd_start_stop               warn
81 l7vsd_system                   warn
82 l7vsd_system_memory            warn
83 l7vsd_system_endpoint          warn
84 l7vsd_system_signal            warn
85 l7vsd_system_environment       warn
86 l7vsd_snmpagent                info
87 l7vsd_protocol                 warn
88 l7vsd_schedule                 warn
89
90 Replication Mode:
91 SINGLE
92
93 SNMPAgent:
94 Agent Status                   inactive
95 log trap status                none
96 log trap level                 none
97 cache update interval          none
98 start date                     none
99 last request date              none
100 last trap date                 none
101 total GET requests             none
102 total SET requests             none
103 total trap counts              none
104
105 Prot LocalAddress:Port ProtoMod Scheduler Protomod_opt_string
106   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
107 TCP localhost:40001 sessionless rr --sorry-uri '/' --statistic 0
108   -> localhost:50001              Masq    3      0          0         
109   -> localhost:50002              Masq    0      0          0         
110   Bypass Settings:
111     Sorry Server                  none
112     Max Connection                0
113     Sorry Flag                    off
114   SSL Settings:
115     SSL Config File               none
116   Logging Settings:
117     Access Log                    off
118     Access Log File               none
119     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 10 --ac-rotate-max-filesize 10M
120   Socket Settings:
121     TCP_DEFER_ACCEPT              disable
122     TCP_NODELAY                   disable
123     TCP_CORK                      disable
124     TCP_QUICKACK                  auto
125   Throughput:
126     Current Upload / Limit        0.000000 Mbps / 0.000000 Mbps
127     Current Download / Limit      0.000000 Mbps / 0.000000 Mbps
128   Statistics:
129     HTTP Total Requests           0
130     HTTP GET Requests             0
131     HTTP POST Requests            0"
132
133 if [ "${RET}" != "${EXPECT}" ]
134 then
135         echo "Test failed: $L7VSADM -V"
136         exit 1
137 fi
138
139 exit 0
140