Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable TcpProxySslIntegrationTest and make the tests pass again. #4318

Merged
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
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