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
d22e7de2
Commit
d22e7de2
authored
Sep 04, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test more of varnishadms error handling
parent
621c408a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
3 deletions
+130
-3
b00041.vtc
bin/varnishtest/tests/b00041.vtc
+90
-0
c00081.vtc
bin/varnishtest/tests/c00081.vtc
+40
-3
No files found.
bin/varnishtest/tests/b00041.vtc
View file @
d22e7de2
...
...
@@ -2,4 +2,94 @@ varnishtest "Test varnishadm and the Telnet CLI"
varnish v1 -vcl {backend foo { .host = "127.0.0.1"; } } -start
shell -err -expect {Usage: varnishadm} \
"varnishadm -7"
shell -err -expect {Could not get hold of varnishd, is it running?} \
"varnishadm -n ${v1_name}/nonexistent"
shell -err -expect {Connection failed} \
"varnishadm -t 4 -T ${bad_ip}:1 -S ${v1_name}/_.secret"
server s1 {
send "FOO\n"
} -start
shell -err -expect {Rejected 400} \
{varnishadm -T ${s1_addr}:${s1_port} -S /etc/group}
server s1 {
send "107 59 \n"
send "qbvnnftpkgubadqpzznkkazoxlyqbcbj\n\n"
send "Authentication required.\n"
send "\n"
} -start
shell -err -expect {Authentication required} \
{varnishadm -T ${s1_addr}:${s1_port}}
server s1 {
send "107 59 \n"
send "qbvnnftpkgubadqpzznkkazoxlyqbcbj\n\n"
send "Authentication required.\n"
send "\n"
} -start
shell -err -expect {Cannot open } \
{varnishadm -T ${s1_addr}:${s1_port} -S ${v1_name}/_.nonexistent}
server s1 {
send "107 59 \n"
send "qbvnnftpkgubadqpzznkkazoxlyqbcbj\n\n"
send "Authentication required.\n"
send "\n"
recv 70
send "599 0 \n"
send "\n"
} -start
shell -err -expect {Rejected 599} \
{varnishadm -T ${s1_addr}:${s1_port} -S ${v1_name}/_.secret}
server s1 {
send "107 59 \n"
send "qbvnnftpkgubadqpzznkkazoxlyqbcbj\n\n"
send "Authentication required.\n"
send "\n"
recv 70
send "200 0 \n"
send "\n"
recv 5
} -start
shell -err -expect {No pong received from server} \
{varnishadm -T ${s1_addr}:${s1_port} -S ${v1_name}/_.secret}
server s1 {
send "107 59 \n"
send "qbvnnftpkgubadqpzznkkazoxlyqbcbj\n\n"
send "Authentication required.\n"
send "\n"
recv 70
send "200 0 \n"
send "\n"
recv 5
send "200 8 \n"
send "PONG 12\n"
send "\n"
recv 5
send "200 7 \n"
send "Tested\n"
send "\n"
} -start
shell -expect {Tested} \
{varnishadm -T ${s1_addr}:${s1_port} -S ${v1_name}/_.secret test}
shell "varnishadm -n ${v1_name} help > /dev/null"
bin/varnishtest/tests/c00081.vtc
View file @
d22e7de2
...
...
@@ -4,7 +4,11 @@ server s1 {
rxreq
txresp -hdr "foo: 1"
rxreq
txresp -hdr "foo: 2"
txresp -hdr "foo: 2a"
rxreq
txresp -hdr "foo: 2b"
rxreq
txresp -hdr "foo: 2c"
rxreq
txresp -hdr "foo: 3"
} -start
...
...
@@ -29,8 +33,31 @@ varnish v1 -vcl+backend {
} -start
varnish v1 -cliok "param.set debug +refcnt"
logexpect l1 -v v1 -g vxid {
expect * 1003 HitPass "^1002 1"
expect * 1001 Debug "^oh.*refcnt 1$"
expect 0 = VCL_call "^MISS"
} -start
logexpect l2 -v v1 -g vxid {
expect * 1003 Debug "^oh.*refcnt 2$"
expect 0 = HitPass "^1002 1"
} -start
logexpect l3 -v v1 -g vxid {
expect * 1005 Debug "^oh.*refcnt 2$"
expect 0 = HitPass "^1002 1"
} -start
logexpect l4 -v v1 -g vxid {
expect * 1007 Debug "^oh.*refcnt 2$"
expect 0 = HitPass "^1002 1"
} -start
logexpect l5 -v v1 -g vxid {
expect * 1009 Debug "^oh.*refcnt 1$"
expect 0 = VCL_call "^MISS"
} -start
client c1 {
...
...
@@ -38,6 +65,12 @@ client c1 {
rxresp
expect resp.http.miss == True
txreq
rxresp
expect resp.http.pass == True
txreq
rxresp
expect resp.http.pass == True
txreq
rxresp
expect resp.http.pass == True
...
...
@@ -50,7 +83,11 @@ client c1 {
} -run
logexpect l1 -wait
logexpect l2 -wait
logexpect l3 -wait
logexpect l4 -wait
logexpect l5 -wait
varnish v1 -expect MAIN.cache_hitpass ==
1
varnish v1 -expect MAIN.cache_hitpass ==
3
varnish v1 -expect MAIN.cache_miss == 2
varnish v1 -expect MAIN.cache_hitmiss == 0
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