OSDN Git Service

rename test scripts
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7directord / l7directord-5-3-5.sh
1 #!/bin/bash
2 . ${SET_DEFAULT_CONF}
3 \cp ./materials/l7directord-5-3-5-l7directord.cf ${L7DIRECTORD_CONF_DIR}/l7directord.cf
4
5 # Start l7vsd
6 $L7VSD
7 if [ $? -ne 0 ]
8 then
9         echo "Test failed: $L7VSD"
10         exit 1
11 fi
12 usleep 100000
13
14 # Start l7directord
15 $INIT_L7DIRECTORD start 
16 if [ $? -ne 0 ]
17 then
18         echo "Test failed: $INIT_L7DIRECTORD start"
19         exit 1
20 fi
21 sleep 10
22
23 RET=`$L7VSADM -l -n`
24 EXPECT="Layer-7 Virtual Server version 3.0.0-1
25 Prot LocalAddress:Port ProtoMod Scheduler
26   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
27 TCP 127.0.0.1:50000 sessionless rr
28 TCP 127.0.0.1:50002 sslid lc"
29 if [ "$RET" != "$EXPECT" ]
30 then
31         echo "Test failed: $L7VSADM -l -n"
32         exit 1
33 fi
34
35 RET=`cat ${L7VS_LOG_DIR}/l7directord.log | grep "\[ERR0303\] Failed to command ./usr/sbin/l7vsadm -A -t 127.0.0.1:50001 -m ip --foo -s wrr -u 0 -b 0.0.0.0:0 -Q 0 -q 0 2>&1. with return: 65280"`
36 if [ -z "${RET}" ]
37 then
38         echo "Test failed: cat ${L7VS_LOG_DIR}/l7directord.log"
39         exit 1
40 fi
41
42 RET=`cat ${L7VS_LOG_DIR}/l7directord.log | grep "\[ERR0201\] Failed to add virtual service to l7vsd: .127.0.0.1:50001 ip ', output: .PARSE ERROR : protocol module argument error: Option error.'"`
43 if [ -z "${RET}" ]
44 then
45         echo "Test failed: cat ${L7VS_LOG_DIR}/l7directord.log"
46         exit 1
47 fi
48
49 RET=`cat ${L7VS_LOG_DIR}/l7directord.log | grep "\[ERR0303\] Failed to command ./usr/sbin/l7vsadm -A -t 127.0.0.1:50003 -m sessionless --foo -s rr -u 0 -b 0.0.0.0:0 -Q 0 -q 0 2>&1' with return: 65280"`
50 if [ -z "${RET}" ]
51 then
52         echo "Test failed: cat ${L7VS_LOG_DIR}/l7directord.log"
53         exit 1
54 fi
55
56 RET=`cat ${L7VS_LOG_DIR}/l7directord.log | grep "\[ERR0201\] Failed to add virtual service to l7vsd: .127.0.0.1:50003 sessionless ', output: .PARSE ERROR : protocol module argument error: Option error.'"`
57 if [ -z "${RET}" ]
58 then
59         echo "Test failed: cat ${L7VS_LOG_DIR}/l7directord.log"
60         exit 1
61 fi
62
63 exit 0