aboutsummaryrefslogtreecommitdiff
path: root/t/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 't/testsuite')
-rwxr-xr-xt/testsuite42
1 files changed, 35 insertions, 7 deletions
diff --git a/t/testsuite b/t/testsuite
index 69b4325..c4d3333 100755
--- a/t/testsuite
+++ b/t/testsuite
@@ -2,10 +2,9 @@
sourcename=bulkredirect.lua
-while getopts "b:C:p:" OPTION
+while getopts "b:p:" OPTION
do
case $OPTION in
- C) cd $OPTARG || exit 2;;
p) haproxy_port=$OPTARG;;
b) haproxy_bin=$OPTARG;;
*) echo >&2 "$0: usage error"
@@ -202,11 +201,13 @@ fi
set +e
group_header() {
- echo
- echo "# $* #" | sed -e 's/./#/g'
- echo "# $* #"
- echo "# $* #" | sed -e 's/./#/g'
- echo
+ if [ ! -f $numfile ]; then
+ echo
+ echo "# $* #" | sed -e 's/./#/g'
+ echo "# $* #"
+ echo "# $* #" | sed -e 's/./#/g'
+ echo
+ fi
}
# ####################
@@ -378,6 +379,33 @@ runtest \
URL=example.org/e/suffix?q=10 \
HTTP_LOCATION=/E/suffix?q=10
+# ####################
+group_header Query handling
+
+runtest \
+ RTFILE=e.tab \
+ DESCR='Query match' \
+ URL='example.org/first?q=1&com=t' \
+ HTTP_LOCATION='/reg?q=1&com=t'
+
+runtest \
+ RTFILE=e.tab \
+ DESCR='Match without query' \
+ URL='example.org/first' \
+ HTTP_LOCATION='/home'
+
+runtest \
+ RTFILE=e.tab \
+ DESCR='Implicit query stripping' \
+ URL='example.org/second?q=why' \
+ HTTP_LOCATION='/another'
+
+runtest \
+ RTFILE=e.tab \
+ DESCR='Query substitution' \
+ URL='example.org/third?query=true' \
+ HTTP_LOCATION='/com?pp=false&ok=1'
+
echo
echo "Run $(($runtest_success_count + $runtest_failure_count)) tests."
if [ $runtest_failure_count -eq 0 ]; then

Return to:

Send suggestions and report system problems to the System administrator.