Skip to content

Commit

Permalink
[test] convert listener test stubs to v2 API (#6735)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Argueta <[email protected]>
  • Loading branch information
derekargueta authored and mattklein123 committed Apr 29, 2019
1 parent cdddf54 commit 56f2f0d
Show file tree
Hide file tree
Showing 5 changed files with 290 additions and 231 deletions.
17 changes: 9 additions & 8 deletions test/integration/echo_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ TEST_P(EchoIntegrationTest, Hello) {

TEST_P(EchoIntegrationTest, AddRemoveListener) {
const std::string json = TestEnvironment::substitute(R"EOF(
{
"name": "new_listener",
"address": "tcp://{{ ip_loopback_address }}:0",
"filters": [
{ "name": "echo", "config": {} }
]
}
name: new_listener
address:
socket_address:
address: "{{ ip_loopback_address }}"
port_value: 0
filter_chains:
- filters:
- name: envoy.echo
)EOF",
GetParam());

Expand All @@ -80,7 +81,7 @@ TEST_P(EchoIntegrationTest, AddRemoveListener) {
[&listener_added_by_worker]() -> void { listener_added_by_worker.setReady(); });
test_server_->server().dispatcher().post([this, json, &listener_added_by_manager]() -> void {
EXPECT_TRUE(test_server_->server().listenerManager().addOrUpdateListener(
Server::parseListenerFromJson(json), "", true));
Server::parseListenerFromV2Yaml(json), "", true));
listener_added_by_manager.setReady();
});
listener_added_by_worker.waitReady();
Expand Down
3 changes: 1 addition & 2 deletions test/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,8 @@ envoy_cc_test_library(
name = "utility_lib",
hdrs = ["utility.h"],
deps = [
"//source/common/config:lds_json_lib",
"//source/common/json:json_loader_lib",
"//source/common/protobuf:utility_lib",
"@envoy_api//envoy/api/v2:lds_cc",
],
)

Expand Down
Loading

0 comments on commit 56f2f0d

Please sign in to comment.