Skip to content

Commit

Permalink
Refs #22024: Add BB test
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed Nov 5, 2024
1 parent 82059aa commit a300afe
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/blackbox/common/BlackboxTestsSecurity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5088,6 +5088,32 @@ TEST(Security, security_with_initial_peers_over_tcpv4_correctly_behaves)
tcp_server.block_for_all(std::chrono::seconds(10));
}

// Regression test for Redmine issue #22024
// OpenSSL assertion is not thrown when the library is abruptly finished.
TEST(Security, openssl_correctly_finishes)
{
// Create
PubSubWriter<HelloWorldPubSubType> writer("HelloWorldTopic_openssl_is_correctly_finished");
PubSubReader<HelloWorldPubSubType> reader("HelloWorldTopic_openssl_is_correctly_finished");

const std::string governance_file("governance_helloworld_all_enable.smime");
const std::string permissions_file("permissions_helloworld.smime");

CommonPermissionsConfigure(reader, writer, governance_file, permissions_file);

reader.init();
writer.init();

ASSERT_TRUE(reader.isInitialized());
ASSERT_TRUE(writer.isInitialized());

std::this_thread::sleep_for(std::chrono::seconds(2));

// Here we force the atexit function from openssl to be abruptly called
// i.e in a disordered way
// If OpenSSL is not correctly finished, a SIGSEGV will be thrown
std::exit(0);
}

void blackbox_security_init()
{
Expand Down

0 comments on commit a300afe

Please sign in to comment.