OSDN Git Service

#534 Fixed: Delete short option / Modified all related script...
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7vsadm / l7vsadm-4-1-51.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"        exit 1
22 fi
23
24 #Add Service
25 $L7VSD
26 if [ $? -ne 0 ]
27 then
28         echo "Test failed: $L7VSD"
29         exit 1
30 fi
31 usleep 100000
32
33 RET=`$L7VSADM -A -t localhost:40001 -m sessionless -b $SorryServer1_ADDR:$SorryServer1_PORT --masq --tproxy 2>&1 | grep "PARSE ERROR: Option --masq/tproxy is conflict."`
34 EXPECT="PARSE ERROR: Option --masq/tproxy is conflict."
35 if [ "${RET}" != "${EXPECT}" ]
36 then
37         echo "Test failed: $L7VSADM -A -t localhost:40001 -m sessionless -b $SorryServer1_ADDR:$SorryServer1_PORT --masq --tproxy"
38         exit 1
39 fi
40
41 RET=`$L7VSADM -A -t localhost:40001 -m sessionless -b $SorryServer2_ADDR:$SorryServer2_PORT --masq --tproxy 2>&1 | grep "PARSE ERROR: Option --masq/tproxy is conflict."`
42 EXPECT="PARSE ERROR: Option --masq/tproxy is conflict."
43 if [ "${RET}" != "${EXPECT}" ]
44 then
45         echo "Test failed: $L7VSADM -A -t localhost:40001 -m sessionless -b $SorryServer2_ADDR:$SorryServer2_PORT --masq --tproxy"
46         exit 1
47 fi
48
49 exit 0
50