mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-19 09:05:41 +03:00
Add several upstreams test case
This commit is contained in:
parent
d291b76721
commit
9b5ad487d7
1 changed files with 14 additions and 0 deletions
|
@ -96,6 +96,20 @@ func TestUpstream(t *testing.T) {
|
||||||
"http://testendpoint": {},
|
"http://testendpoint": {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// test #9 test several upstream directives
|
||||||
|
{
|
||||||
|
"proxy / localhost:8080 {\n upstream localhost:8081-8082\n upstream localhost:8083-8085\n}",
|
||||||
|
false,
|
||||||
|
map[string]struct{}{
|
||||||
|
"http://localhost:8080": {},
|
||||||
|
"http://localhost:8081": {},
|
||||||
|
"http://localhost:8082": {},
|
||||||
|
"http://localhost:8083": {},
|
||||||
|
"http://localhost:8084": {},
|
||||||
|
"http://localhost:8085": {},
|
||||||
|
},
|
||||||
|
},
|
||||||
} {
|
} {
|
||||||
receivedFunc, err := Proxy(NewTestController(test.input))
|
receivedFunc, err := Proxy(NewTestController(test.input))
|
||||||
if err != nil && !test.shouldErr {
|
if err != nil && !test.shouldErr {
|
||||||
|
|
Loading…
Reference in a new issue