summaryrefslogtreecommitdiffstats
path: root/reg-tests/sample_fetches
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:11:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:11:10 +0000
commitcff6d757e3ba609c08ef2aaa00f07e53551e5bf6 (patch)
tree08c4fc3255483ad397d712edb4214ded49149fd9 /reg-tests/sample_fetches
parentAdding upstream version 2.9.7. (diff)
downloadhaproxy-cff6d757e3ba609c08ef2aaa00f07e53551e5bf6.tar.xz
haproxy-cff6d757e3ba609c08ef2aaa00f07e53551e5bf6.zip
Adding upstream version 3.0.0.upstream/3.0.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'reg-tests/sample_fetches')
-rw-r--r--reg-tests/sample_fetches/acl.vtc35
1 files changed, 35 insertions, 0 deletions
diff --git a/reg-tests/sample_fetches/acl.vtc b/reg-tests/sample_fetches/acl.vtc
new file mode 100644
index 0000000..905ae3e
--- /dev/null
+++ b/reg-tests/sample_fetches/acl.vtc
@@ -0,0 +1,35 @@
+varnishtest "Test acl() sample fetch"
+feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.9-dev2)'"
+
+feature ignore_unknown_macro
+
+haproxy h1 -conf {
+ defaults
+ mode http
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
+
+ frontend fe1
+ bind "fd@${fe1}"
+
+ acl ACL1 always_true
+ acl ACL2 acl(ACL1)
+ acl ACL3 acl(!ACL2)
+ acl ACL4 acl(ACL2,!ACL3)
+
+ http-request return status 200 hdr x-acl "ACL1=%[acl(ACL1)] ACL2=%[acl(ACL2)] ACL3=%[acl(ACL3)] ACL4=%[acl(ACL4)] TRUE=%[acl(TRUE)]"
+
+ log-format ACL1=%[acl(ACL1)]
+} -start
+
+client c1 -connect ${h1_fe1_sock} {
+ txreq -req GET -url /
+ rxresp
+ expect resp.status == 200
+ expect resp.http.x-acl ~ "ACL1=1"
+ expect resp.http.x-acl ~ "ACL2=1"
+ expect resp.http.x-acl ~ "ACL3=0"
+ expect resp.http.x-acl ~ "ACL4=1"
+ expect resp.http.x-acl ~ "TRUE=1"
+} -run