OSDN Git Service

propset svn:executable
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / snmpagent / mib-21.sh
1 #!/bin/bash
2
3 # set config file
4 . ${SET_DEFAULT_CONF}
5
6 \cp -f materials/mib-7-43-l7vs.cf ${L7VSD_CONF_DIR}/l7vs.cf
7
8 #Run http server
9 RealServer1=RealServer1
10 RealServer1_ADDR=127.0.0.1
11 RealServer1_PORT=50001
12 start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT
13 if [ $? -ne 0 ]
14 then
15         echo "Test failed: start_lighttpd RealServer1"
16         exit 1
17 fi
18
19 SorryServer=SorryServer
20 SorryServer_ADDR=127.0.0.1
21 SorryServer_PORT=50002
22 start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT
23 if [ $? -ne 0 ]
24 then
25         echo "Test failed: start_lighttpd SorryServer"
26         exit 1
27 fi
28
29 #Start L7VSD Service
30 $L7VSD
31 if [ $? -ne 0 ]
32 then
33         echo "Test failed: $L7VSD"
34         exit 1
35 fi
36 usleep 100000
37
38 #Add Service
39 $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --sorry-uri /index.html -s rr -u 10000 -b ${SorryServer_ADDR}:${SorryServer_PORT} -f 0 -Q 100 -q 200 -z /etc/l7vs/sslproxy/sslproxy.target.cf 
40
41 if [ $? -ne 0 ]
42 then
43         echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless
44                 --sorry-uri /index.html -s rr -u 10000
45                 -b ${SorryServer_ADDR}:${SorryServer_PORT}
46                 -f 0 -Q 100 -q 200 -z /etc/l7vs/sslproxy/sslproxy.target.cf"
47         exit 1
48 fi
49
50 $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:50001 -w 100
51 if [ $? -ne 0 ]
52 then
53         echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001
54               -m sessionless -r 127.0.0.1:50001 -w 100"
55         exit 1
56 fi
57
58
59 #Check Return Value
60 RET=`snmpget -v 2c -c public localhost ULTRAMONKEY-L7-MIB::l7vsVsSorryForceEnabled.1`
61 echo "$RET"
62 EXPECT="ULTRAMONKEY-L7-MIB::l7vsVsSorryForceEnabled.1 = INTEGER: off(2)"
63
64 if [ "${RET}" != "${EXPECT}" ]
65 then
66         echo "Test failed: snmpget -v 2c -c public localhost ULTRAMONKEY-L7-MIB::l7vsVsSorryForceEnabled.1"
67         exit 1
68 fi
69
70 exit 0