OSDN Git Service

Change version number
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7vsadm / l7vsadm-3-3-1.sh
1 #!/bin/bash
2
3 . ${SET_DEFAULT_CONF}
4
5 #Add Service
6 $L7VSD
7 if [ $? -ne 0 ]
8 then
9         echo "Test failed: $L7VSD"
10         exit 1
11 fi
12 usleep 100000
13
14 $L7VSADM -A -t localhost:40001 -m sessionless
15 if [ $? -ne 0 ]
16 then
17         echo "Test failed: $L7VSADM -A -t localhost:40001 -m sessionless"
18         exit 1
19 fi
20
21 $L7VSADM -a -t localhost:40001 -m sessionless -r localhost:40002 -w 3
22 if [ $? -ne 0 ]
23 then
24         echo "Test failed: $L7VSADM -a -t localhost:40001 -m sessionless -r localhost:40002 -w 3"
25         exit 1
26 fi
27
28 $L7VSADM -a -t localhost:40001 -m sessionless -r localhost:40003 -w 0
29 if [ $? -ne 0 ]
30 then
31         echo "Test failed: $L7VSADM -a -t localhost:40001 -m sessionless -r localhost:40003 -w 0"
32         exit 1
33 fi
34
35 RET=`$L7VSADM -K`
36 EXPECT="Layer-7 Virtual Server version 3.0.0
37 Prot LocalAddress:Port ProtoMod Scheduler
38      SSL_config_file
39      Socket option
40      Access_log_flag
41      Access_log_file
42      Access_log_rotate option
43   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
44 TCP localhost:40001 sessionless rr
45     none
46     none
47     0
48     none
49     none
50   -> localhost:40002              Masq    3      0          0         
51   -> localhost:40003              Masq    0      0          0         "
52 if [ "${RET}" != "${EXPECT}" ]
53 then
54         echo "Test failed: $L7VSADM -l"
55         exit 1
56 fi
57
58 exit 0
59