Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions echo2_integration_test.cc
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
#include "test/integration/integration.h"
#include "test/integration/utility.h"

class Echo2IntegrationTest : public BaseIntegrationTest, public testing::Test {
class Echo2IntegrationTest : public BaseIntegrationTest,
public testing::TestWithParam<Network::Address::IpVersion> {
public:
/**
* Global initializer for all integration tests.
* Initializer for an individual integration test.
*/
static void SetUpTestCase() {
createTestServer("echo2_server.json", {"echo"});
void SetUp() override {
createTestServer("echo2_server.json", GetParam(), {"echo"});
}

/**
* Global destructor for all integration tests.
* Destructor for an individual integration test.
*/
static void TearDownTestCase() {
void TearDown() override {
test_server_.reset();
}
};

TEST_F(Echo2IntegrationTest, Echo) {
INSTANTIATE_TEST_CASE_P(IpVersions, Echo2IntegrationTest,
testing::ValuesIn(TestEnvironment::getIpVersionsForTest()));

TEST_P(Echo2IntegrationTest, Echo) {
Buffer::OwnedImpl buffer("hello");
std::string response;
RawConnectionDriver connection(lookupPort("echo"), buffer,
RawConnectionDriver connection(lookupPort("echo"), GetParam(), buffer,
[&](Network::ClientConnection&, const Buffer::Instance& data)
-> void {
response.append(TestUtility::bufferToString(data));
Expand Down
2 changes: 1 addition & 1 deletion echo2_server.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"listeners": [
{
"address": "tcp://127.0.0.1:0",
"address": "tcp://{{ ip_loopback_address }}:0",
"use_original_dst": true,
"filters": [
{ "type": "read", "name": "ratelimit",
Expand Down