Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oob_probe
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
uplex-varnish
oob_probe
Commits
445b95a4
Commit
445b95a4
authored
Oct 24, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a test for setting the probe address
parent
3633f955
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
test02.vtc
src/tests/test02.vtc
+84
-0
No files found.
src/tests/test02.vtc
0 → 100644
View file @
445b95a4
varnishtest "Test setting the probe address (cf. v00014.vtc)"
server s1 {
rxreq
expect req.url == "/baz"
txresp -body "backend"
} -start
server s2 {
rxreq
expect req.url == "/"
txresp -body "one"
sema r1 sync 2
accept
rxreq
expect req.url == "/"
txresp -body "two"
sema r2 sync 2
accept
rxreq
expect req.url == "/"
txresp -body "three"
} -start
varnish v1 -vcl {
import oob_probe from "${vmod_topbuild}/src/.libs/libvmod_oob_probe.so";
import ${vmod_std};
probe foo {
.url = "/";
.timeout = 1s;
.interval = 1s;
.window = 3;
.threshold = 2;
.initial = 0;
}
backend default {
.host = "${s1_addr}";
.port = "${s1_port}";
.max_connections = 1;
}
sub vcl_init {
oob_probe.probe_addr(default, foo, "${s2_addr}", "${s2_port}");
}
sub vcl_recv {
if (req.url == "/baz") {
return(pass);
}
if (std.healthy(default)) {
return(synth(200,"Backend healthy"));
} else {
return(synth(500,"Backend sick"));
}
}
} -start
varnish v1 -cli "backend.list -p"
client c1 {
txreq
rxresp
expect resp.status == 500
expect resp.body ~ "Backend sick"
sema r1 sync 2
txreq -url "/foo"
rxresp
expect resp.status == 500
expect resp.body ~ "Backend sick"
sema r2 sync 2
txreq -url "/bar"
rxresp
expect resp.status == 200
expect resp.body ~ "Backend healthy"
txreq -url "/baz"
rxresp
expect resp.status == 200
expect resp.body == "backend"
} -run
varnish v1 -expect VBE.vcl1.default.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