From 60891587bb40711ad64056b0b85bb1c3264c6999 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 15 Jan 2021 18:35:48 -0800 Subject: [PATCH] Fix end2end test for ipv6 only platforms --- test/cpp/end2end/xds_end2end_test.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 9b719e89c05..5745a34e4f0 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -5991,6 +5991,10 @@ TEST_P(XdsEnabledServerTest, Basic) { backends_[0]->port()); listener.add_filter_chains(); balancers_[0]->ads_service()->SetLdsResource(listener); + listener.set_name( + absl::StrCat("grpc/server?xds.resource.listening_address=[::1]:", + backends_[0]->port())); + balancers_[0]->ads_service()->SetLdsResource(listener); WaitForBackend(0); CheckRpcSendOk(); } @@ -6141,7 +6145,7 @@ class XdsServerSecurityTest : public XdsEnd2endTest { ChannelArguments args; // Override target name for host name check args.SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, - ipv6_only_ ? "[::1]" : "127.0.0.1"); + ipv6_only_ ? "::1" : "127.0.0.1"); args.SetInt(GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, 1); std::string uri = absl::StrCat( ipv6_only_ ? "ipv6:[::1]:" : "ipv4:127.0.0.1:", backends_[0]->port()); @@ -6173,7 +6177,7 @@ class XdsServerSecurityTest : public XdsEnd2endTest { ChannelArguments args; // Override target name for host name check args.SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, - ipv6_only_ ? "[::1]" : "127.0.0.1"); + ipv6_only_ ? "::1" : "127.0.0.1"); args.SetInt(GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, 1); std::string uri = absl::StrCat( ipv6_only_ ? "ipv6:[::1]:" : "ipv4:127.0.0.1:", backends_[0]->port()); @@ -6204,7 +6208,7 @@ class XdsServerSecurityTest : public XdsEnd2endTest { ChannelArguments args; // Override target name for host name check args.SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, - ipv6_only_ ? "[::1]" : "127.0.0.1"); + ipv6_only_ ? "::1" : "127.0.0.1"); args.SetInt(GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, 1); std::string uri = absl::StrCat( ipv6_only_ ? "ipv6:[::1]:" : "ipv4:127.0.0.1:", backends_[0]->port());