Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-backend_dyn
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carl P. Corliss
libvmod-backend_dyn
Commits
7c931851
Commit
7c931851
authored
Nov 08, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test r01349.vtc
parent
4c0a6c7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
r01349.vtc
src/tests/r01349.vtc
+74
-0
No files found.
src/tests/r01349.vtc
0 → 100644
View file @
7c931851
varnishtest "Exact matching for varnishadm backend.set_health"
server s1 -repeat 2 {
rxreq
txresp -hdr "Backend: b1"
} -start
server s2 -repeat 2 {
rxreq
txresp -hdr "Backend: b"
} -start
varnish v1 -vcl {
import backend_dyn from "${vmod_topbuild}/src/.libs/libvmod_backend_dyn.so";
backend dummy { .host = "${bad_ip}"; }
sub vcl_init {
if (!backend_dyn.create(name="b1", host="${s1_addr}",
port="${s1_port}")) {
return(fail);
}
if (!backend_dyn.create(name="b", host="${s2_addr}",
port="${s2_port}")) {
return(fail);
}
}
sub vcl_recv {
return(pass);
}
sub vcl_backend_fetch {
if (bereq.http.backend == "b1") {
set bereq.backend = backend_dyn.by_name("b1");
}
else {
set bereq.backend = backend_dyn.by_name("b");
}
}
} -start
varnish v1 -cliok "backend.list b"
client c1 {
txreq -hdr "Backend: b1"
rxresp
expect resp.status == 200
expect resp.http.backend == "b1"
txreq -hdr "Backend: b"
rxresp
expect resp.status == 200
expect resp.http.backend == "b"
} -run
varnish v1 -cliok "backend.set_health b sick"
client c1 {
txreq -hdr "Backend: b1"
rxresp
expect resp.status == 200
expect resp.http.backend == "b1"
txreq -hdr "Backend: b"
rxresp
expect resp.status == 503
} -run
varnish v1 -clierr 106 "backend.set_health b(1.2.3.4:) healthy"
varnish v1 -expect MAIN.n_backend == 3
varnish v1 -expect VBE.vcl1.b1.happy == 0
varnish v1 -expect VBE.vcl1.b.happy == 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