From 3409eddcd15b5aa7181c8df0fdec9032f1a2ded4 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Wed, 7 Apr 2021 12:29:47 -0700 Subject: [PATCH] xds-end2end-test server-side LDS updates cleanup (#25906) --- test/cpp/end2end/xds_end2end_test.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 013199262cc..90f91f41046 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -7452,11 +7452,12 @@ class XdsServerSecurityTest : public XdsEnd2endTest { absl::string_view identity_certificate_name, bool require_client_certificates) { Listener listener; - listener.set_name( - absl::StrCat("grpc/server?xds.resource.listening_address=127.0.0.1:", - backends_[0]->port())); + listener.set_name(absl::StrCat( + ipv6_only_ ? "grpc/server?xds.resource.listening_address=[::1]:" + : "grpc/server?xds.resource.listening_address=127.0.0.1:", + backends_[0]->port())); listener.mutable_address()->mutable_socket_address()->set_address( - "127.0.0.1"); + ipv6_only_ ? "[::1]" : "127.0.0.1"); listener.mutable_address()->mutable_socket_address()->set_port_value( backends_[0]->port()); auto* filter_chain = listener.add_filter_chains(); @@ -7488,11 +7489,6 @@ class XdsServerSecurityTest : public XdsEnd2endTest { downstream_tls_context); } balancers_[0]->ads_service()->SetLdsResource(listener); - listener.set_name( - absl::StrCat("grpc/server?xds.resource.listening_address=[::1]:", - backends_[0]->port())); - listener.mutable_address()->mutable_socket_address()->set_address("[::1]"); - balancers_[0]->ads_service()->SetLdsResource(listener); } std::shared_ptr CreateMtlsChannel() {