OSDN Git Service

trunk整理
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / virtualservice / virtualservice-23.sh
1 #!/bin/bash
2
3 . ${SET_DEFAULT_CONF}
4
5 #Add Service
6 start_l7vsd || exit 1
7
8 $L7VSADM -L -c vs -l debug
9 $L7VSADM -A -t 127.0.0.1:40001 -m ip 
10 if [ $? -ne 0 ]
11 then
12         echo "Test failed: $L7VSADM -A -t localhost:40001 -m ip"
13         exit 1
14 fi
15
16 wget -O - -t 1 http://127.0.0.1:40001/ > /dev/null 2>&1
17 sleep 1
18
19 logfile=/var/log/l7vs/l7vsd.log
20 pool_result=`grep pool_session $logfile | awk '{print $8}' | sed 1d | uniq`
21 pool_expect="31
22 30
23 31"
24 if [ "$pool_result" != "$pool_expect" ]; then
25         echo "Test failed: Mismatch pool session threads."
26         exit 1
27 fi
28
29 active_result=`grep active_session $logfile | awk '{print $8}' | uniq`
30 active_expect="0
31 1
32 0"
33 if [ "$active_result" != "$active_expect" ]; then
34         echo "Test failed: Mismatch active session threads."
35         exit 1
36 fi
37 exit 0
38