-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from duffn/duffn/null-function-tests
Add tests for null params for inclusion and exclusion fuctions
- Loading branch information
Showing
4 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
varnishtest "Test querymodifier vmod for null params using the excludeparams function" | ||
|
||
server s1 { | ||
rxreq | ||
txresp -body "OK1" | ||
expect req.url == "/feed/" | ||
} -start | ||
|
||
varnish v1 -vcl+backend { | ||
import std; | ||
import querymodifier; | ||
|
||
sub vcl_recv { | ||
std.syslog(180, "querymodifier before: " + req.url); | ||
set req.url = querymodifier.excludeparams(url=req.url, params=""); | ||
std.syslog(180, "querymodifier after: " + req.url); | ||
} | ||
} -start | ||
|
||
client c1 { | ||
txreq -url "/feed/?id=1&d=2&another=3" | ||
rxresp | ||
expect resp.status == 200 | ||
} -run | ||
|
||
varnish v1 -expect n_object == 1 | ||
varnish v1 -expect cache_miss == 1 | ||
varnish v1 -expect cache_hit == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
varnishtest "Test querymodifier vmod for null params using the includeparams function" | ||
|
||
server s1 { | ||
rxreq | ||
txresp -body "OK1" | ||
expect req.url == "/feed/" | ||
} -start | ||
|
||
varnish v1 -vcl+backend { | ||
import std; | ||
import querymodifier; | ||
|
||
sub vcl_recv { | ||
std.syslog(180, "querymodifier before: " + req.url); | ||
set req.url = querymodifier.includeparams(url=req.url, params=""); | ||
std.syslog(180, "querymodifier after: " + req.url); | ||
} | ||
} -start | ||
|
||
client c1 { | ||
txreq -url "/feed/?id=1&d=2&another=3" | ||
rxresp | ||
expect resp.status == 200 | ||
|
||
txreq -url "/feed/" | ||
rxresp | ||
expect resp.status == 200 | ||
} -run | ||
|
||
varnish v1 -expect n_object == 1 | ||
varnish v1 -expect cache_miss == 1 | ||
varnish v1 -expect cache_hit == 1 |