Commit 417e8502 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Let servers pick a randomly assigned TCP port, if nothing is

explicitly specified, and use macros to pick up the result
as necessary.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4364 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 88de5286
......@@ -2,7 +2,7 @@
test "dual independent HTTP transactions"
server s1 -listen 127.0.0.1:9080 {
server s1 {
rxreq
expect req.request == PUT
expect req.proto == HTTP/1.0
......@@ -10,7 +10,7 @@ server s1 -listen 127.0.0.1:9080 {
txresp -proto HTTP/1.2 -status 201 -msg Foo
}
server s2 -listen 127.0.0.1:9081 {
server s2 {
rxreq
expect req.request == GET
expect req.proto == HTTP/1.1
......@@ -21,7 +21,7 @@ server s2 -listen 127.0.0.1:9081 {
server s1 -start
server s2 -start
client c1 -connect 127.0.0.1:9080 {
client c1 -connect $s1_sock {
txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp
expect resp.proto == HTTP/1.2
......@@ -29,7 +29,7 @@ client c1 -connect 127.0.0.1:9080 {
expect resp.msg == Foo
}
client c2 -connect 127.0.0.1:9081 {
client c2 -connect $s2_sock {
txreq
rxresp
expect resp.proto == HTTP/1.1
......
......@@ -2,7 +2,7 @@
test "dual shared client HTTP transactions"
server s1 -listen 127.0.0.1:9080 {
server s1 {
rxreq
expect req.request == PUT
expect req.proto == HTTP/1.0
......@@ -10,7 +10,7 @@ server s1 -listen 127.0.0.1:9080 {
txresp -proto HTTP/1.2 -status 201 -msg Foo
}
server s2 -listen 127.0.0.1:9081 {
server s2 {
rxreq
expect req.request == GET
expect req.proto == HTTP/1.1
......@@ -21,7 +21,7 @@ server s2 -listen 127.0.0.1:9081 {
server s1 -start
server s2 -start
client c1 -connect 127.0.0.1:9080 {
client c1 -connect $s1_sock {
txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp
expect resp.proto == HTTP/1.2
......@@ -31,7 +31,7 @@ client c1 -connect 127.0.0.1:9080 {
client c1 -run
client c1 -connect 127.0.0.1:9081 {
client c1 -connect $s2_sock {
txreq
rxresp
expect resp.proto == HTTP/1.1
......
......@@ -2,42 +2,42 @@
test "Sema operations"
server s1 -listen 127.0.0.1:9080 {
server s1 {
rxreq
sema r1 sync 4
delay .9
txresp
} -start
server s2 -listen 127.0.0.1:9081 {
server s2 {
rxreq
sema r1 sync 4
delay .6
txresp
} -start
server s3 -listen 127.0.0.1:9082 {
server s3 {
rxreq
sema r1 sync 4
delay .2
txresp
} -start
client c1 -connect 127.0.0.1:9080 {
client c1 -connect $s1_sock {
delay .2
txreq
rxresp
sema r1 sync 4
} -start
client c2 -connect 127.0.0.1:9081 {
client c2 -connect $s2_sock {
delay .6
txreq
rxresp
sema r1 sync 4
} -start
client c3 -connect 127.0.0.1:9082 {
client c3 -connect $s3_sock {
delay .9
txreq
rxresp
......
......@@ -8,7 +8,7 @@ server s1 {
txresp -status 404
} -start
server s2 -listen 127.0.0.1:9180 {
server s2 {
rxreq
expect req.url == "/foo"
txresp -body "foobar"
......
......@@ -15,7 +15,7 @@ server s1 {
} -start
server s2 -listen 127.0.0.1:9180 {
server s2 {
rxreq
expect req.url == "/body"
txresp -body {
......
......@@ -18,7 +18,7 @@ The end.
} -start
server s2 -listen 127.0.0.1:9082 {
server s2 {
rxreq
expect req.url == "/bar"
txresp -body "bar"
......
......@@ -2,23 +2,23 @@
test "Test round robin director"
server s1 -listen 127.0.0.1:2000 {
server s1 {
rxreq
txresp -body "1"
} -start
server s2 -listen 127.0.0.1:3000 {
server s2 {
rxreq
txresp -body "22"
} -start
server s3 -listen 127.0.0.1:4000 {
server s3 {
rxreq
txresp -body "333"
} -start
server s4 -listen 127.0.0.1:5000 {
server s4 {
rxreq
txresp -body "4444"
} -start
......
......@@ -8,7 +8,7 @@ server s1 {
rxreq
txresp -body "1"
} -start
server s2 -listen 127.0.0.1:9180 {
server s2 {
rxreq
txresp -body "22"
rxreq
......@@ -16,11 +16,11 @@ server s2 -listen 127.0.0.1:9180 {
rxreq
txresp -body "22"
} -start
server s3 -listen 127.0.0.1:9181 {
server s3 {
rxreq
txresp -body "333"
} -start
server s4 -listen 127.0.0.1:9182 {
server s4 {
rxreq
txresp -body "4444"
rxreq
......
......@@ -132,7 +132,7 @@ server_new(const char *name)
if (*s->name != 's')
vtc_log(s->vl, 0, "Server name must start with 's'");
REPLACE(s->listen, "127.0.0.1:9080");
REPLACE(s->listen, "127.0.0.1:0");
AZ(VSS_parse(s->listen, &s->addr, &s->port));
s->repeat = 1;
s->depth = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment