OSDN Git Service

bug fix
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / virtualservice / virtualservice-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
17 #Add Service
18 $L7VSD
19 if [ $? -ne 0 ]
20 then
21         echo "Test failed: $L7VSD"
22         exit 1
23 fi
24 usleep 100000
25
26 $L7VSADM -A -t localhost:40001 -m sessionless -s wrr -u 10 -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -f 0 -Q 100M -q 100M -O deferaccept,cork,quickackoff,nodelay -L 1 -a /var/log/l7vs/l7vsd_conn.log --ac-rotate-type size --ac-rotate-max-backup-index 12 --ac-rotate-max-filesize 1M
27 if [ $? -ne 0 ]
28 then
29         echo "Test failed: $L7VSADM -A -t localhost:40001 -m sessionless -s wrr -u 10 -b ${SorryServer1_ADDR}:${SorryServer1_PORT} -f 0 -Q 100M -q 100M -O deferaccept,cork,quickackoff,nodelay -L 1 -a /var/log/l7vs/l7vsd_conn.log --ac-rotate-type size --ac-rotate-max-backup-index 12 --ac-rotate-max-filesize 1M"
30         exit 1
31 fi
32
33
34 RET=`$L7VSADM -V`
35 EXPECT="Layer-7 Virtual Server version 3.0.0
36 L7vsd Log Level:
37 Category                       Level
38 l7vsd_network                  warn
39 l7vsd_network_qos              warn
40 l7vsd_network_bandwidth        warn
41 l7vsd_network_num_connection   warn
42 l7vsd_network_access           warn
43 l7vsd_mainthread               warn
44 l7vsd_virtualservice           warn
45 l7vsd_virtualservice_thread    warn
46 l7vsd_session                  warn
47 l7vsd_session_thread           warn
48 l7vsd_realserver               warn
49 l7vsd_sorryserver              warn
50 l7vsd_module                   warn
51 l7vsd_replication              warn
52 l7vsd_replication_sendthread   warn
53 l7vsd_parameter                warn
54 l7vsd_logger                   warn
55 l7vsd_command                  warn
56 l7vsd_start_stop               warn
57 l7vsd_system                   warn
58 l7vsd_system_memory            warn
59 l7vsd_system_endpoint          warn
60 l7vsd_system_signal            warn
61 l7vsd_system_environment       warn
62 l7vsd_snmpagent                info
63 l7vsd_protocol                 warn
64 l7vsd_schedule                 warn
65
66 Replication Mode:
67 SINGLE
68
69 SNMPAgent:
70 Agent Status                   inactive
71 log trap status                none
72 log trap level                 none
73 cache update interval          none
74 start date                     none
75 last request date              none
76 last trap date                 none
77 total GET requests             none
78 total SET requests             none
79 total trap counts              none
80
81 Prot LocalAddress:Port ProtoMod Scheduler Protomod_opt_string
82   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
83 TCP localhost:40001 sessionless wrr --sorry-uri '/' --statistic 0
84   Bypass Settings:
85     Sorry Server                  localhost:50001 Masq
86     Max Connection                10
87     Sorry Flag                    off
88   SSL Settings:
89     SSL Config File               none
90   Logging Settings:
91     Access Log                    on
92     Access Log File               /var/log/l7vs/l7vsd_conn.log
93     Access Log Rotate             --ac-rotate-type size --ac-rotate-max-backup-index 12 --ac-rotate-max-filesize 1M
94   Socket Settings:
95     TCP_DEFER_ACCEPT              enable
96     TCP_NODELAY                   enable
97     TCP_CORK                      enable
98     TCP_QUICKACK                  disable
99   Throughput:
100     Current Upload / Limit        0.000000 Mbps / 800.000000 Mbps
101     Current Download / Limit      0.000000 Mbps / 800.000000 Mbps
102   Statistics:
103     HTTP Total Requests           0
104     HTTP GET Requests             0
105     HTTP POST Requests            0"
106 if [ "${RET}" != "${EXPECT}" ]
107 then
108         echo "Test failed: $L7VSADM -V"
109         exit 1
110 fi
111
112 exit 0
113