OSDN Git Service

Bug fix. (Line 162: /usr/sbin/l7vsd -b => /usr/sbin/l7vsd)
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / l7directord / l7directord-5-2-3-1.sh
1 #!/bin/bash
2 . ${SET_DEFAULT_CONF}
3 \cp ./materials/l7directord-5-2-3-1-l7directord.cf ${L7DIRECTORD_CONF_DIR}/l7directord.cf
4
5 #Run http server
6 FallbackServer=FallbackServer
7 FallbackServer_ADDR=127.0.0.1
8 FallbackServer_PORT=50001
9 start_lighttpd -s $FallbackServer -a $FallbackServer_ADDR -p $FallbackServer_PORT
10
11 if [ $? -ne 0 ]
12 then
13         echo "Test failed: start_lighttpd FallbackServer"
14         exit 1
15 fi
16
17
18 #Start l7vsd
19 $L7VSD
20 if [ $? -ne 0 ]
21 then
22         echo "Test failed: $L7VSD"
23         exit 1
24 fi
25 usleep 100000
26
27 #Start l7directord
28 $L7DIRECTORD start
29 if [ $? -ne 0 ]
30 then
31         echo "Test failed: $L7DIRECTORD start"
32         exit 1
33 fi
34 sleep 1
35
36 #Connect
37 RET=`$WGET -t 1 -qO- http://127.0.0.1:40001/`
38 if [ "${RET}" != "${FallbackServer}" ]
39 then
40         echo "Test failed: $WGET -t 1 -qO- http://127.0.0.1:40001/"
41         exit 1
42 fi
43
44 exit 0
45