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
218d1a6d
Commit
218d1a6d
authored
Nov 08, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test v00014.vtc
parent
7b394406
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
v00014.vtc
src/tests/v00014.vtc
+70
-0
No files found.
src/tests/v00014.vtc
0 → 100644
View file @
218d1a6d
varnishtest "Check req.backend.healthy"
server s1 {
rxreq
sema r1 sync 2
expect req.url == "/"
txresp -body "slash"
accept
rxreq
sema r2 sync 2
sema r3 sync 2
expect req.url == "/"
txresp -body "slash"
accept
sema r4 sync 2
} -start
varnish v1 -vcl {
import backend_dyn from "${vmod_topbuild}/src/.libs/libvmod_backend_dyn.so";
import ${vmod_std};
backend dummy { .host = "${bad_ip}"; }
probe foo {
.url = "/";
.timeout = 1s;
.interval = 1s;
.window = 3;
.threshold = 2;
.initial = 0;
}
sub vcl_init {
if (!backend_dyn.create(name="be", host="${s1_addr}",
port="${s1_port}",
max_connections = 1,
probe=foo)) {
return(fail);
}
}
sub vcl_recv {
if (std.healthy(backend_dyn.by_name("be"))) {
return(synth(200,"Backend healthy"));
} else {
return(synth(500,"Backend sick"));
}
}
} -start
varnish v1 -cliok "backend.list -p"
client c1 {
txreq
rxresp
expect resp.status == 500
sema r1 sync 2
sema r2 sync 2
txreq
rxresp
expect resp.status == 500
sema r3 sync 2
sema r4 sync 2
txreq
rxresp
expect resp.status == 200
} -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