diff options
Diffstat (limited to 'tests/test03.vtc')
-rw-r--r-- | tests/test03.vtc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test03.vtc b/tests/test03.vtc new file mode 100644 index 0000000..052b4ed --- /dev/null +++ b/tests/test03.vtc | |||
@@ -0,0 +1,23 @@ | |||
1 | varnishtest "Test basic HTTP authentication: SHA1" | ||
2 | |||
3 | server s1 { | ||
4 | rxreq | ||
5 | txresp | ||
6 | } -start | ||
7 | |||
8 | varnish v1 -vcl+backend { | ||
9 | import basicauth from "${vmod_topbuild}/src/.libs/libvmod_basicauth.so"; | ||
10 | sub vcl_deliver { | ||
11 | set resp.http.result = basicauth.match("${vmod_topsrc}/tests/htpasswd", "Basic bWV0aG9kLXNoYTE6Z3Vlc3NtZS1zaGEx"); | ||
12 | } | ||
13 | } -start | ||
14 | |||
15 | client c1 { | ||
16 | txreq -url "/" | ||
17 | rxresp | ||
18 | expect resp.http.result == true | ||
19 | } | ||
20 | |||
21 | client c1 -run | ||
22 | |||
23 | |||