OSDN Git Service

trunk整理
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / PT / B / B-11-IPv6v6.sh
1 #!/bin/bash
2
3 VS1="[::1]"
4 RS1="[::1]"
5
6 # set config file
7 . ${SET_DEFAULT_CONF}
8
9 #Start L7VSD Service
10 $INIT_L7VSD start
11 if [ $? -ne 0 ]
12 then
13         echo "Test failed: $L7VSD"
14         exit 1
15 fi
16 usleep 100000
17
18 #Print The Status of Virtual Service 
19 $L7VSADM -l
20 if [ $? -ne 0 ]
21 then
22         echo "Test failed: $L7VSADM -l"
23         exit 1
24 fi
25
26
27 #Add Virtual Service
28 $L7VSADM -A -t $VS1:8080 -m sessionless -s rr
29 if [ $? -ne 0 ]
30 then
31         echo "Test failed: $L7VSADM -A -t $VS1:8080 -m sessionless -s rr"
32         exit 1
33 fi
34
35
36 #Add Real Service
37 $L7VSADM -a -t $VS1:8080 -m sessionless -r $RS1:80
38 if [ $? -ne 0 ]
39 then
40         echo "Test failed: $L7VSADM -a -t $VS1:8080 -m sessionless -r $RS1:80"
41         exit 1
42 fi
43
44 #Check The Status of Virtual Service 
45 RET=`$L7VSADM -l`
46 EXPECT="Layer-7 Virtual Server version 3.0.0
47 Prot LocalAddress:Port ProtoMod Scheduler
48   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
49 TCP localhost:webcache sessionless rr
50   -> localhost:http               Masq    1      0          0         "
51
52 if [ "${RET}" != "${EXPECT}" ]
53 then
54         echo "Test failed: $L7VSADM -l"
55         exit 1
56 fi
57
58 #Change The Weight of Real Service
59 $L7VSADM -e -t $VS1:8080 -m sessionless -r $RS1:80 -w 100
60 if [ $? -ne 0 ]
61 then
62         echo "Test failed: $L7VSADM -l"
63         exit 1
64 fi
65
66 #Print The Status of Virtual Service  And Check The Weight of Real Service
67 RET=`$L7VSADM -l`
68
69 EXPECT="Layer-7 Virtual Server version 3.0.0
70 Prot LocalAddress:Port ProtoMod Scheduler
71   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
72 TCP localhost:webcache sessionless rr
73   -> localhost:http               Masq    100    0          0         "
74
75 if [ "${RET}" != "${EXPECT}" ]
76 then
77         echo "Test failed: $L7VSADM -l"
78         exit 1
79 fi
80
81
82 exit 0
83