OSDN Git Service

bug fix
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7vsadm / l7vsadm-04-2-2.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
22 RET=`$L7VSADM`
23 EXPECT="Layer-7 Virtual Server version 3.0.0-1
24 Prot LocalAddress:Port ProtoMod Scheduler
25   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn
26 TCP localhost:40001 sessionless rr"
27
28
29 if [ "${RET}" != "${EXPECT}" ]
30 then
31         echo "Test failed: $L7VSADM"
32         exit 1
33 fi
34
35 $L7VSADM --delete-service --tcp-service localhost:40001 --proto-module sessionless
36 if [ $? -ne 0 ]
37 then
38         echo "Test failed: $L7VSADM --delete-service --tcp-service localhost:40001 --proto-module sessionless"
39         exit 1
40 fi
41
42
43 RET=`$L7VSADM`
44 EXPECT="Layer-7 Virtual Server version 3.0.0-1
45 Prot LocalAddress:Port ProtoMod Scheduler
46   -> RemoteAddress:Port           Forward Weight ActiveConn InactConn"
47
48 if [ "${RET}" != "${EXPECT}" ]
49 then
50         echo "Test failed: $L7VSADM"
51         exit 1
52 fi
53
54 exit 0
55