Skip to content

Commit

Permalink
Re-enable TcpProxySslIntegrationTest and make the tests pass again. (e…
Browse files Browse the repository at this point in the history
…nvoyproxy#4318)

Signed-off-by: Greg Greenway <ggreenway@apple.com>
  • Loading branch information
ggreenway authored Aug 31, 2018
1 parent 3553461 commit af1183c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions test/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ envoy_cc_test(
"tcp_proxy_integration_test.cc",
"tcp_proxy_integration_test.h",
],
data = [
"//test/config/integration/certs",
],
deps = [
":integration_lib",
"//source/common/event:dispatcher_includes",
Expand All @@ -536,6 +539,7 @@ envoy_cc_test(
"//source/common/ssl:context_lib",
"//source/extensions/access_loggers/file:config",
"//source/extensions/filters/network/tcp_proxy:config",
"//source/extensions/transport_sockets/ssl:config",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/secret:secret_mocks",
"//test/test_common:utility_lib",
Expand Down
5 changes: 5 additions & 0 deletions test/integration/tcp_proxy_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ TEST_P(TcpProxyIntegrationTest, TestIdletimeoutWithLargeOutstandingData) {
ASSERT_TRUE(fake_upstream_connection->waitForDisconnect(true));
}

INSTANTIATE_TEST_CASE_P(IpVersions, TcpProxySslIntegrationTest,
testing::ValuesIn(TestEnvironment::getIpVersionsForTest()),
TestUtility::ipTestParamsToString);

void TcpProxySslIntegrationTest::initialize() {
config_helper_.addSslConfig();
TcpProxyIntegrationTest::initialize();
Expand Down Expand Up @@ -450,6 +454,7 @@ TEST_P(TcpProxySslIntegrationTest, DownstreamHalfClose) {

Buffer::OwnedImpl empty_buffer;
ssl_client_->write(empty_buffer, true);
dispatcher_->run(Event::Dispatcher::RunType::NonBlock);
ASSERT_TRUE(fake_upstream_connection_->waitForHalfClose());

const std::string data("data");
Expand Down
11 changes: 6 additions & 5 deletions test/integration/tcp_proxy_integration_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class TcpProxyIntegrationTest : public BaseIntegrationTest,
enable_half_close_ = true;
}

void initialize() override;

void TearDown() override {
~TcpProxyIntegrationTest() {
test_server_.reset();
fake_upstreams_.clear();
}

void initialize() override;
};

class TcpProxySslIntegrationTest : public TcpProxyIntegrationTest {
Expand All @@ -33,14 +33,15 @@ class TcpProxySslIntegrationTest : public TcpProxyIntegrationTest {
void sendAndReceiveTlsData(const std::string& data_to_send_upstream,
const std::string& data_to_send_downstream);

Network::ClientConnectionPtr ssl_client_;
FakeRawConnectionPtr fake_upstream_connection_;
testing::NiceMock<Runtime::MockLoader> runtime_;
std::unique_ptr<Ssl::ContextManager> context_manager_;
Network::TransportSocketFactoryPtr context_;
ConnectionStatusCallbacks connect_callbacks_;
MockWatermarkBuffer* client_write_buffer_;
std::shared_ptr<WaitForPayloadReader> payload_reader_;
testing::NiceMock<Secret::MockSecretManager> secret_manager_;
Network::ClientConnectionPtr ssl_client_;
FakeRawConnectionPtr fake_upstream_connection_;
};

} // namespace
Expand Down

0 comments on commit af1183c

Please sign in to comment.