aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-01-20 14:10:33 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-01-20 14:10:33 +0200
commit741817ac5372c374b52b710dd8a4b0cc463ade99 (patch)
tree46343899a7e7249c8306e227a59dabc4e9e04dec /tests
parent67731a160cc7c3e090236316af459f695593fc55 (diff)
downloadvmod-tbf-741817ac5372c374b52b710dd8a4b0cc463ade99.tar.gz
vmod-tbf-741817ac5372c374b52b710dd8a4b0cc463ade99.tar.bz2
Drop support for Varnish 3
* configure.ac: Use pkg-config. Save Varnishapi version in VARNISHAPI_MAJOR, VARNISHAPI_MINOR, VARNISHAPI_PATCH Refuse to run if it is prior to 4.1 * src/Makefile.am: Remove conditionals * src/tbf.h: Remove Varnish 3.0 defines * src/vmod-tbf.3: Update * tests/Makefile.am: Remove conditionals * tests/test00.vti: Rename to tests/test00.vtc * tests/test02.vti: Rename to tests/test02.vtc
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am21
-rw-r--r--tests/test00.vtc (renamed from tests/test00.vti)8
-rw-r--r--tests/test02.vtc (renamed from tests/test02.vti)8
3 files changed, 9 insertions, 28 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c252b02..3c80a55 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,29 +14,14 @@
# You should have received a copy of the GNU General Public License
# along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>.
-VMOD_VTC = \
- test01.vtc\
- test03.vtc\
- time00.vtc
-
-VMOD_VTI = \
- test00.vti\
- test02.vti
-
-BUILT_TESTS = $(VMOD_VTI:.vti=.vtc)
-
VMOD_TESTS = \
- test00.vti\
+ test00.vtc\
test01.vtc\
- test02.vti\
+ test02.vtc\
test03.vtc\
time00.vtc
-.vti.vtc:
- sed 's/^#VARNISH$(VARNISHVERSION)#//' $< > $@
-
-EXTRA_DIST=$(VMOD_VTC) $(VMOD_VTI)
-CLEANFILES=$(BUILT_TESTS)
+EXTRA_DIST=$(VMOD_TESTS)
distclean-local:
rm -fr tbf
diff --git a/tests/test00.vti b/tests/test00.vtc
index 53b9049..54c0281 100644
--- a/tests/test00.vti
+++ b/tests/test00.vtc
@@ -1,5 +1,5 @@
# This file is part of vmod-tbf
-# Copyright (C) 2013-2014 Sergey Poznyakoff
+# Copyright (C) 2013-2016 Sergey Poznyakoff
#
# Vmod-tbf is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,11 +31,9 @@ varnish v1 -vcl+backend {
}
sub vcl_recv {
if (!tbf.rate("url:"+req.url, 1, 20 s, 5)) {
-#VARNISH3# error 420 "Overlimit";
-#VARNISH4# return (synth(420, "Overlimit"));
+ return (synth(420, "Overlimit"));
}
-#VARNISH3# return (lookup);
-#VARNISH4# return (hash);
+ return (hash);
}
} -start
diff --git a/tests/test02.vti b/tests/test02.vtc
index ef58fb8..8ff3c51 100644
--- a/tests/test02.vti
+++ b/tests/test02.vtc
@@ -1,5 +1,5 @@
# This file is part of vmod-tbf
-# Copyright (C) 2013-2014 Sergey Poznyakoff
+# Copyright (C) 2013-2016 Sergey Poznyakoff
#
# Vmod-tbf is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,11 +31,9 @@ varnish v1 -vcl+backend {
}
sub vcl_recv {
if (!tbf.check("url:"+req.url, "4 req/s")) {
-#VARNISH3# error 420 "Overlimit";
-#VARNISH4# return (synth(420, "Overlimit"));
+ return (synth(420, "Overlimit"));
}
-#VARNISH3# return (lookup);
-#VARNISH4# return (hash);
+ return (hash);
}
} -start

Return to:

Send suggestions and report system problems to the System administrator.