Skip to content

Commit

Permalink
Porting the echo2 integration test to the v2 API. (envoyproxy#30)
Browse files Browse the repository at this point in the history
Bumping Envoy to 7aa956f1eb17454240646e55e13caf72db850af2
Porting the echo2 integration test to the v2 API.
Leaving the v1 json file in situ (unused) for legacy reference.

Signed-off-by: Alyssa Wilk <[email protected]>
  • Loading branch information
alyssawilk authored Dec 20, 2017
1 parent 8d68ffe commit e18d290
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ envoy_cc_library(
envoy_cc_test(
name = "echo2_integration_test",
srcs = ["echo2_integration_test.cc"],
data = ["echo2_server.json"],
data = ["echo2_server.yaml"],
repository = "@envoy",
deps = [
":echo2_config",
Expand Down
12 changes: 10 additions & 2 deletions echo2_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@
namespace Envoy {
class Echo2IntegrationTest : public BaseIntegrationTest,
public testing::TestWithParam<Network::Address::IpVersion> {

std::string echoConfig() {
return TestEnvironment::readFileToStringForTest(TestEnvironment::runfilesPath(
"echo2_server.yaml"));
}

public:
Echo2IntegrationTest() : BaseIntegrationTest(GetParam()) {}
Echo2IntegrationTest() : BaseIntegrationTest(GetParam(), echoConfig()) {}
/**
* Initializer for an individual integration test.
*/
void SetUp() override {
createTestServer("echo2_server.json", {"echo"});
named_ports_ = {{"echo"}};
BaseIntegrationTest::initialize();
}

/**
* Destructor for an individual integration test.
*/
void TearDown() override {
test_server_.reset();
fake_upstreams_.clear();
}
};

Expand Down
29 changes: 29 additions & 0 deletions echo2_server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
admin:
access_log_path: /dev/null
address:
socket_address:
address: 127.0.0.1
port_value: 0
static_resources:
clusters:
name: cluster_0
hosts:
socket_address:
address: 127.0.0.1
port_value: 0
listeners:
name: listener_0
address:
socket_address:
address: 127.0.0.1
port_value: 0
filter_chains:
filters:
name: envoy.ratelimit
config:
domain: foo
stats_prefix: name
descriptors: [{"key": "foo", "value": "bar"}]
filters:
name: envoy.echo
config:
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 274 files

0 comments on commit e18d290

Please sign in to comment.