From 6ef77581176b60fd579ce4891dfdf7b4b5175485 Mon Sep 17 00:00:00 2001 From: 6638678 <6638678@1ed66053-1c2d-0410-8867-f7571e6e31d3> Date: Fri, 17 Sep 2010 08:29:17 +0000 Subject: [PATCH] Add test scripts git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10307 1ed66053-1c2d-0410-8867-f7571e6e31d3 --- test/script/session/session-76-1.sh | 57 ++++++++++++++++++++++++++++++++++++ test/script/session/session-76-2.sh | 58 +++++++++++++++++++++++++++++++++++++ test/script/session/session-77-1.sh | 57 ++++++++++++++++++++++++++++++++++++ test/script/session/session-77-2.sh | 58 +++++++++++++++++++++++++++++++++++++ test/script/session/session-78-1.sh | 51 ++++++++++++++++++++++++++++++++ test/script/session/session-78-2.sh | 52 +++++++++++++++++++++++++++++++++ test/script/session/session-79-1.sh | 51 ++++++++++++++++++++++++++++++++ test/script/session/session-79-2.sh | 52 +++++++++++++++++++++++++++++++++ test/script/session/session-80-1.sh | 57 ++++++++++++++++++++++++++++++++++++ test/script/session/session-80-2.sh | 58 +++++++++++++++++++++++++++++++++++++ test/script/session/session-81-1.sh | 57 ++++++++++++++++++++++++++++++++++++ test/script/session/session-81-2.sh | 58 +++++++++++++++++++++++++++++++++++++ test/script/session/session-82-1.sh | 50 ++++++++++++++++++++++++++++++++ test/script/session/session-82-2.sh | 51 ++++++++++++++++++++++++++++++++ test/script/session/session-83-1.sh | 50 ++++++++++++++++++++++++++++++++ test/script/session/session-83-2.sh | 51 ++++++++++++++++++++++++++++++++ 16 files changed, 868 insertions(+) create mode 100755 test/script/session/session-76-1.sh create mode 100755 test/script/session/session-76-2.sh create mode 100755 test/script/session/session-77-1.sh create mode 100755 test/script/session/session-77-2.sh create mode 100755 test/script/session/session-78-1.sh create mode 100755 test/script/session/session-78-2.sh create mode 100755 test/script/session/session-79-1.sh create mode 100755 test/script/session/session-79-2.sh create mode 100755 test/script/session/session-80-1.sh create mode 100755 test/script/session/session-80-2.sh create mode 100755 test/script/session/session-81-1.sh create mode 100755 test/script/session/session-81-2.sh create mode 100755 test/script/session/session-82-1.sh create mode 100755 test/script/session/session-82-2.sh create mode 100755 test/script/session/session-83-1.sh create mode 100755 test/script/session/session-83-2.sh diff --git a/test/script/session/session-76-1.sh b/test/script/session/session-76-1.sh new file mode 100755 index 00000000..9800c529 --- /dev/null +++ b/test/script/session/session-76-1.sh @@ -0,0 +1,57 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +RealServer1=RealServer1 +RealServer1_ADDR=127.0.0.1 +RealServer1_PORT=50001 +start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT -l ${L7VS_LOG_DIR}/session-76-real1-access.log +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd RealServer1" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t 127.0.0.1:40001 -m sessionless +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless" + exit 1 +fi + +$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -M +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -M" + exit 1 +fi + +#Connect +RET=`curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/` +if [ "${RET}" != "${RealServer1}" ] +then + echo "curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-76-real1-access.log | awk '{print $1}'` +EXPECT="127.0.0.1" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-76-real1-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-76-2.sh b/test/script/session/session-76-2.sh new file mode 100755 index 00000000..4c6aab34 --- /dev/null +++ b/test/script/session/session-76-2.sh @@ -0,0 +1,58 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +RealServer1=RealServer1 +RealServer1_ADDR=[::1] +RealServer1_PORT=50001 +start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT -l ${L7VS_LOG_DIR}/session-76-2-real1-access.log -i +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd RealServer1" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t [::1]:40001 -m sessionless +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t [::1]:40001 -m sessionless" + exit 1 +fi + +$L7VSADM -a -t [::1]:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -M +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -a -t [::1]:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -M" + exit 1 +fi + +#Connect +ifconfig lo add ::5 +RET=`curl -g --retry 0 --interface ::5 http://[::1]:40001/` +if [ "${RET}" != "${RealServer1}" ] +then + echo "curl --retry 0 --interface ::5 http://[::1]:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-76-2-real1-access.log | awk '{print $1}'` +EXPECT="::1" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-76-2-real1-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-77-1.sh b/test/script/session/session-77-1.sh new file mode 100755 index 00000000..cd28a776 --- /dev/null +++ b/test/script/session/session-77-1.sh @@ -0,0 +1,57 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +RealServer1=RealServer1 +RealServer1_ADDR=127.0.0.1 +RealServer1_PORT=50001 +start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT -l ${L7VS_LOG_DIR}/session-77-real1-access.log +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd RealServer1" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t 127.0.0.1:40001 -m sessionless +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless" + exit 1 +fi + +$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -T +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -T" + exit 1 +fi + +#Connect +RET=`curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/` +if [ "${RET}" != "${RealServer1}" ] +then + echo "curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-77-real1-access.log | awk '{print $1}'` +EXPECT="127.0.0.5" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-77-real1-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-77-2.sh b/test/script/session/session-77-2.sh new file mode 100755 index 00000000..688637d3 --- /dev/null +++ b/test/script/session/session-77-2.sh @@ -0,0 +1,58 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +RealServer1=RealServer1 +RealServer1_ADDR=[::1] +RealServer1_PORT=50001 +start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT -l ${L7VS_LOG_DIR}/session-77-2-real1-access.log -i +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd RealServer1" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t [::1]:40001 -m sessionless +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t [::1]:40001 -m sessionless" + exit 1 +fi + +$L7VSADM -a -t [::1]:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -T +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -a -t [::1]:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -T" + exit 1 +fi + +#Connect +ifconfig lo add ::5 +RET=`curl -g --retry 0 --interface ::5 http://[::1]:40001/` +if [ "${RET}" != "${RealServer1}" ] +then + echo "curl --retry 0 --interface ::5 http://[::1]:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-77-2-real1-access.log | awk '{print $1}'` +EXPECT="::5" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-77-2-real1-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-78-1.sh b/test/script/session/session-78-1.sh new file mode 100755 index 00000000..557b1d7d --- /dev/null +++ b/test/script/session/session-78-1.sh @@ -0,0 +1,51 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +SorryServer=SorryServer +SorryServer_ADDR=127.0.0.1 +SorryServer_PORT=50001 +start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT -l ${L7VS_LOG_DIR}/session-78-sorry-access.log +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd SorryServer" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -M +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -M +" + exit 1 +fi + +#Connect +RET=`curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/` +if [ "${RET}" != "${SorryServer}" ] +then + echo "curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-78-sorry-access.log | awk '{print $1}'` +EXPECT="127.0.0.1" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-78-sorry-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-78-2.sh b/test/script/session/session-78-2.sh new file mode 100755 index 00000000..720e5f90 --- /dev/null +++ b/test/script/session/session-78-2.sh @@ -0,0 +1,52 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +SorryServer=SorryServer +SorryServer_ADDR=[::1] +SorryServer_PORT=50001 +start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT -l ${L7VS_LOG_DIR}/session-78-2-sorry-access.log -i +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd SorryServer" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t [::1]:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -M +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t [::1]:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -M +" + exit 1 +fi + +#Connect +ifconfig lo add ::5 +RET=`curl -g --retry 0 --interface ::5 http://[::1]:40001/` +if [ "${RET}" != "${SorryServer}" ] +then + echo "curl --retry 0 --interface ::5 http://[::1]:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-78-2-sorry-access.log | awk '{print $1}'` +EXPECT="::1" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-78-2-sorry-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-79-1.sh b/test/script/session/session-79-1.sh new file mode 100755 index 00000000..721c79a2 --- /dev/null +++ b/test/script/session/session-79-1.sh @@ -0,0 +1,51 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +SorryServer=SorryServer +SorryServer_ADDR=127.0.0.1 +SorryServer_PORT=50001 +start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT -l ${L7VS_LOG_DIR}/session-79-sorry-access.log +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd SorryServer" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -T +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -T +" + exit 1 +fi + +#Connect +RET=`curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/` +if [ "${RET}" != "${SorryServer}" ] +then + echo "curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-79-sorry-access.log | awk '{print $1}'` +EXPECT="127.0.0.5" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-79-sorry-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-79-2.sh b/test/script/session/session-79-2.sh new file mode 100755 index 00000000..f4dc18c4 --- /dev/null +++ b/test/script/session/session-79-2.sh @@ -0,0 +1,52 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +SorryServer=SorryServer +SorryServer_ADDR=[::1] +SorryServer_PORT=50001 +start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT -l ${L7VS_LOG_DIR}/session-79-2-sorry-access.log -i +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd SorryServer" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t [::1]:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -T +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t [::1]:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -T +" + exit 1 +fi + +#Connect +ifconfig lo add ::5 +RET=`curl -g --retry 0 --interface ::5 http://[::1]:40001/` +if [ "${RET}" != "${SorryServer}" ] +then + echo "curl --retry 0 --interface ::5 http://[::1]:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-79-2-sorry-access.log | awk '{print $1}'` +EXPECT="::5" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-79-2-sorry-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-80-1.sh b/test/script/session/session-80-1.sh new file mode 100755 index 00000000..8d03d992 --- /dev/null +++ b/test/script/session/session-80-1.sh @@ -0,0 +1,57 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +RealServer1=RealServer1 +RealServer1_ADDR=127.0.0.1 +RealServer1_PORT=50001 +start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT -l ${L7VS_LOG_DIR}/session-80-real1-access.log +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd RealServer1" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t 127.0.0.1:40001 -m sessionless -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless" + exit 1 +fi + +$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -M +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -M" + exit 1 +fi + +#Connect +RET=`curl --retry 0 -k --interface 127.0.0.5 https://127.0.0.1:40001/` +if [ "${RET}" != "${RealServer1}" ] +then + echo "curl --retry 0 -k --interface 127.0.0.5 https://127.0.0.1:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-80-real1-access.log | awk '{print $1}'` +EXPECT="127.0.0.1" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-80-real1-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-80-2.sh b/test/script/session/session-80-2.sh new file mode 100755 index 00000000..14bf2942 --- /dev/null +++ b/test/script/session/session-80-2.sh @@ -0,0 +1,58 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +RealServer1=RealServer1 +RealServer1_ADDR=[::1] +RealServer1_PORT=50001 +start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT -l ${L7VS_LOG_DIR}/session-80-2-real1-access.log -i +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd RealServer1" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t [::1]:40001 -m sessionless -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t [::1]:40001 -m sessionless" + exit 1 +fi + +$L7VSADM -a -t [::1]:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -M +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -a -t [::1]:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -M" + exit 1 +fi + +#Connect +ifconfig lo add ::5 +RET=`curl -g --retry 0 -k --interface ::5 https://[::1]:40001/` +if [ "${RET}" != "${RealServer1}" ] +then + echo "curl --retry 0 -k --interface 127.0.0.5 https://[::1]:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-80-2-real1-access.log | awk '{print $1}'` +EXPECT="::1" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-80-2-real1-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-81-1.sh b/test/script/session/session-81-1.sh new file mode 100755 index 00000000..756b82cb --- /dev/null +++ b/test/script/session/session-81-1.sh @@ -0,0 +1,57 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +RealServer1=RealServer1 +RealServer1_ADDR=127.0.0.1 +RealServer1_PORT=50001 +start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT -l ${L7VS_LOG_DIR}/session-81-real1-access.log +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd RealServer1" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t 127.0.0.1:40001 -m sessionless -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless" + exit 1 +fi + +$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -T +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -T" + exit 1 +fi + +#Connect +RET=`curl --retry 0 -k --interface 127.0.0.5 https://127.0.0.1:40001/` +if [ "${RET}" != "${RealServer1}" ] +then + echo "curl --retry 0 -k --interface 127.0.0.5 https://127.0.0.1:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-81-real1-access.log | awk '{print $1}'` +EXPECT="127.0.0.5" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-81-real1-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-81-2.sh b/test/script/session/session-81-2.sh new file mode 100755 index 00000000..da92b3bb --- /dev/null +++ b/test/script/session/session-81-2.sh @@ -0,0 +1,58 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +RealServer1=RealServer1 +RealServer1_ADDR=[::1] +RealServer1_PORT=50001 +start_lighttpd -s $RealServer1 -a $RealServer1_ADDR -p $RealServer1_PORT -l ${L7VS_LOG_DIR}/session-81-2-real1-access.log -i +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd RealServer1" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t [::1]:40001 -m sessionless -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t [::1]:40001 -m sessionless" + exit 1 +fi + +$L7VSADM -a -t [::1]:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -T +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -a -t [::1]:40001 -m sessionless -r ${RealServer1_ADDR}:${RealServer1_PORT} -T" + exit 1 +fi + +#Connect +ifconfig lo add ::5 +RET=`curl -g --retry 0 -k --interface ::5 https://[::1]:40001/` +if [ "${RET}" != "${RealServer1}" ] +then + echo "curl --retry 0 -k --interface 127.0.0.5 https://[::1]:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-81-2-real1-access.log | awk '{print $1}'` +EXPECT="::5" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-81-2-real1-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-82-1.sh b/test/script/session/session-82-1.sh new file mode 100755 index 00000000..782ae006 --- /dev/null +++ b/test/script/session/session-82-1.sh @@ -0,0 +1,50 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +SorryServer=SorryServer +SorryServer_ADDR=127.0.0.1 +SorryServer_PORT=50001 +start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT -l ${L7VS_LOG_DIR}/session-82-sorry-access.log +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd SorryServer" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -M -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -M -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf" + exit 1 +fi + +#Connect +RET=`curl --retry 0 -k --interface 127.0.0.5 https://127.0.0.1:40001/` +if [ "${RET}" != "${SorryServer}" ] +then + echo "curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-82-sorry-access.log | awk '{print $1}'` +EXPECT="127.0.0.1" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-82-sorry-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-82-2.sh b/test/script/session/session-82-2.sh new file mode 100755 index 00000000..784e0155 --- /dev/null +++ b/test/script/session/session-82-2.sh @@ -0,0 +1,51 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +SorryServer=SorryServer +SorryServer_ADDR=[::1] +SorryServer_PORT=50001 +start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT -l ${L7VS_LOG_DIR}/session-82-2-sorry-access.log -i +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd SorryServer" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t [::1]:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -M -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t [::1]:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -M -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf" + exit 1 +fi + +#Connect +ifconfig lo add ::5 +RET=`curl -g --retry 0 -k --interface ::5 https://[::1]:40001/` +if [ "${RET}" != "${SorryServer}" ] +then + echo "curl -g --retry 0 --interface 127.0.0.5 http://[::1]:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-82-2-sorry-access.log | awk '{print $1}'` +EXPECT="::1" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-82-2-sorry-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-83-1.sh b/test/script/session/session-83-1.sh new file mode 100755 index 00000000..fe2455e4 --- /dev/null +++ b/test/script/session/session-83-1.sh @@ -0,0 +1,50 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +SorryServer=SorryServer +SorryServer_ADDR=127.0.0.1 +SorryServer_PORT=50001 +start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT -l ${L7VS_LOG_DIR}/session-83-sorry-access.log +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd SorryServer" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -T -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -T -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf" + exit 1 +fi + +#Connect +RET=`curl --retry 0 -k --interface 127.0.0.5 https://127.0.0.1:40001/` +if [ "${RET}" != "${SorryServer}" ] +then + echo "curl --retry 0 --interface 127.0.0.5 http://127.0.0.1:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-83-sorry-access.log | awk '{print $1}'` +EXPECT="127.0.0.5" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-83-sorry-access.log" + exit 1 +fi + +exit 0 + diff --git a/test/script/session/session-83-2.sh b/test/script/session/session-83-2.sh new file mode 100755 index 00000000..c9f7645b --- /dev/null +++ b/test/script/session/session-83-2.sh @@ -0,0 +1,51 @@ +#!/bin/bash +. ${SET_DEFAULT_CONF} + +#Run http server +SorryServer=SorryServer +SorryServer_ADDR=[::1] +SorryServer_PORT=50001 +start_lighttpd -s $SorryServer -a $SorryServer_ADDR -p $SorryServer_PORT -l ${L7VS_LOG_DIR}/session-83-2-sorry-access.log -i +if [ $? -ne 0 ] +then + echo "Test failed: start_lighttpd SorryServer" + exit 1 +fi + +# Start l7vsd +$L7VSD +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSD" + exit 1 +fi +usleep 100000 + +# Add service +$L7VSADM -A -t [::1]:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -T -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf +if [ $? -ne 0 ] +then + echo "Test failed: $L7VSADM -A -t [::1]:40001 -m sessionless -b ${SorryServer_ADDR}:${SorryServer_PORT} -T -z $L7VSD_CONF_DIR/sslproxy/sslproxy.target.cf" + exit 1 +fi + +#Connect +ifconfig lo add ::5 +RET=`curl -g --retry 0 -k --interface ::5 https://[::1]:40001/` +if [ "${RET}" != "${SorryServer}" ] +then + echo "curl -g --retry 0 --interface 127.0.0.5 http://[::1]:40001/" + exit 1 +fi + +#Check access logs +RET=`cat ${L7VS_LOG_DIR}/session-83-2-sorry-access.log | awk '{print $1}'` +EXPECT="::5" +if [ "$RET" != "$EXPECT" ] +then + echo "Test failed: ${L7VS_LOG_DIR}/session-83-2-sorry-access.log" + exit 1 +fi + +exit 0 + -- 2.11.0