Add a check for custom host to ingress TLS integration test

This commit is contained in:
Kyle Havlovitz 2020-05-01 13:55:13 -07:00 committed by Chris Piraino
parent bebf1d5df9
commit a198282349
2 changed files with 11 additions and 1 deletions

View File

@ -12,10 +12,11 @@ config_entries {
listeners = [
{
port = 9999
protocol = "tcp"
protocol = "http"
services = [
{
name = "s1"
hosts = ["test.example.com"]
}
]
}

View File

@ -32,3 +32,12 @@ load helpers
[ "$status" -eq 0 ]
[ "$output" = "hello" ]
}
@test "should be able to connect to s1 through the TLS-enabled ingress port using the custom host" {
assert_dnssan_in_cert localhost:9999 'test.example.com'
run retry_default curl --cacert <(get_ca_root) -s -f -d hello \
--resolve test.example.com:9999:127.0.0.1 \
https://test.example.com:9999
[ "$status" -eq 0 ]
[ "$output" = "hello" ]
}