6 #nc -i 1 -l 9876 > ${TMP_DIR}/nc_tmp &
9 #chkconfig echo-stream on
15 echo "Test failed: $L7VSD"
22 RealServer1=RealServer1
23 RealServer1_ADDR=127.0.0.1
24 RealServer1_PORT=50001
26 RealServer2=RealServer2
27 RealServer2_ADDR=127.0.0.1
28 RealServer2_PORT=50002
30 start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT
31 start_lighttpd -s $RealServer2 -a $RealServer2_ADDR -p $RealServer2_PORT
35 echo "Test failed: start_lighttpd RealServer1"
39 $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --statistic 1 -F
42 echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --statistic 1 -F"
46 $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT}
49 echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT}"
53 $L7VSADM -A -t 127.0.0.1:40002 -m sessionless --statistic 1 -F
56 echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --statistic 1 -F"
60 $L7VSADM -a -t 127.0.0.1:40002 -m sessionless -r ${RealServer2_ADDR}:${RealServer2_PORT}
63 echo "Test failed: $L7VSADM -a -t 127.0.0.1:40002 -m sessionless -r ${RealServer2_ADDR}:${RealServer2_PORT}"
69 GET_REQ="GET / HTTP/1.0\r\n\r\n"
70 POST_REQ="POST / HTTP/1.0\r\n\r\n"
71 for ((I=0; I<100;I++))
73 echo -e -n "${GET_REQ}" | nc 127.0.0.1 40001 >/dev/null 2>&1
74 echo -e -n "${GET_REQ}" | nc 127.0.0.1 40002 >/dev/null 2>&1
77 for ((I=0; I<200;I++))
79 echo -e -n "${POST_REQ}" | nc 127.0.0.1 40001 >/dev/null 2>&1
80 echo -e -n "${POST_REQ}" | nc 127.0.0.1 40002 >/dev/null 2>&1
83 #HTTP Total Requests check
84 RET=`$L7VSADM -V -n | grep "HTTP Total Requests" | awk '{ print $4}'`
87 if [ "${RET}" != "${EXPECT}" ]
89 echo "Test failed: $L7VSADM -V -n | grep "HTTP Total Requests" | awk '{print $4}'"
93 #HTTP GET Requests check
94 RET=`$L7VSADM -V -n | grep "HTTP GET Requests" | awk '{print $4}'`
97 if [ "${RET}" != "${EXPECT}" ]
99 echo "Test failed: $L7VSADM -V -n | grep "HTTP GET Requests" | awk '{print $4}'"
103 #HTTP POST Requests check
104 RET=`$L7VSADM -V -n | grep "HTTP POST Requests" | awk '{print $4}'`
107 if [ "${RET}" != "${EXPECT}" ]
109 echo "Test failed: $L7VSADM -V -n | grep "HTTP POST Requests" | awk '{print $4}"
114 $L7VSADM -S -r -t 127.0.0.1:40002 -m sessionless
117 echo "Test failed: $L7VSADM -S -r -t 127.0.0.1 40002 -m sessionless"
121 #HTTP Total Requests check
122 RET=`$L7VSADM -V -n | grep "HTTP Total Requests" | awk '{ print $4}'`
125 if [ "${RET}" != "${EXPECT}" ]
127 echo "Test failed: $L7VSADM -V -n | grep "HTTP Total Requests" | awk '{print $4}'"
131 #HTTP GET Requests check
132 RET=`$L7VSADM -V -n | grep "HTTP GET Requests" | awk '{print $4}'`
135 if [ "${RET}" != "${EXPECT}" ]
137 echo "Test failed: $L7VSADM -V -n | grep "HTTP GET Requests" | awk '{print $4}'"
141 #HTTP POST Requests check
142 RET=`$L7VSADM -V -n | grep "HTTP POST Requests" | awk '{print $4}'`
145 if [ "${RET}" != "${EXPECT}" ]
147 echo "Test failed: $L7VSADM -V -n | grep "HTTP POST Requests" | awk '{print $4}"