-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
146 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 74 additions & 74 deletions
148
test/integration/connect/envoy/case-cfg-resolver-svc-failover/verify.bats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,74 @@ | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
@test "s1 proxy admin is up on :19000" { | ||
retry_default curl -f -s localhost:19000/stats -o /dev/null | ||
} | ||
|
||
@test "s2 proxy admin is up on :19001" { | ||
retry_default curl -f -s localhost:19001/stats -o /dev/null | ||
} | ||
|
||
@test "s3-v1 proxy admin is up on :19002" { | ||
retry_default curl -f -s localhost:19002/stats -o /dev/null | ||
} | ||
|
||
@test "s3-v2 proxy admin is up on :19003" { | ||
retry_default curl -f -s localhost:19003/stats -o /dev/null | ||
} | ||
|
||
@test "s3 proxy admin is up on :19004" { | ||
retry_default curl -f -s localhost:19004/stats -o /dev/null | ||
} | ||
|
||
@test "s1 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21000 s1 | ||
} | ||
|
||
@test "s2 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21001 s2 | ||
} | ||
|
||
@test "s3-v1 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21002 s3 | ||
} | ||
|
||
@test "s3-v2 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21003 s3 | ||
} | ||
|
||
@test "s3 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21004 s3 | ||
} | ||
|
||
@test "s2 proxies should be healthy" { | ||
assert_service_has_healthy_instances s2 1 | ||
} | ||
|
||
@test "s3 proxies should be healthy" { | ||
assert_service_has_healthy_instances s3 3 | ||
} | ||
|
||
# Note: when failover is configured the cluster is named for the original | ||
# service not any destination related to failover. | ||
@test "s1 upstream should have healthy endpoints for s2 and s3 together" { | ||
assert_upstream_has_endpoints_in_status 127.0.0.1:19000 failover-target~s2.default.primary HEALTHY 1 | ||
} | ||
|
||
@test "s1 upstream should be able to connect to s2 via upstream s2 to start" { | ||
assert_expected_fortio_name s2 | ||
} | ||
|
||
@test "terminate instance of s2 envoy which should trigger failover to s3 when tcp check fails" { | ||
kill_envoy s2 | ||
} | ||
|
||
@test "s1 upstream should have healthy endpoints for s3-v1 and unhealthy endpoints for s2" { | ||
assert_upstream_has_endpoints_in_status 127.0.0.1:19000 failover-target~v1.s3.default.primary HEALTHY 1 | ||
assert_upstream_has_endpoints_in_status 127.0.0.1:19000 failover-target~s2.default.primary UNHEALTHY 1 | ||
} | ||
|
||
@test "s1 upstream should be able to connect to s3-v1 now" { | ||
assert_expected_fortio_name s3-v1 | ||
} | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
@test "s1 proxy admin is up on :19000" { | ||
retry_default curl -f -s localhost:19000/stats -o /dev/null | ||
} | ||
|
||
@test "s2 proxy admin is up on :19001" { | ||
retry_default curl -f -s localhost:19001/stats -o /dev/null | ||
} | ||
|
||
@test "s3-v1 proxy admin is up on :19002" { | ||
retry_default curl -f -s localhost:19002/stats -o /dev/null | ||
} | ||
|
||
@test "s3-v2 proxy admin is up on :19003" { | ||
retry_default curl -f -s localhost:19003/stats -o /dev/null | ||
} | ||
|
||
@test "s3 proxy admin is up on :19004" { | ||
retry_default curl -f -s localhost:19004/stats -o /dev/null | ||
} | ||
|
||
@test "s1 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21000 s1 | ||
} | ||
|
||
@test "s2 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21001 s2 | ||
} | ||
|
||
@test "s3-v1 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21002 s3 | ||
} | ||
|
||
@test "s3-v2 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21003 s3 | ||
} | ||
|
||
@test "s3 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21004 s3 | ||
} | ||
|
||
@test "s2 proxies should be healthy" { | ||
assert_service_has_healthy_instances s2 1 | ||
} | ||
|
||
@test "s3 proxies should be healthy" { | ||
assert_service_has_healthy_instances s3 3 | ||
} | ||
|
||
# Note: when failover is configured the cluster is named for the original | ||
# service not any destination related to failover. | ||
@test "s1 upstream should have healthy endpoints for s2 and s3 together" { | ||
assert_upstream_has_endpoints_in_status 127.0.0.1:19000 failover-target~s2.default.primary HEALTHY 1 | ||
} | ||
|
||
@test "s1 upstream should be able to connect to s2 via upstream s2 to start" { | ||
assert_expected_fortio_name s2 | ||
} | ||
|
||
@test "terminate instance of s2 envoy which should trigger failover to s3 when tcp check fails" { | ||
kill_envoy s2 | ||
} | ||
|
||
@test "s1 upstream should have healthy endpoints for s3-v1 and unhealthy endpoints for s2" { | ||
assert_upstream_has_endpoints_in_status 127.0.0.1:19000 failover-target~v1.s3.default.primary HEALTHY 1 | ||
assert_upstream_has_endpoints_in_status 127.0.0.1:19000 failover-target~s2.default.primary UNHEALTHY 1 | ||
} | ||
|
||
@test "s1 upstream should be able to connect to s3-v1 now" { | ||
assert_expected_fortio_name s3-v1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
services { | ||
name = "s1" | ||
port = 8079 | ||
connect { | ||
sidecar_service { | ||
proxy { | ||
upstreams = [ | ||
{ | ||
destination_name = "s2" | ||
local_bind_port = 5000 | ||
config { | ||
protocol = "grpc" | ||
} | ||
} | ||
] | ||
config { | ||
protocol = "grpc" | ||
envoy_dogstatsd_url = "udp://127.0.0.1:8125" | ||
envoy_stats_tags = ["foo=bar"] | ||
envoy_stats_flush_interval = "5s" | ||
} | ||
} | ||
} | ||
} | ||
services { | ||
name = "s1" | ||
port = 8079 | ||
connect { | ||
sidecar_service { | ||
proxy { | ||
upstreams = [ | ||
{ | ||
destination_name = "s2" | ||
local_bind_port = 5000 | ||
config { | ||
protocol = "grpc" | ||
} | ||
} | ||
] | ||
config { | ||
protocol = "grpc" | ||
envoy_dogstatsd_url = "udp://127.0.0.1:8125" | ||
envoy_stats_tags = ["foo=bar"] | ||
envoy_stats_flush_interval = "5s" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.