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
a7e981dc
Commit
a7e981dc
authored
Nov 08, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test r00306.vtc
parent
607c5923
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
r00306.vtc
src/tests/r00306.vtc
+63
-0
No files found.
src/tests/r00306.vtc
0 → 100644
View file @
a7e981dc
varnishtest "Regression test for ticket #306, random director ignoring good backend"
server s1 {
rxreq
expect req.url == /foo
txresp -body "foo1"
rxreq
expect req.url == /bar
txresp -body "bar1"
} -start
server s2 {
rxreq
txresp -status 404
} -start
varnish v1 -vcl {
import backend_dyn from "${vmod_topbuild}/src/.libs/libvmod_backend_dyn.so";
import ${vmod_directors};
backend dummy { .host = "${bad_ip}"; }
sub vcl_init {
if (!backend_dyn.create(name="s1", host="${s1_addr}",
port="${s1_port}")) {
return(fail);
}
if (!backend_dyn.create(name="s2", host="${s2_addr}",
port="${s2_port}")) {
return(fail);
}
new foo = directors.random();
foo.add_backend(backend_dyn.by_name("s1"), 1);
foo.add_backend(backend_dyn.by_name("s2"), 1);
}
sub vcl_backend_fetch {
set bereq.backend = foo.backend();
}
} -start
varnish v1 -cliok "backend.set_health s2 sick"
varnish v1 -cliok "backend.list"
client c1 {
timeout 10
txreq -url "/foo"
rxresp
expect resp.status == 200
txreq -url "/bar"
rxresp
expect resp.status == 200
} -run
varnish v1 -expect VBE.vcl1.s1.happy == 0
varnish v1 -expect VBE.vcl1.s2.happy == 0
varnish v1 -expect MAIN.n_backend == 3
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