Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
c4629a0f
Commit
c4629a0f
authored
Nov 28, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to test for the non-definition of a http header.
Fixes #1062
parent
cd6f804c
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
41 additions
and
28 deletions
+41
-28
a00012.vtc
bin/varnishtest/tests/a00012.vtc
+13
-0
c00016.vtc
bin/varnishtest/tests/c00016.vtc
+2
-2
e00024.vtc
bin/varnishtest/tests/e00024.vtc
+1
-1
e00025.vtc
bin/varnishtest/tests/e00025.vtc
+1
-1
g00001.vtc
bin/varnishtest/tests/g00001.vtc
+3
-3
g00002.vtc
bin/varnishtest/tests/g00002.vtc
+2
-2
g00003.vtc
bin/varnishtest/tests/g00003.vtc
+3
-3
r00292.vtc
bin/varnishtest/tests/r00292.vtc
+3
-3
r00466.vtc
bin/varnishtest/tests/r00466.vtc
+1
-1
r00494.vtc
bin/varnishtest/tests/r00494.vtc
+2
-2
r00693.vtc
bin/varnishtest/tests/r00693.vtc
+3
-3
r00861.vtc
bin/varnishtest/tests/r00861.vtc
+2
-2
r00980.vtc
bin/varnishtest/tests/r00980.vtc
+1
-1
vtc_http.c
bin/varnishtest/vtc_http.c
+4
-4
No files found.
bin/varnishtest/tests/a00012.vtc
0 → 100644
View file @
c4629a0f
varnishtest "Ensure that we can test non-existence of headers (#1062)"
server s1 {
rxreq
txresp
} -start
client c1 -connect ${s1_sock} {
txreq
rxresp
expect resp.http.X-Test == <undef>
} -run
bin/varnishtest/tests/c00016.vtc
View file @
c4629a0f
...
@@ -8,7 +8,7 @@ server s1 {
...
@@ -8,7 +8,7 @@ server s1 {
rxreq
rxreq
expect req.url == "/bar"
expect req.url == "/bar"
expect req.http.Foo ==
"req.http.Foo"
expect req.http.Foo ==
<undef>
txresp -hdr "Bar: fnry,glyf, FOO ,brok" -hdr "Connection: bar" -body "foobar"
txresp -hdr "Bar: fnry,glyf, FOO ,brok" -hdr "Connection: bar" -body "foobar"
} -start
} -start
...
@@ -21,5 +21,5 @@ client c1 {
...
@@ -21,5 +21,5 @@ client c1 {
txreq -url "/bar" -hdr "Foo: bar2" -hdr "Connection: foo, close"
txreq -url "/bar" -hdr "Foo: bar2" -hdr "Connection: foo, close"
rxresp
rxresp
expect req.http.Bar ==
"req.http.Bar"
expect req.http.Bar ==
<undef>
} -run
} -run
bin/varnishtest/tests/e00024.vtc
View file @
c4629a0f
...
@@ -81,7 +81,7 @@ client c1 {
...
@@ -81,7 +81,7 @@ client c1 {
txreq
txreq
rxresp
rxresp
expect resp.http.content-encoding ==
resp.http.content-encoding
expect resp.http.content-encoding ==
<undef>
expect resp.status == 200
expect resp.status == 200
expect resp.bodylen == 252
expect resp.bodylen == 252
} -run
} -run
...
...
bin/varnishtest/tests/e00025.vtc
View file @
c4629a0f
...
@@ -18,7 +18,7 @@ client c1 {
...
@@ -18,7 +18,7 @@ client c1 {
txreq
txreq
rxresp
rxresp
expect resp.http.content-encoding ==
resp.http.content-encoding
expect resp.http.content-encoding ==
<undef>
expect resp.status == 200
expect resp.status == 200
expect resp.bodylen == 3
expect resp.bodylen == 3
} -run
} -run
bin/varnishtest/tests/g00001.vtc
View file @
c4629a0f
...
@@ -13,7 +13,7 @@ client c1 {
...
@@ -13,7 +13,7 @@ client c1 {
txreq
txreq
rxresp
rxresp
expect resp.bodylen == "3"
expect resp.bodylen == "3"
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
txreq -hdr "Accept-encoding: gzip;q=0.1"
txreq -hdr "Accept-encoding: gzip;q=0.1"
rxresp
rxresp
...
@@ -26,13 +26,13 @@ client c1 {
...
@@ -26,13 +26,13 @@ client c1 {
txreq -proto HTTP/1.0
txreq -proto HTTP/1.0
rxresp
rxresp
expect resp.bodylen == "3"
expect resp.bodylen == "3"
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
} -run
} -run
client c1 {
client c1 {
txreq -req HEAD
txreq -req HEAD
rxresp -no_obj
rxresp -no_obj
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
txreq -req HEAD -hdr "Accept-encoding: gzip;q=0.1"
txreq -req HEAD -hdr "Accept-encoding: gzip;q=0.1"
rxresp -no_obj
rxresp -no_obj
...
...
bin/varnishtest/tests/g00002.vtc
View file @
c4629a0f
...
@@ -39,12 +39,12 @@ client c1 {
...
@@ -39,12 +39,12 @@ client c1 {
# See varnish can gunzip it.
# See varnish can gunzip it.
txreq -url /foo -hdr "Accept-Encoding: null"
txreq -url /foo -hdr "Accept-Encoding: null"
rxresp
rxresp
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
expect resp.bodylen == 4100
expect resp.bodylen == 4100
# See varnish can gunzip it, inside ESI
# See varnish can gunzip it, inside ESI
txreq -url /bar -hdr "Accept-Encoding: null"
txreq -url /bar -hdr "Accept-Encoding: null"
rxresp
rxresp
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
expect resp.bodylen == 4109
expect resp.bodylen == 4109
} -run
} -run
bin/varnishtest/tests/g00003.vtc
View file @
c4629a0f
...
@@ -30,12 +30,12 @@ varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
...
@@ -30,12 +30,12 @@ varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
client c1 {
client c1 {
txreq -url /foo -hdr "Accept-Encoding: gzip"
txreq -url /foo -hdr "Accept-Encoding: gzip"
rxresp
rxresp
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
expect resp.bodylen == 41
expect resp.bodylen == 41
txreq -url /bar -hdr "Accept-Encoding: gzip"
txreq -url /bar -hdr "Accept-Encoding: gzip"
rxresp
rxresp
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
expect resp.bodylen == 42
expect resp.bodylen == 42
txreq -url /foobar -hdr "Accept-Encoding: gzip"
txreq -url /foobar -hdr "Accept-Encoding: gzip"
...
@@ -46,6 +46,6 @@ client c1 {
...
@@ -46,6 +46,6 @@ client c1 {
txreq -url /foobar
txreq -url /foobar
rxresp
rxresp
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
expect resp.bodylen == 43
expect resp.bodylen == 43
} -run
} -run
bin/varnishtest/tests/r00292.vtc
View file @
c4629a0f
...
@@ -6,11 +6,11 @@ varnishtest "Header deletion test"
...
@@ -6,11 +6,11 @@ varnishtest "Header deletion test"
server s1 {
server s1 {
rxreq
rxreq
expect req.url == "/foo"
expect req.url == "/foo"
expect req.http.hdr1 ==
"req.http.hdr1"
expect req.http.hdr1 ==
<undef>
expect req.http.hdr2 == "2"
expect req.http.hdr2 == "2"
expect req.http.hdr3 ==
"req.http.hdr3"
expect req.http.hdr3 ==
<undef>
expect req.http.hdr4 == "4"
expect req.http.hdr4 == "4"
expect req.http.hdr5 ==
"req.http.hdr5"
expect req.http.hdr5 ==
<undef>
expect req.http.hdr6 == "6"
expect req.http.hdr6 == "6"
txresp -body "foobar"
txresp -body "foobar"
} -start
} -start
...
...
bin/varnishtest/tests/r00466.vtc
View file @
c4629a0f
...
@@ -3,7 +3,7 @@ varnishtest "Check Range forwarding to backend"
...
@@ -3,7 +3,7 @@ varnishtest "Check Range forwarding to backend"
server s1 {
server s1 {
rxreq
rxreq
expect req.url == "/foo"
expect req.url == "/foo"
expect req.http.range ==
"req.http.range"
expect req.http.range ==
<undef>
txresp \
txresp \
-hdr "Foobar: _barf_" \
-hdr "Foobar: _barf_" \
-body "012345\n"
-body "012345\n"
...
...
bin/varnishtest/tests/r00494.vtc
View file @
c4629a0f
...
@@ -19,6 +19,6 @@ client c1 {
...
@@ -19,6 +19,6 @@ client c1 {
txreq
txreq
rxresp
rxresp
expect resp.http.bar == "bar, barf: fail"
expect resp.http.bar == "bar, barf: fail"
expect resp.http.barf ==
resp.http.barf
expect resp.http.barf ==
<undef>
expect resp.http.foo ==
resp.http.foo
expect resp.http.foo ==
<undef>
} -run
} -run
bin/varnishtest/tests/r00693.vtc
View file @
c4629a0f
...
@@ -4,11 +4,11 @@ feature 64bit
...
@@ -4,11 +4,11 @@ feature 64bit
server s1 {
server s1 {
rxreq
rxreq
expect req.http.baz ==
"req.http.baz"
expect req.http.baz ==
<undef>
txresp -status 201
txresp -status 201
rxreq
rxreq
expect req.http.baz ==
"req.http.baz"
expect req.http.baz ==
<undef>
txresp -status 202
txresp -status 202
rxreq
rxreq
...
@@ -52,7 +52,7 @@ varnish v1 -arg "-p sess_workspace=1024" -vcl+backend {
...
@@ -52,7 +52,7 @@ varnish v1 -arg "-p sess_workspace=1024" -vcl+backend {
"0123456789abcdef" + "0123456789abcdef" +
"0123456789abcdef" + "0123456789abcdef" +
"0123456789abcdef" + "0123456789abcdef" +
"0123456789abcdef" + "0123456789abcdef" +
"0123456789abcdef" +
"0123456789abcdef" +
"0123456
7
";
"0123456";
set req.http.baz = "BAZ";
set req.http.baz = "BAZ";
return (pass);
return (pass);
}
}
...
...
bin/varnishtest/tests/r00861.vtc
View file @
c4629a0f
...
@@ -34,12 +34,12 @@ varnish v1 \
...
@@ -34,12 +34,12 @@ varnish v1 \
client c1 {
client c1 {
txreq -url "/1"
txreq -url "/1"
rxresp
rxresp
expect resp.http.Content-Encoding ==
resp.http.Content-Encoding
expect resp.http.Content-Encoding ==
<undef>
expect resp.bodylen == 22
expect resp.bodylen == 22
txreq -url "/barf" -hdr "Accept-Encoding: gzip"
txreq -url "/barf" -hdr "Accept-Encoding: gzip"
rxresp
rxresp
expect resp.http.Content-Encoding ==
resp.http.Content-Encoding
expect resp.http.Content-Encoding ==
<undef>
expect resp.bodylen == 909
expect resp.bodylen == 909
txreq -url "/2" -hdr "Accept-Encoding: gzip"
txreq -url "/2" -hdr "Accept-Encoding: gzip"
...
...
bin/varnishtest/tests/r00980.vtc
View file @
c4629a0f
...
@@ -24,6 +24,6 @@ client c1 {
...
@@ -24,6 +24,6 @@ client c1 {
txreq -url /foobar
txreq -url /foobar
rxresp
rxresp
expect resp.http.content-encoding ==
"resp.http.content-encoding"
expect resp.http.content-encoding ==
<undef>
expect resp.bodylen == 43
expect resp.bodylen == 43
} -run
} -run
bin/varnishtest/vtc_http.c
View file @
c4629a0f
...
@@ -169,7 +169,7 @@ http_find_header(char * const *hh, const char *hdr)
...
@@ -169,7 +169,7 @@ http_find_header(char * const *hh, const char *hdr)
* Expect
* Expect
*/
*/
static
char
*
static
c
onst
c
har
*
cmd_var_resolve
(
struct
http
*
hp
,
char
*
spec
)
cmd_var_resolve
(
struct
http
*
hp
,
char
*
spec
)
{
{
char
**
hh
,
*
hdr
;
char
**
hh
,
*
hdr
;
...
@@ -201,16 +201,16 @@ cmd_var_resolve(struct http *hp, char *spec)
...
@@ -201,16 +201,16 @@ cmd_var_resolve(struct http *hp, char *spec)
hdr
=
http_find_header
(
hh
,
hdr
);
hdr
=
http_find_header
(
hh
,
hdr
);
if
(
hdr
!=
NULL
)
if
(
hdr
!=
NULL
)
return
(
hdr
);
return
(
hdr
);
return
(
spec
);
return
(
"<undef>"
);
}
}
static
void
static
void
cmd_http_expect
(
CMD_ARGS
)
cmd_http_expect
(
CMD_ARGS
)
{
{
struct
http
*
hp
;
struct
http
*
hp
;
char
*
lhs
;
c
onst
c
har
*
lhs
;
char
*
cmp
;
char
*
cmp
;
char
*
rhs
;
c
onst
c
har
*
rhs
;
(
void
)
cmd
;
(
void
)
cmd
;
(
void
)
vl
;
(
void
)
vl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment