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
78e71553
Commit
78e71553
authored
Jan 24, 2018
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test the proxy related VSL tags
parent
f94c7034
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
7 deletions
+58
-7
o00000.vtc
bin/varnishtest/tests/o00000.vtc
+38
-7
o00001.vtc
bin/varnishtest/tests/o00001.vtc
+20
-0
No files found.
bin/varnishtest/tests/o00000.vtc
View file @
78e71553
...
...
@@ -30,10 +30,26 @@ varnish v1 -proto "PROXY" -vcl+backend {
}
} -start
logexpect l1 -v v1 {
expect * 1002 ProxyGarbage "PROXY1: Too few fields"
expect * 1003 ProxyGarbage "PROXY1: Too many fields"
expect * 1004 ProxyGarbage "PROXY1: Wrong TCP\\[46\\] field"
expect * 1005 ProxyGarbage "PROXY1: Cannot resolve source address \\(nodename nor servname provided, or not known\\)"
expect * 1007 ProxyGarbage "PROXY1: Cannot resolve destination address \\(nodename nor servname provided, or not known\\)"
expect * 1013 ProxyGarbage "PROXY1: TCP4 got wrong protocol \\(30\\)"
expect * 1014 ProxyGarbage "PROXY1: TCP6 got wrong protocol \\(2\\)"
expect * 1015 Proxy "1 1.2.3.4 1234 5.6.7.8 5678"
expect * 1018 Proxy "1 1:f::2 1234 5:a::8 5678"
expect * 1021 Proxy "1 1:f::3 1234 5:a::8 5678"
expect * 1025 ProxyGarbage "PROXY1: Too many fields"
expect * 1026 ProxyGarbage "PROXY1: Too many fields"
} -start
client c1 {
send "XYZ\r\n"
expect_close
} -run
delay .1
client c1 {
...
...
@@ -41,6 +57,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -48,6 +65,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -55,6 +73,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -62,6 +81,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -69,6 +89,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -76,6 +97,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -83,6 +105,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -90,6 +113,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -97,6 +121,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -104,6 +129,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -111,6 +137,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -118,6 +145,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -125,6 +153,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -132,12 +161,8 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
logexpect l1 -v v1 {
expect * * ReqStart "1.2.3.4 1234"
expect * * ReqStart "1:f::2 1234"
} -start
delay .1
# Finally try something which works...
client c1 -proxy1 "1.2.3.4:1234 5.6.7.8:5678" {
...
...
@@ -153,6 +178,7 @@ client c1 -proxy1 "1.2.3.4:1234 5.6.7.8:5678" {
expect resp.http.ri != "1.2.3.4"
expect resp.http.rp != "1234"
} -run
delay .1
client c1 -proxy1 "[1:f::2]:1234 [5:a::8]:5678" {
...
...
@@ -168,9 +194,8 @@ client c1 -proxy1 "[1:f::2]:1234 [5:a::8]:5678" {
expect resp.http.ri != "1:f::2"
expect resp.http.rp != "1234"
} -run
delay .1
logexpect l1 -wait
delay .1
# Try with appended request (See also: #1728)
client c2 {
...
...
@@ -184,6 +209,7 @@ client c2 {
send "PROXY TCP4 1.2.3.4 5.6.7.8 1234 5678\n"
expect_close
} -run
delay .1
# Malformed, too long (106)
...
...
@@ -192,6 +218,7 @@ client c2 {
send "PROXY TCP4 1.2.3.4 5.6.7.8 1234 5678 \r\n"
expect_close
} -run
delay .1
# Malformed, too long (107)
...
...
@@ -200,6 +227,7 @@ client c2 {
send "PROXY TCP4 1.2.3.4 5.6.7.8 1234 5678 \r\n"
expect_close
} -run
delay .1
# Malformed, too long (108)
...
...
@@ -208,4 +236,7 @@ client c2 {
send "PROXY TCP4 1.2.3.4 5.6.7.8 1234 5678 \r\n"
expect_close
} -run
delay .1
logexpect l1 -wait
bin/varnishtest/tests/o00001.vtc
View file @
78e71553
...
...
@@ -40,6 +40,17 @@ varnish v1 -proto "PROXY" -vcl+backend {
}
} -start
logexpect l1 -v v1 -g raw {
expect * 1000 Proxy "2 local local local local"
expect * 1003 ProxyGarbage "PROXY2: bad command \\(2\\)"
expect * 1004 ProxyGarbage "PROXY2: Ignoring UNSPEC\\|UNSPEC addresses"
expect * 1006 ProxyGarbage "PROXY2: Ignoring unsupported protocol \\(0x99\\)"
expect * 1008 ProxyGarbage "PROXY2: Ignoring short IPv4 addresses \\(11\\)"
expect * 1010 ProxyGarbage "PROXY2: Ignoring short IPv6 addresses \\(35\\)"
expect * 1012 Proxy "2 1.2.3.4 2314 5.6.7.8 2828"
expect * 1015 Proxy "2 102:304:506::d0e:f10 2314 8182:8384:8586::8d8e:8f80 2828"
} -start
client c1 {
# LOCAL command
sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a"
...
...
@@ -51,6 +62,7 @@ client c1 {
expect resp.http.sp == "${v1_port}"
expect resp.http.ci == "${localhost}"
} -run
delay .1
client c1 {
...
...
@@ -60,6 +72,7 @@ client c1 {
timeout 8
expect_close
} -run
delay .1
client c1 {
...
...
@@ -73,6 +86,7 @@ client c1 {
expect resp.http.sp == "${v1_port}"
expect resp.http.ci == "${localhost}"
} -run
delay .1
client c1 {
...
...
@@ -86,6 +100,7 @@ client c1 {
expect resp.http.sp == "${v1_port}"
expect resp.http.ci == "${localhost}"
} -run
delay .1
client c1 {
...
...
@@ -100,6 +115,7 @@ client c1 {
expect resp.http.sp == "${v1_port}"
expect resp.http.ci == "${localhost}"
} -run
delay .1
client c1 {
...
...
@@ -136,6 +152,7 @@ client c1 -proxy2 "1.2.3.4:2314 5.6.7.8:2828" {
expect resp.http.lp == "${v1_port}"
expect resp.http.ri != "1.2.3.4"
} -run
delay .1
# good IPv6
...
...
@@ -155,4 +172,7 @@ client c1 \
expect resp.http.lp == "${v1_port}"
expect resp.http.ri != "102:304:506::d0e:f10"
} -run
delay .1
logexpect l1 -wait
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