Skip to content

Commit

Permalink
tests: use makeOptRef to create an OptRef object (#37110)
Browse files Browse the repository at this point in the history
Signed-off-by: Adi Suissa-Peleg <[email protected]>
  • Loading branch information
adisuissa authored Nov 12, 2024
1 parent 8aa79ec commit e22f998
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -669,14 +669,14 @@ TEST_P(XdsFailoverAdsIntegrationTest, PrimaryUseAfterFailoverResponseAndDisconne
const absl::flat_hash_map<std::string, std::string> empty_initial_resource_versions_map;
EXPECT_TRUE(compareDiscoveryRequest(CdsTypeUrl, "", {}, {}, {}, true,
Grpc::Status::WellKnownGrpcStatus::Ok, "", xds_stream_.get(),
OptRef(empty_initial_resource_versions_map)));
makeOptRef(empty_initial_resource_versions_map)));
EXPECT_TRUE(compareDiscoveryRequest(EdsTypeUrl, "", {"failover_cluster_0"},
{"failover_cluster_0"}, {}, false,
Grpc::Status::WellKnownGrpcStatus::Ok, "", xds_stream_.get(),
OptRef(empty_initial_resource_versions_map)));
makeOptRef(empty_initial_resource_versions_map)));
EXPECT_TRUE(compareDiscoveryRequest(LdsTypeUrl, "", {}, {}, {}, false,
Grpc::Status::WellKnownGrpcStatus::Ok, "", xds_stream_.get(),
OptRef(empty_initial_resource_versions_map)));
makeOptRef(empty_initial_resource_versions_map)));
sendDiscoveryResponse<envoy::config::cluster::v3::Cluster>(
CdsTypeUrl, {ConfigHelper::buildCluster("primary_cluster_0")},
{ConfigHelper::buildCluster("primary_cluster_0")}, {}, "primary1", {}, xds_stream_.get());
Expand Down Expand Up @@ -791,14 +791,14 @@ TEST_P(XdsFailoverAdsIntegrationTest, FailoverUseAfterFailoverResponseAndDisconn
const absl::flat_hash_map<std::string, std::string> empty_initial_resource_versions_map;
EXPECT_TRUE(compareDiscoveryRequest(
CdsTypeUrl, "", {}, {}, {}, true, Grpc::Status::WellKnownGrpcStatus::Ok, "",
failover_xds_stream_.get(), OptRef(cds_eds_initial_resource_versions_map)));
failover_xds_stream_.get(), makeOptRef(cds_eds_initial_resource_versions_map)));
EXPECT_TRUE(compareDiscoveryRequest(
EdsTypeUrl, "", {"failover_cluster_0"}, {"failover_cluster_0"}, {}, false,
Grpc::Status::WellKnownGrpcStatus::Ok, "", failover_xds_stream_.get(),
OptRef(cds_eds_initial_resource_versions_map)));
makeOptRef(cds_eds_initial_resource_versions_map)));
EXPECT_TRUE(compareDiscoveryRequest(
LdsTypeUrl, "", {}, {}, {}, false, Grpc::Status::WellKnownGrpcStatus::Ok, "",
failover_xds_stream_.get(), OptRef(empty_initial_resource_versions_map)));
failover_xds_stream_.get(), makeOptRef(empty_initial_resource_versions_map)));
sendDiscoveryResponse<envoy::config::cluster::v3::Cluster>(
CdsTypeUrl, {ConfigHelper::buildCluster("failover_cluster_1")},
{ConfigHelper::buildCluster("failover_cluster_1")}, {}, "failover2", {},
Expand Down Expand Up @@ -1048,13 +1048,13 @@ TEST_P(XdsFailoverAdsIntegrationTest, NoPrimaryUseAfterFailoverResponse) {
const absl::flat_hash_map<std::string, std::string> empty_initial_resource_versions_map;
EXPECT_TRUE(compareDiscoveryRequest(
CdsTypeUrl, "1", {}, {}, {}, true, Grpc::Status::WellKnownGrpcStatus::Ok, "",
failover_xds_stream_.get(), OptRef(cds_eds_initial_resource_versions_map)));
failover_xds_stream_.get(), makeOptRef(cds_eds_initial_resource_versions_map)));
EXPECT_TRUE(compareDiscoveryRequest(
EdsTypeUrl, "1", {"failover_cluster_0"}, {"failover_cluster_0"}, {}, false,
Grpc::Status::WellKnownGrpcStatus::Ok, "", failover_xds_stream_.get(),
OptRef(cds_eds_initial_resource_versions_map)));
makeOptRef(cds_eds_initial_resource_versions_map)));
EXPECT_TRUE(compareDiscoveryRequest(
LdsTypeUrl, "", {}, {}, {}, false, Grpc::Status::WellKnownGrpcStatus::Ok, "",
failover_xds_stream_.get(), OptRef(empty_initial_resource_versions_map)));
failover_xds_stream_.get(), makeOptRef(empty_initial_resource_versions_map)));
}
} // namespace Envoy
6 changes: 3 additions & 3 deletions test/integration/ads_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2904,14 +2904,14 @@ TEST_P(AdsReplacementIntegrationTest, ReplaceAdsConfig) {
const absl::flat_hash_map<std::string, std::string> empty_initial_resource_versions_map;
EXPECT_TRUE(compareDiscoveryRequest(
Config::TypeUrl::get().Cluster, "", {}, {}, {}, true, Grpc::Status::WellKnownGrpcStatus::Ok,
"", second_xds_stream_.get(), OptRef(cds_eds_initial_resource_versions_map)));
"", second_xds_stream_.get(), makeOptRef(cds_eds_initial_resource_versions_map)));
EXPECT_TRUE(compareDiscoveryRequest(
Config::TypeUrl::get().ClusterLoadAssignment, "", {"cluster_0"}, {"cluster_0"}, {}, false,
Grpc::Status::WellKnownGrpcStatus::Ok, "", second_xds_stream_.get(),
OptRef(cds_eds_initial_resource_versions_map)));
makeOptRef(cds_eds_initial_resource_versions_map)));
EXPECT_TRUE(compareDiscoveryRequest(
Config::TypeUrl::get().Listener, "", {}, {}, {}, false, Grpc::Status::WellKnownGrpcStatus::Ok,
"", second_xds_stream_.get(), OptRef(empty_initial_resource_versions_map)));
"", second_xds_stream_.get(), makeOptRef(empty_initial_resource_versions_map)));
// Send a CDS response with new resources.
sendDiscoveryResponse<envoy::config::cluster::v3::Cluster>(
Config::TypeUrl::get().Cluster, {buildCluster("replaced_cluster")},
Expand Down

0 comments on commit e22f998

Please sign in to comment.