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
8ce3713d
Commit
8ce3713d
authored
Aug 01, 2013
by
Joshua Bussdieker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add autogenerated tests and finish quoted string support.
parent
f1b5d3f8
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
234 additions
and
115 deletions
+234
-115
cache_key.c
bin/varnishd/cache/cache_key.c
+36
-1
kc01.vtc
bin/varnishtest/tests/kc01.vtc
+0
-34
x00002.vtc
bin/varnishtest/tests/x00002.vtc
+5
-5
x00003.vtc
bin/varnishtest/tests/x00003.vtc
+5
-5
x00004.vtc
bin/varnishtest/tests/x00004.vtc
+5
-5
x00005.vtc
bin/varnishtest/tests/x00005.vtc
+4
-4
x00006.vtc
bin/varnishtest/tests/x00006.vtc
+5
-5
x00007.vtc
bin/varnishtest/tests/x00007.vtc
+4
-4
x00008.vtc
bin/varnishtest/tests/x00008.vtc
+5
-5
x00009.vtc
bin/varnishtest/tests/x00009.vtc
+4
-4
x00010.vtc
bin/varnishtest/tests/x00010.vtc
+4
-4
x00011.vtc
bin/varnishtest/tests/x00011.vtc
+4
-4
x00012.vtc
bin/varnishtest/tests/x00012.vtc
+4
-4
x00013.vtc
bin/varnishtest/tests/x00013.vtc
+5
-5
x00014.vtc
bin/varnishtest/tests/x00014.vtc
+6
-4
x00015.vtc
bin/varnishtest/tests/x00015.vtc
+6
-4
x00016.vtc
bin/varnishtest/tests/x00016.vtc
+5
-5
x00017.vtc
bin/varnishtest/tests/x00017.vtc
+6
-4
x00018.vtc
bin/varnishtest/tests/x00018.vtc
+6
-4
x00019.vtc
bin/varnishtest/tests/x00019.vtc
+5
-5
x00020.vtc
bin/varnishtest/tests/x00020.vtc
+22
-0
x00021.vtc
bin/varnishtest/tests/x00021.vtc
+22
-0
x00022.vtc
bin/varnishtest/tests/x00022.vtc
+22
-0
x00023.vtc
bin/varnishtest/tests/x00023.vtc
+22
-0
x00024.vtc
bin/varnishtest/tests/x00024.vtc
+22
-0
No files found.
bin/varnishd/cache/cache_key.c
View file @
8ce3713d
...
@@ -219,6 +219,33 @@ int parameter_prefix_matcher(const char *p, const char *fv, int ps, int case_sen
...
@@ -219,6 +219,33 @@ int parameter_prefix_matcher(const char *p, const char *fv, int ps, int case_sen
return
0
;
return
0
;
}
}
int
unescape
(
char
*
dst
,
const
char
*
src
,
int
len
)
{
int
i
,
j
;
i
=
j
=
0
;
while
(
i
<
len
)
{
switch
(
src
[
i
])
{
case
'\\'
:
switch
(
src
[
++
i
])
{
case
'\"'
:
dst
[
j
++
]
=
'\"'
;
i
++
;
break
;
default:
dst
[
j
++
]
=
'\\'
;
dst
[
j
]
=
src
[
i
];
break
;
}
break
;
default:
dst
[
j
]
=
src
[
i
];
i
++
;
j
++
;
break
;
}
}
return
j
;
}
/*
/*
* Find length of a key entry
* Find length of a key entry
*/
*/
...
@@ -291,7 +318,15 @@ KEY_Create(struct busyobj *bo, struct vsb **psb)
...
@@ -291,7 +318,15 @@ KEY_Create(struct busyobj *bo, struct vsb **psb)
error
=
1
;
error
=
1
;
break
;
break
;
}
else
{
}
else
{
VSB_printf
(
sbm
,
"%c%.*s%c"
,
type
,
size
,
match
,
0
);
// Crazy complicated unescape
struct
vsb
*
sbtmp
=
VSB_new_auto
();
AN
(
sbtmp
);
VSB_printf
(
sbtmp
,
"%.*s"
,
size
,
match
);
AZ
(
VSB_finish
(
sbtmp
));
int
ms
=
unescape
(
VSB_data
(
sbtmp
),
VSB_data
(
sbtmp
),
size
);
VSB_printf
(
sbm
,
"%c%.*s%c"
,
type
,
ms
,
VSB_data
(
sbtmp
),
0
);
VSB_delete
(
sbtmp
);
q
+=
read
;
q
+=
read
;
}
}
}
}
...
...
bin/varnishtest/tests/kc01.vtc
deleted
100644 → 0
View file @
f1b5d3f8
varnishtest "Test Key matcher functionality (CASE)"
server s1 {
rxreq
txresp -hdr "Key: Foobar;b=\"A\""
rxreq
txresp -hdr "Key: Foobar;c;b=\"B\""
rxreq
txresp -hdr "Key: Foobar;c;b=\"B\""
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq -hdr "Foobar: Apple"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar: ardvark"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
txreq -hdr "Foobar: Ball"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1004"
txreq -hdr "Foobar: brick"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1006"
} -run
bin/varnishtest/tests/x00002.vtc
View file @
8ce3713d
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;
w
=\"a\""
txresp -hdr "Key: Foobar;
b
=\"a\""
rxreq
rxreq
txresp -hdr "Key: Foobar;
w
=\"a\""
txresp -hdr "Key: Foobar;
b
=\"a\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
b
"
txreq -hdr "Foobar:
Apple
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
b
"
txreq -hdr "Foobar:
Apple
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003"
expect resp.http.X-Varnish == "1003
1002
"
} -run
} -run
bin/varnishtest/tests/x00003.vtc
View file @
8ce3713d
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;
c;w
=\"a\""
txresp -hdr "Key: Foobar;
b
=\"a\""
rxreq
rxreq
txresp -hdr "Key: Foobar;
c;w
=\"a\""
txresp -hdr "Key: Foobar;
b
=\"a\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
A
"
txreq -hdr "Foobar:
ardvark
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
A
"
txreq -hdr "Foobar:
ardvark
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003"
expect resp.http.X-Varnish == "1003
1002
"
} -run
} -run
bin/varnishtest/tests/x00004.vtc
View file @
8ce3713d
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;
n;w
=\"a\""
txresp -hdr "Key: Foobar;
c;b
=\"a\""
rxreq
rxreq
txresp -hdr "Key: Foobar;
n;w
=\"a\""
txresp -hdr "Key: Foobar;
c;b
=\"a\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
b
"
txreq -hdr "Foobar:
Apple
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
b
"
txreq -hdr "Foobar:
Apple
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003
1002
"
expect resp.http.X-Varnish == "1003"
} -run
} -run
bin/varnishtest/tests/x00005.vtc
View file @
8ce3713d
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;
w=\"a\";n;w=\"b
\""
txresp -hdr "Key: Foobar;
c;b=\"a
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;
w=\"a\";n;w=\"b
\""
txresp -hdr "Key: Foobar;
c;b=\"a
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar: a
, c
"
txreq -hdr "Foobar: a
rdvark
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar: a
, c
"
txreq -hdr "Foobar: a
rdvark
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/x00006.vtc
View file @
8ce3713d
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"a\";
n;w=\"b
\""
txresp -hdr "Key: Foobar;w=\"a\";
w=\"b\";w=\"c
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"a\";
n;w=\"b
\""
txresp -hdr "Key: Foobar;w=\"a\";
w=\"b\";w=\"c
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
a,
b"
txreq -hdr "Foobar:
c,a,
b"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
a,
b"
txreq -hdr "Foobar:
c,a,
b"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003"
expect resp.http.X-Varnish == "1003
1002
"
} -run
} -run
bin/varnishtest/tests/x00007.vtc
View file @
8ce3713d
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
\\\"a\\\"
\""
txresp -hdr "Key: Foobar;w=\"
a
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
\\\"a\\\"
\""
txresp -hdr "Key: Foobar;w=\"
a
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
\"a\"
"
txreq -hdr "Foobar:
apple,a
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
\"a\"
"
txreq -hdr "Foobar:
apple,a
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/x00008.vtc
View file @
8ce3713d
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
\\\"a\\\"
\""
txresp -hdr "Key: Foobar;w=\"
a
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
\\\"a\\\"
\""
txresp -hdr "Key: Foobar;w=\"
a
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
\"a\"
"
txreq -hdr "Foobar:
b
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
\"a\"
"
txreq -hdr "Foobar:
b
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003
1002
"
expect resp.http.X-Varnish == "1003"
} -run
} -run
bin/varnishtest/tests/x00009.vtc
View file @
8ce3713d
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
\\
a\""
txresp -hdr "Key: Foobar;w=\"a\""
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
\\
a\""
txresp -hdr "Key: Foobar;w=\"a\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
\\a
"
txreq -hdr "Foobar:
a,b
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
\\a
"
txreq -hdr "Foobar:
a,b
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/x00010.vtc
View file @
8ce3713d
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;
p=\"text/html
\""
txresp -hdr "Key: Foobar;
w=\"a
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;
p=\"text/html
\""
txresp -hdr "Key: Foobar;
w=\"a
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
text/html
"
txreq -hdr "Foobar:
b,a
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
text/html
"
txreq -hdr "Foobar:
b,a
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/x00011.vtc
View file @
8ce3713d
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;
p=\"text/html
\""
txresp -hdr "Key: Foobar;
n;b=\"a
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;
p=\"text/html
\""
txresp -hdr "Key: Foobar;
n;b=\"a
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
text/html; q=0.5
"
txreq -hdr "Foobar:
car
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
text/html; q=0.5
"
txreq -hdr "Foobar:
car
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/x00012.vtc
View file @
8ce3713d
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,20 +2,20 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;
p=\"text/html
\""
txresp -hdr "Key: Foobar;
n;b=\"a
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;
p=\"text/html
\""
txresp -hdr "Key: Foobar;
n;b=\"a
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
text/html;q=0.1
"
txreq -hdr "Foobar:
duck
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
text/html;q=0.1
"
txreq -hdr "Foobar:
duck
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/x00013.vtc
View file @
8ce3713d
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
...
@@ -2,21 +2,21 @@ varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;
p=\"text/html
\""
txresp -hdr "Key: Foobar;
c;w=\"a
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;
p=\"text/html
\""
txresp -hdr "Key: Foobar;
c;w=\"a
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
text/html; foo=\"bar\"
"
txreq -hdr "Foobar:
A
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
text/html; foo=\"bar\"
"
txreq -hdr "Foobar:
A
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003
1002
"
expect resp.http.X-Varnish == "1003"
} -run
} -run
bin/varnishtest/tests/
kb01
.vtc
→
bin/varnishtest/tests/
x00014
.vtc
View file @
8ce3713d
varnishtest "Test Key matcher functionality
(BEGINNING)
"
varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;b=\"A\""
txresp -hdr "Key: Foobar;n;w=\"a\""
rxreq
txresp -hdr "Key: Foobar;n;w=\"a\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
Apple
"
txreq -hdr "Foobar:
b
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
Ardvark
"
txreq -hdr "Foobar:
b
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/
kw02
.vtc
→
bin/varnishtest/tests/
x00015
.vtc
View file @
8ce3713d
varnishtest "Test Key matcher functionality
(WORD)
"
varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"A\";w=\"B\";w=\"C\""
txresp -hdr "Key: Foobar;w=\"a\";n;w=\"b\""
rxreq
txresp -hdr "Key: Foobar;w=\"a\";n;w=\"b\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
A,B,C
"
txreq -hdr "Foobar:
a, c
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
C,A,B
"
txreq -hdr "Foobar:
a, c
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/
kw03
.vtc
→
bin/varnishtest/tests/
x00016
.vtc
View file @
8ce3713d
varnishtest "Test Key matcher functionality
(WORD)
"
varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
A
\""
txresp -hdr "Key: Foobar;w=\"
a\";n;w=\"b
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
B
\""
txresp -hdr "Key: Foobar;w=\"
a\";n;w=\"b
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
A
"
txreq -hdr "Foobar:
a, b
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
B
"
txreq -hdr "Foobar:
a, b
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003"
expect resp.http.X-Varnish == "1003"
...
...
bin/varnishtest/tests/
kn01
.vtc
→
bin/varnishtest/tests/
x00017
.vtc
View file @
8ce3713d
varnishtest "Test Key matcher functionality
(NOT)
"
varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;n;b=\"A\""
txresp -hdr "Key: Foobar;w=\"\\\"a\\\"\""
rxreq
txresp -hdr "Key: Foobar;w=\"\\\"a\\\"\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
Car
"
txreq -hdr "Foobar:
\"a\"
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
Duck
"
txreq -hdr "Foobar:
\"a\"
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/
kw01
.vtc
→
bin/varnishtest/tests/
x00018
.vtc
View file @
8ce3713d
varnishtest "Test Key matcher functionality
(WORD)
"
varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"A\""
txresp -hdr "Key: Foobar;w=\"\\\"a\\\"\""
rxreq
txresp -hdr "Key: Foobar;w=\"\\\"a\\\"\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
A,B
"
txreq -hdr "Foobar:
\"a\"
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
B,A
"
txreq -hdr "Foobar:
\"a\"
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/
kw04
.vtc
→
bin/varnishtest/tests/
x00019
.vtc
View file @
8ce3713d
varnishtest "Test Key matcher functionality
(WORD)
"
varnishtest "Test Key matcher functionality"
server s1 {
server s1 {
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
A
\""
txresp -hdr "Key: Foobar;w=\"
\\a
\""
rxreq
rxreq
txresp -hdr "Key: Foobar;w=\"
A
\""
txresp -hdr "Key: Foobar;w=\"
\\a
\""
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
client c1 {
client c1 {
txreq -hdr "Foobar:
APPLE,A
"
txreq -hdr "Foobar:
\\a
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar:
APPLE,A
"
txreq -hdr "Foobar:
\\a
"
rxresp
rxresp
expect resp.status == 200
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
expect resp.http.X-Varnish == "1003 1002"
...
...
bin/varnishtest/tests/x00020.vtc
0 → 100644
View file @
8ce3713d
varnishtest "Test Key matcher functionality"
server s1 {
rxreq
txresp -hdr "Key: Foobar;p=\"text/html\""
rxreq
txresp -hdr "Key: Foobar;p=\"text/html\""
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq -hdr "Foobar: text/html"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar: text/html"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
} -run
bin/varnishtest/tests/x00021.vtc
0 → 100644
View file @
8ce3713d
varnishtest "Test Key matcher functionality"
server s1 {
rxreq
txresp -hdr "Key: Foobar;p=\"text/html\""
rxreq
txresp -hdr "Key: Foobar;p=\"text/html\""
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq -hdr "Foobar: text/html; q=0.5"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar: text/html; q=0.5"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
} -run
bin/varnishtest/tests/x00022.vtc
0 → 100644
View file @
8ce3713d
varnishtest "Test Key matcher functionality"
server s1 {
rxreq
txresp -hdr "Key: Foobar;p=\"text/html\""
rxreq
txresp -hdr "Key: Foobar;p=\"text/html\""
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq -hdr "Foobar: text/html;q=0.1"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar: text/html;q=0.1"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
} -run
bin/varnishtest/tests/x00023.vtc
0 → 100644
View file @
8ce3713d
varnishtest "Test Key matcher functionality"
server s1 {
rxreq
txresp -hdr "Key: Foobar;p=\"text/html\""
rxreq
txresp -hdr "Key: Foobar;p=\"text/html\""
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq -hdr "Foobar: text/html; foo=\"bar\""
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar: text/html; foo=\"bar\""
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
} -run
bin/varnishtest/tests/x00024.vtc
0 → 100644
View file @
8ce3713d
varnishtest "Test Key matcher functionality"
server s1 {
rxreq
txresp -hdr "Key: Foobar;w=\"foo\";p=\"test\";b=\"win\";c;s=\"iNnInG\";n;w=\"bar\""
rxreq
txresp -hdr "Key: Foobar;w=\"foo\";p=\"test\";b=\"win\";c;s=\"iNnInG\";n;w=\"bar\""
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq -hdr "Foobar: foo,test;bar,wiNnInG"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
txreq -hdr "Foobar: foo,test;bar,wiNnInG"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1003 1002"
} -run
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