Skip to content

Commit

Permalink
test: deflake upstream starttls integration test (#16436)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Pakulski <[email protected]>
  • Loading branch information
cpakulski authored May 14, 2021
1 parent 1f4ca4c commit ae780e2
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 290 deletions.
1 change: 1 addition & 0 deletions source/common/network/connection_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class ConnectionImpl : public ConnectionImplBase,
// Reconsider how to make fairness happen.
void setTransportSocketIsReadable() override;
void flushWriteBuffer() override;
TransportSocketPtr& transportSocket() { return transport_socket_; }

// Obtain global next connection ID. This should only be used in tests.
static uint64_t nextGlobalIdForTest() { return next_global_id_; }
Expand Down
43 changes: 0 additions & 43 deletions test/config/utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,49 +146,6 @@ std::string ConfigHelper::startTlsConfig() {
TestEnvironment::runfilesPath("test/config/integration/certs/serverkey.pem")));
}

envoy::config::cluster::v3::Cluster ConfigHelper::buildStartTlsCluster(const std::string& address,
int port) {
API_NO_BOOST(envoy::config::cluster::v3::Cluster) cluster;
auto config_str = fmt::format(
R"EOF(
name: dummy_cluster
connect_timeout: 5s
type: STATIC
load_assignment:
cluster_name: dummy_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: {}
port_value: {}
transport_socket:
name: "starttls"
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.starttls.v3.UpstreamStartTlsConfig
cleartext_socket_config:
tls_socket_config:
common_tls_context:
tls_certificates:
certificate_chain:
filename: {}
private_key:
filename: {}
lb_policy: ROUND_ROBIN
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http2_protocol_options: {{}}
)EOF",
address, port, TestEnvironment::runfilesPath("test/config/integration/certs/clientcert.pem"),
TestEnvironment::runfilesPath("test/config/integration/certs/clientkey.pem"));

TestUtility::loadFromYaml(config_str, cluster);
return cluster;
}

std::string ConfigHelper::tlsInspectorFilter() {
return R"EOF(
name: "envoy.filters.listener.tls_inspector"
Expand Down
3 changes: 0 additions & 3 deletions test/extensions/transport_sockets/starttls/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ envoy_extension_cc_test(
extension_name = "envoy.transport_sockets.starttls",
deps = [
":starttls_integration_proto_cc_proto",
"//source/extensions/filters/network/tcp_proxy:config",
"//source/extensions/transport_sockets/raw_buffer:config",
"//source/extensions/transport_sockets/starttls:config",
"//test/integration:integration_lib",
"//test/test_common:registry_lib",
"@envoy_api//envoy/extensions/transport_sockets/raw_buffer/v3:pkg_cc_proto",
],
)
Loading

0 comments on commit ae780e2

Please sign in to comment.