summaryrefslogtreecommitdiffabout
path: root/tests/test03.vtc
Side-by-side diff
Diffstat (limited to 'tests/test03.vtc') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/test03.vtc23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test03.vtc b/tests/test03.vtc
new file mode 100644
index 0000000..052b4ed
--- a/dev/null
+++ b/tests/test03.vtc
@@ -0,0 +1,23 @@
+varnishtest "Test basic HTTP authentication: SHA1"
+
+server s1 {
+ rxreq
+ txresp
+} -start
+
+varnish v1 -vcl+backend {
+ import basicauth from "${vmod_topbuild}/src/.libs/libvmod_basicauth.so";
+ sub vcl_deliver {
+ set resp.http.result = basicauth.match("${vmod_topsrc}/tests/htpasswd", "Basic bWV0aG9kLXNoYTE6Z3Vlc3NtZS1zaGEx");
+ }
+} -start
+
+client c1 {
+ txreq -url "/"
+ rxresp
+ expect resp.http.result == true
+}
+
+client c1 -run
+
+

Return to:

Send suggestions and report system problems to the System administrator.