-
Notifications
You must be signed in to change notification settings - Fork 19
/
tcp_proxy_integration_test.h
49 lines (40 loc) · 1.41 KB
/
tcp_proxy_integration_test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <memory>
#include <string>
#include "test/integration/integration.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/secret/mocks.h"
#include "gtest/gtest.h"
namespace Envoy {
namespace {
class TcpProxyIntegrationTest : public BaseIntegrationTest,
public testing::TestWithParam<Network::Address::IpVersion> {
public:
TcpProxyIntegrationTest()
: BaseIntegrationTest(GetParam(), realTime(), ConfigHelper::TCP_PROXY_CONFIG) {
enable_half_close_ = true;
}
~TcpProxyIntegrationTest() {
test_server_.reset();
fake_upstreams_.clear();
}
void initialize() override;
};
class TcpProxySslIntegrationTest : public TcpProxyIntegrationTest {
public:
void initialize() override;
void setupConnections();
void sendAndReceiveTlsData(const std::string& data_to_send_upstream,
const std::string& data_to_send_downstream);
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
} // namespace Envoy