Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
Smjert committed Oct 19, 2024
1 parent 801fe40 commit f649004
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 3 additions & 5 deletions osquery/remote/tests/test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,15 @@ bool TLSServerRunner::start(const std::string& server_cert,
// Verify that the server is also actually ready to serve
retry = 0;
bool ready_to_serve = false;
setClientConfig();
while (retry < max_retry) {
std::string ping_server_uri =
"https://localhost:" + std::string(self.port_);

Request<TLSTransport, JSONSerializer> request(ping_server_uri);
Status status = request.call();
if (!status.ok()) {
LOG(WARNING) << "Python HTTP Server not ready yet: "
<< status.getMessage();
if (!status.ok() &&
status.getMessage().find("timeout") != std::string::npos) {
LOG(WARNING) << "Python HTTP Server not ready yet";
sleepFor(1000);
++retry;
continue;
Expand All @@ -180,7 +179,6 @@ bool TLSServerRunner::start(const std::string& server_cert,
ready_to_serve = true;
break;
}
unsetClientConfig();

if (!ready_to_serve) {
LOG(ERROR) << "The Python server was not ready to serve in time";
Expand Down
5 changes: 3 additions & 2 deletions osquery/remote/transports/tests/tls_transports_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ class TLSTransportsTests : public testing::Test {

void startServer(const std::string& server_cert = {},
bool verify_client_cert = false) {
certs_ = FLAGS_tls_server_certs;
FLAGS_tls_server_certs = "";
ASSERT_TRUE(TLSServerRunner::start(server_cert, verify_client_cert));
port_ = TLSServerRunner::port();

certs_ = FLAGS_tls_server_certs;
FLAGS_tls_server_certs = "";
}

void TearDown() override {
Expand Down

0 comments on commit f649004

Please sign in to comment.