mirror of
https://github.com/thib8956/nginx-proxy
synced 2024-11-25 13:26:30 +00:00
TEST: wildcards-hosts.bats - add a test which uses regexp end-of-string
This commit is contained in:
parent
a3c6a272f1
commit
d8658bd8d9
@ -43,8 +43,8 @@ function setup {
|
|||||||
|
|
||||||
@test "[$TEST_FILE] VIRTUAL_HOST=~^foo\.bar\..*\.bats" {
|
@test "[$TEST_FILE] VIRTUAL_HOST=~^foo\.bar\..*\.bats" {
|
||||||
# WHEN
|
# WHEN
|
||||||
prepare_web_container bats-wildcard-hosts-2 80 -e VIRTUAL_HOST=~^foo\.bar\..*\.bats
|
prepare_web_container bats-wildcard-hosts-3 80 -e VIRTUAL_HOST=~^foo\.bar\..*\.bats
|
||||||
dockergen_wait_for_event $SUT_CONTAINER start bats-wildcard-hosts-2
|
dockergen_wait_for_event $SUT_CONTAINER start bats-wildcard-hosts-3
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# THEN
|
# THEN
|
||||||
@ -55,6 +55,20 @@ function setup {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "[$TEST_FILE] VIRTUAL_HOST=~^foo\.bar\..*\.bats$" {
|
||||||
|
# WHEN
|
||||||
|
prepare_web_container bats-wildcard-hosts-4 80 -e VIRTUAL_HOST=~^foo\.bar\..*\.bats$
|
||||||
|
dockergen_wait_for_event $SUT_CONTAINER start bats-wildcard-hosts-4
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# THEN
|
||||||
|
assert_200 foo.bar.whatever.bats
|
||||||
|
assert_200 foo.bar.why.not.bats
|
||||||
|
assert_503 foo.bar.why.not.bats-to-infinity-and-beyond
|
||||||
|
assert_503 unexpected.host.bats
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@test "[$TEST_FILE] stop all bats containers" {
|
@test "[$TEST_FILE] stop all bats containers" {
|
||||||
stop_bats_containers
|
stop_bats_containers
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user