@@ -35,21 +35,21 @@ class SSLTests : public PelotonTest {};
35
35
// The following keys and certificates are generated using
36
36
// https://www.postgresql.org/docs/9.5/static/libpq-ssl.html
37
37
// and then concate root.crt right after server.crt
38
- std::string client_crt = std::string(StringUtil::Format(
39
- " %s%s" , SOURCE_FOLDER, " /test/network/ssl/root.crt" ));
40
- std::string client_key = std::string(StringUtil::Format(
41
- " %s%s" , SOURCE_FOLDER, " /test/network/ssl/root.key" ));
42
- std::string server_crt = std::string(StringUtil::Format(
43
- " %s%s" , SOURCE_FOLDER, " /test/network/ssl/server.crt" ));
44
- std::string server_key = std::string(StringUtil::Format(
45
- " %s%s" , SOURCE_FOLDER, " /test/network/ssl/server.key" ));
46
- std::string root_crt = std::string(StringUtil::Format(
47
- " %s%s" , SOURCE_FOLDER, " /test/network/ssl/root.crt" ));
38
+ std::string client_crt = std::string(
39
+ StringUtil::Format ( " %s%s" , SOURCE_FOLDER, " /test/network/ssl/root.crt" ));
40
+ std::string client_key = std::string(
41
+ StringUtil::Format ( " %s%s" , SOURCE_FOLDER, " /test/network/ssl/root.key" ));
42
+ std::string server_crt = std::string(
43
+ StringUtil::Format ( " %s%s" , SOURCE_FOLDER, " /test/network/ssl/server.crt" ));
44
+ std::string server_key = std::string(
45
+ StringUtil::Format ( " %s%s" , SOURCE_FOLDER, " /test/network/ssl/server.key" ));
46
+ std::string root_crt = std::string(
47
+ StringUtil::Format ( " %s%s" , SOURCE_FOLDER, " /test/network/ssl/root.crt" ));
48
48
49
49
/* *
50
50
* Basic SSL connection test: Tested with valid certificats and key files
51
51
*/
52
- void *BasicTest (int port) {
52
+ void *TestRoutine (int port) {
53
53
try {
54
54
// forcing the factory to generate psql protocol handler
55
55
pqxx::connection C (StringUtil::Format (
@@ -118,6 +118,7 @@ void *BasicTest(int port) {
118
118
* Callback method to close server after client finishes
119
119
*/
120
120
TEST_F (SSLTests, BasicTest) {
121
+ EXPECT_EQ (0 , chmod (client_key.c_str (), S_IRUSR));
121
122
peloton::PelotonInit::Initialize ();
122
123
LOG_INFO (" Server initialized" );
123
124
peloton::network::PelotonServer peloton_server;
@@ -137,7 +138,7 @@ TEST_F(SSLTests, BasicTest) {
137
138
std::thread serverThread ([&] { peloton_server.ServerLoop (); });
138
139
139
140
// server & client running correctly
140
- BasicTest (port);
141
+ TestRoutine (port);
141
142
142
143
peloton_server.Close ();
143
144
serverThread.join ();
0 commit comments