MCPcopy Create free account
hub / github.com/apache/impala / SslSmokeTestHelper

Function SslSmokeTestHelper

be/src/statestore/statestore-test.cc:75–102  ·  view source on GitHub ↗

Runs an SSL smoke test with provided parameters.

Source from the content-addressed store, hash-verified

73
74// Runs an SSL smoke test with provided parameters.
75void SslSmokeTestHelper(const string& server_ca_certificate,
76 const string& client_ca_certificate, bool sub_should_start) {
77 string impala_home(getenv("IMPALA_HOME"));
78 stringstream server_cert;
79 server_cert << impala_home << "/be/src/testutil/server-cert.pem";
80 // Override flags for the duration of this test. Modifying them while the statestore
81 // is running is unsafe.
82 FLAGS_ssl_server_certificate = server_ca_certificate;
83 FLAGS_ssl_client_ca_certificate = client_ca_certificate;
84 stringstream server_key;
85 server_key << impala_home << "/be/src/testutil/server-key.pem";
86 FLAGS_ssl_private_key = server_key.str();
87
88 // Thrift will internally pick an ephemeral port if we pass in 0 as the port.
89 int statestore_port = 0;
90 MetricGroup* metrics = perm_objects->Add(new MetricGroup("statestore"));
91 Statestore* statestore = perm_objects->Add(new Statestore(metrics));
92 ASSERT_OK(statestore->Init(statestore_port));
93
94 StatestoreSubscriber* sub = perm_objects->Add(
95 new StatestoreSubscriber("smoke_sub", MakeNetworkAddress("localhost", 0),
96 MakeNetworkAddress("localhost", statestore->port()), MakeNetworkAddress("", 0),
97 new MetricGroup(""), TStatestoreSubscriberType::COORDINATOR_EXECUTOR));
98 Status sub_status = sub->Start();
99 ASSERT_EQ(sub_should_start, sub_status.ok());
100
101 statestore->ShutdownForTesting();
102}
103
104string GetValidServerCert() {
105 string impala_home(getenv("IMPALA_HOME"));

Callers 1

TESTFunction · 0.85

Calls 8

MakeNetworkAddressFunction · 0.85
ShutdownForTestingMethod · 0.80
strMethod · 0.45
AddMethod · 0.45
InitMethod · 0.45
portMethod · 0.45
StartMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected