From e9a68a971bff4b2c194fade3dc4ec3577c7f4fcd Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Fri, 12 Jun 2020 17:04:29 +0200 Subject: [PATCH] Add xfail label to flaky tests (#1254) * Refs #8641. Added macro to add 'xfail' label to tests listed on a file. Signed-off-by: Miguel Company * Refs #8641. Moved blackbox test code to subfolder Signed-off-by: Miguel Company * Refs #8641. Blackbox tests read list of flaky tests from a file. Signed-off-by: Miguel Company * Refs #8641. Add list of flaky Blackbox tests. Signed-off-by: Miguel Company * Refs #8641. Add list of flaky transport unit-tests. Signed-off-by: Miguel Company * Refs #8687. Fixing linters. Signed-off-by: Miguel Company --- cmake/common/gtest.cmake | 9 + test/blackbox/CMakeLists.txt | 27 ++- test/blackbox/TCPReqRepHelloWorldReplier.hpp | 145 ------------ test/blackbox/XFAIL_DDS_PIM.list | 8 + test/blackbox/XFAIL_DDS_PIM_SECURITY.list | 19 ++ test/blackbox/{ => common}/BlackboxTests.cpp | 4 +- test/blackbox/{ => common}/BlackboxTests.hpp | 25 +- .../{ => common}/BlackboxTestsAcknackQos.cpp | 0 .../{ => common}/BlackboxTestsDeadlineQos.cpp | 15 +- .../{ => common}/BlackboxTestsDiscovery.cpp | 151 ++++++------ .../{ => common}/BlackboxTestsKeys.cpp | 24 +- .../BlackboxTestsLatencyBudgetQos.cpp | 0 .../{ => common}/BlackboxTestsLifespanQoS.cpp | 15 +- .../BlackboxTestsLivelinessQos.cpp | 15 +- .../{ => common}/BlackboxTestsNetworkConf.cpp | 57 +++-- .../{ => common}/BlackboxTestsPubSubBasic.cpp | 45 ++-- .../BlackboxTestsPubSubFlowControllers.cpp | 3 +- .../BlackboxTestsPubSubFragments.cpp | 22 +- .../BlackboxTestsPubSubHistory.cpp | 17 +- .../BlackboxTestsRealtimeAllocations.cpp | 4 +- .../{ => common}/BlackboxTestsSecurity.cpp | 224 +++++++++++++----- .../BlackboxTestsTransportSHM.cpp | 94 ++++---- .../BlackboxTestsTransportTCP.cpp | 5 +- .../BlackboxTestsTransportUDP.cpp | 6 +- .../{ => common}/BlackboxTestsVolatile.cpp | 79 +++--- .../{ => common}/RTPSAsSocketReader.hpp | 23 +- .../{ => common}/RTPSAsSocketWriter.hpp | 9 +- .../{ => common}/RTPSBlackboxTests.cpp | 0 .../{ => common}/RTPSBlackboxTestsBasic.cpp | 4 +- .../RTPSBlackboxTestsPersistence.cpp | 5 +- .../RTPSBlackboxTestsVolatile.cpp | 15 +- .../RTPSWithRegistrationReader.hpp | 39 +-- .../RTPSWithRegistrationWriter.hpp | 16 +- .../TCPReqRepHelloWorldReplier.cpp | 14 +- .../common/TCPReqRepHelloWorldReplier.hpp | 187 +++++++++++++++ .../TCPReqRepHelloWorldRequester.cpp | 21 +- .../TCPReqRepHelloWorldRequester.hpp | 18 +- test/blackbox/utils/data_generators.cpp | 160 ++++++------- test/blackbox/utils/lambda_functions.cpp | 40 ++-- test/blackbox/utils/print_functions.cpp | 49 ++-- test/unittest/transport/CMakeLists.txt | 11 +- test/unittest/transport/XFAIL_SHM.list | 1 + 42 files changed, 951 insertions(+), 674 deletions(-) delete mode 100644 test/blackbox/TCPReqRepHelloWorldReplier.hpp create mode 100644 test/blackbox/XFAIL_DDS_PIM.list create mode 100644 test/blackbox/XFAIL_DDS_PIM_SECURITY.list rename test/blackbox/{ => common}/BlackboxTests.cpp (98%) rename test/blackbox/{ => common}/BlackboxTests.hpp (86%) rename test/blackbox/{ => common}/BlackboxTestsAcknackQos.cpp (100%) rename test/blackbox/{ => common}/BlackboxTestsDeadlineQos.cpp (97%) rename test/blackbox/{ => common}/BlackboxTestsDiscovery.cpp (89%) rename test/blackbox/{ => common}/BlackboxTestsKeys.cpp (96%) rename test/blackbox/{ => common}/BlackboxTestsLatencyBudgetQos.cpp (100%) rename test/blackbox/{ => common}/BlackboxTestsLifespanQoS.cpp (97%) rename test/blackbox/{ => common}/BlackboxTestsLivelinessQos.cpp (99%) rename test/blackbox/{ => common}/BlackboxTestsNetworkConf.cpp (76%) rename test/blackbox/{ => common}/BlackboxTestsPubSubBasic.cpp (93%) rename test/blackbox/{ => common}/BlackboxTestsPubSubFlowControllers.cpp (99%) rename test/blackbox/{ => common}/BlackboxTestsPubSubFragments.cpp (97%) rename test/blackbox/{ => common}/BlackboxTestsPubSubHistory.cpp (98%) rename test/blackbox/{ => common}/BlackboxTestsRealtimeAllocations.cpp (99%) rename test/blackbox/{ => common}/BlackboxTestsSecurity.cpp (97%) rename test/blackbox/{ => common}/BlackboxTestsTransportSHM.cpp (85%) rename test/blackbox/{ => common}/BlackboxTestsTransportTCP.cpp (99%) rename test/blackbox/{ => common}/BlackboxTestsTransportUDP.cpp (97%) rename test/blackbox/{ => common}/BlackboxTestsVolatile.cpp (88%) rename test/blackbox/{ => common}/RTPSAsSocketReader.hpp (96%) rename test/blackbox/{ => common}/RTPSAsSocketWriter.hpp (96%) rename test/blackbox/{ => common}/RTPSBlackboxTests.cpp (100%) rename test/blackbox/{ => common}/RTPSBlackboxTestsBasic.cpp (99%) rename test/blackbox/{ => common}/RTPSBlackboxTestsPersistence.cpp (99%) rename test/blackbox/{ => common}/RTPSBlackboxTestsVolatile.cpp (94%) rename test/blackbox/{ => common}/RTPSWithRegistrationReader.hpp (94%) rename test/blackbox/{ => common}/RTPSWithRegistrationWriter.hpp (97%) rename test/blackbox/{ => common}/TCPReqRepHelloWorldReplier.cpp (96%) create mode 100644 test/blackbox/common/TCPReqRepHelloWorldReplier.hpp rename test/blackbox/{ => common}/TCPReqRepHelloWorldRequester.cpp (95%) rename test/blackbox/{ => common}/TCPReqRepHelloWorldRequester.hpp (96%) create mode 100644 test/unittest/transport/XFAIL_SHM.list diff --git a/cmake/common/gtest.cmake b/cmake/common/gtest.cmake index f7a7a362016..656f70e5bbb 100644 --- a/cmake/common/gtest.cmake +++ b/cmake/common/gtest.cmake @@ -161,3 +161,12 @@ macro(add_gtest) set_property(TEST ${test} PROPERTY LABELS "${GTEST_LABELS}") endif() endmacro() + +macro(add_xfail_label LIST_FILE) + if(GTEST_INDIVIDUAL AND EXISTS ${LIST_FILE}) + file(STRINGS ${LIST_FILE} TEST_LIST) + foreach(XFAIL_TEST ${TEST_LIST}) + set_property(TEST ${XFAIL_TEST} PROPERTY LABELS xfail) + endforeach() + endif() +endmacro() diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt index 08988537ec0..c277af6dcb6 100644 --- a/test/blackbox/CMakeLists.txt +++ b/test/blackbox/CMakeLists.txt @@ -162,7 +162,7 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) ############################################################################### # Unit tests ############################################################################### - file(GLOB RTPS_BLACKBOXTESTS_TEST_SOURCE "RTPSBlackboxTests*.cpp") + file(GLOB RTPS_BLACKBOXTESTS_TEST_SOURCE "common/RTPSBlackboxTests*.cpp") set(RTPS_BLACKBOXTESTS_SOURCE ${RTPS_BLACKBOXTESTS_TEST_SOURCE} types/HelloWorld.cpp types/HelloWorldType.cpp @@ -188,10 +188,9 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) target_include_directories(BlackboxTests_RTPS PRIVATE ${GTEST_INCLUDE_DIRS}) target_link_libraries(BlackboxTests_RTPS fastrtps fastcdr foonathan_memory ${GTEST_LIBRARIES}) - add_blackbox_gtest(BlackboxTests_RTPS SOURCES ${RTPS_BLACKBOXTESTS_TEST_SOURCE} - ) + add_blackbox_gtest(BlackboxTests_RTPS SOURCES ${RTPS_BLACKBOXTESTS_TEST_SOURCE}) - file(GLOB BLACKBOXTESTS_TEST_SOURCE "BlackboxTests*.cpp") + file(GLOB BLACKBOXTESTS_TEST_SOURCE "common/BlackboxTests*.cpp") set(BLACKBOXTESTS_SOURCE ${BLACKBOXTESTS_TEST_SOURCE} types/HelloWorld.cpp types/HelloWorldType.cpp @@ -210,8 +209,8 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) utils/lambda_functions.cpp utils/print_functions.cpp - TCPReqRepHelloWorldRequester.cpp - TCPReqRepHelloWorldReplier.cpp + common/TCPReqRepHelloWorldRequester.cpp + common/TCPReqRepHelloWorldReplier.cpp ) # Prepare static discovery xml file for blackbox tests. @@ -275,5 +274,21 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) "MULTICAST_PORT_RANDOM_NUMBER=${MULTICAST_PORT_RANDOM_NUMBER}" ) endif(FASTDDS_PIM_API_TESTS) + + # Add 'xfail' label to flaky tests + set(BLACKBOX_XFAIL_LIST XFAIL_RTPS) + if(FASTRTPS_API_TESTS) + set(BLACKBOX_XFAIL_LIST ${BLACKBOX_XFAIL_LIST} XFAIL_FASTRTPS) + endif() + if(FASTDDS_PIM_API_TESTS) + set(BLACKBOX_XFAIL_LIST ${BLACKBOX_XFAIL_LIST} XFAIL_DDS_PIM) + endif() + + foreach(BLACKBOX_XFAIL_TEST ${BLACKBOX_XFAIL_LIST}) + add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${BLACKBOX_XFAIL_TEST}.list) + if(SECURITY) + add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${BLACKBOX_XFAIL_TEST}_SECURITY.list) + endif() + endforeach() endif() endif() diff --git a/test/blackbox/TCPReqRepHelloWorldReplier.hpp b/test/blackbox/TCPReqRepHelloWorldReplier.hpp deleted file mode 100644 index e1be2c0f242..00000000000 --- a/test/blackbox/TCPReqRepHelloWorldReplier.hpp +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TCPReqRepHelloWorldReplier.hpp - * - */ - -#ifndef _TEST_BLACKBOX_TCPReqRepHelloWorldReplier_HPP_ -#define _TEST_BLACKBOX_TCPReqRepHelloWorldReplier_HPP_ - -#include "types/HelloWorldType.h" - -#include -#include -#include -#include -#include - -#include -#include -#include - -#if defined(_WIN32) -#define GET_PID _getpid -#include -#else -#define GET_PID getpid -#endif - - - -class TCPReqRepHelloWorldReplier -{ - public: - - class ReplyListener: public eprosima::fastrtps::SubscriberListener - { - public: - ReplyListener(TCPReqRepHelloWorldReplier &replier) : replier_(replier) {}; - ~ReplyListener(){}; - void onNewDataMessage(eprosima::fastrtps::Subscriber *sub); - void onSubscriptionMatched(eprosima::fastrtps::Subscriber* /*sub*/, eprosima::fastrtps::rtps::MatchingInfo& info) - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - replier_.matched(); - } - - private: - - ReplyListener& operator=(const ReplyListener&) = delete; - - TCPReqRepHelloWorldReplier &replier_; - } request_listener_; - - class RequestListener : public eprosima::fastrtps::PublisherListener - { - public: - - RequestListener(TCPReqRepHelloWorldReplier &replier) : replier_(replier){}; - ~RequestListener(){}; - void onPublicationMatched(eprosima::fastrtps::Publisher* /*pub*/, eprosima::fastrtps::rtps::MatchingInfo &info) - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - replier_.matched(); - } - - private: - - RequestListener& operator=(const RequestListener&) = delete; - - TCPReqRepHelloWorldReplier &replier_; - - } reply_listener_; - - TCPReqRepHelloWorldReplier(); - virtual ~TCPReqRepHelloWorldReplier(); - void init( - int participantId, - int domainId, - uint16_t listeningPort, - uint32_t maxInitialPeer = 0, - const char* certs_path = nullptr); - bool isInitialized() const { return initialized_; } - void newNumber(eprosima::fastrtps::rtps::SampleIdentity sample_identity, uint16_t number); - void wait_discovery(std::chrono::seconds timeout = std::chrono::seconds::zero()); - void matched(); - bool is_matched(); - - virtual void configSubscriber(const std::string& suffix) - { - sattr.qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; - - std::ostringstream t; - - t << "TCPReqRepHelloworld_" << asio::ip::host_name() << "_" << GET_PID() << "_" << suffix; - - sattr.topic.topicName = t.str(); - }; - - virtual void configPublisher(const std::string& suffix) - { - puattr.qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; - - // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some - // big CPU overhead sometimes - puattr.qos.m_reliability.max_blocking_time.seconds = 1; - puattr.qos.m_reliability.max_blocking_time.nanosec = 0; - - std::ostringstream t; - - t << "TCPReqRepHelloworld_" << asio::ip::host_name() << "_" << GET_PID() << "_" << suffix; - - puattr.topic.topicName = t.str(); - } - - protected: - eprosima::fastrtps::SubscriberAttributes sattr; - eprosima::fastrtps::PublisherAttributes puattr; - private: - - TCPReqRepHelloWorldReplier& operator=(const TCPReqRepHelloWorldReplier&)= delete; - - eprosima::fastrtps::Participant *participant_; - eprosima::fastrtps::Subscriber *request_subscriber_; - eprosima::fastrtps::Publisher *reply_publisher_; - bool initialized_; - std::mutex mutexDiscovery_; - std::condition_variable cvDiscovery_; - std::atomic matched_; - HelloWorldType type_; -}; - -#endif // _TEST_BLACKBOX_TCPReqRepHelloWorldReplier_HPP_ diff --git a/test/blackbox/XFAIL_DDS_PIM.list b/test/blackbox/XFAIL_DDS_PIM.list new file mode 100644 index 00000000000..8200b89e7a6 --- /dev/null +++ b/test/blackbox/XFAIL_DDS_PIM.list @@ -0,0 +1,8 @@ +BlackboxTests_DDS_PIM.Discovery.ParticipantLivelinessAssertion +BlackboxTests_DDS_PIM.LivelinessQos.LongLiveliness_ManualByParticipant_BestEffort.NonIntraprocess +BlackboxTests_DDS_PIM.LivelinessQos.ShortLiveliness_ManualByParticipant_Automatic_BestEffort.Intraprocess +BlackboxTests_DDS_PIM.LivelinessQos.ShortLiveliness_ManualByTopic_Automatic_BestEffort.NonIntraprocess +BlackboxTests_DDS_PIM.LivelinessQos.ShortLiveliness_ManualByTopic_Automatic_Reliable.NonIntraprocess +BlackboxTests_DDS_PIM.LivelinessQos.ThreeWriters_ThreeReaders.Intraprocess +BlackboxTests_DDS_PIM.LivelinessQos.ThreeWriters_ThreeReaders.NonIntraprocess +BlackboxTests_DDS_PIM.LivelinessQos.TwoWriters_OneReader_ManualByParticipant.Intraprocess diff --git a/test/blackbox/XFAIL_DDS_PIM_SECURITY.list b/test/blackbox/XFAIL_DDS_PIM_SECURITY.list new file mode 100644 index 00000000000..ea88f32fc5b --- /dev/null +++ b/test/blackbox/XFAIL_DDS_PIM_SECURITY.list @@ -0,0 +1,19 @@ +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_enable_discovery_enable_access_encrypt.Intraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt.Intraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_encrypt.Intraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_none.Intraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_enable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_disable_access_encrypt.Intraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_enable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_none.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_disable_discovery_disable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_encrypt.Intraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_encrypt.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_none.NonIntraprocess +BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndCryptoPlugin_reliable_all_ok.NonIntraprocess diff --git a/test/blackbox/BlackboxTests.cpp b/test/blackbox/common/BlackboxTests.cpp similarity index 98% rename from test/blackbox/BlackboxTests.cpp rename to test/blackbox/common/BlackboxTests.cpp index 9efd5558122..491395935ed 100644 --- a/test/blackbox/BlackboxTests.cpp +++ b/test/blackbox/common/BlackboxTests.cpp @@ -92,10 +92,10 @@ int main( #if HAVE_SECURITY blackbox_security_init(); -#endif +#endif // if HAVE_SECURITY #if TLS_FOUND tls_init(); -#endif +#endif // if TLS_FOUND return RUN_ALL_TESTS(); } diff --git a/test/blackbox/BlackboxTests.hpp b/test/blackbox/common/BlackboxTests.hpp similarity index 86% rename from test/blackbox/BlackboxTests.hpp rename to test/blackbox/common/BlackboxTests.hpp index b148a3abe6c..dea6ae12b51 100644 --- a/test/blackbox/BlackboxTests.hpp +++ b/test/blackbox/common/BlackboxTests.hpp @@ -15,7 +15,9 @@ #ifndef __BLACKBOX_BLACKBOXTESTS_HPP__ #define __BLACKBOX_BLACKBOXTESTS_HPP__ -#define TEST_TOPIC_NAME std::string(::testing::UnitTest::GetInstance()->current_test_info()->test_case_name() + std::string("_") + ::testing::UnitTest::GetInstance()->current_test_info()->name()) +#define TEST_TOPIC_NAME std::string( \ + ::testing::UnitTest::GetInstance()->current_test_info()->test_case_name() + std::string( \ + "_") + ::testing::UnitTest::GetInstance()->current_test_info()->name()) #if defined(_WIN32) #define GET_PID _getpid @@ -24,14 +26,14 @@ #define GET_PID getpid #include #include -#endif +#endif // if defined(_WIN32) -#include "types/HelloWorldType.h" -#include "types/FixedSizedType.h" -#include "types/KeyedHelloWorldType.h" -#include "types/StringType.h" -#include "types/Data64kbType.h" -#include "types/Data1mbType.h" +#include "../types/HelloWorldType.h" +#include "../types/FixedSizedType.h" +#include "../types/KeyedHelloWorldType.h" +#include "../types/StringType.h" +#include "../types/Data64kbType.h" +#include "../types/Data1mbType.h" #include #include @@ -41,10 +43,10 @@ #if HAVE_SECURITY extern void blackbox_security_init(); -#endif +#endif // if HAVE_SECURITY #if TLS_FOUND extern void tls_init(); -#endif +#endif // if TLS_FOUND extern uint16_t global_port; @@ -137,7 +139,8 @@ std::list default_data300kb_data_generator( std::list default_data300kb_mix_data_generator( size_t max = 0); -std::list default_data96kb_data300kb_data_generator(size_t max = 0); +std::list default_data96kb_data300kb_data_generator( + size_t max = 0); /****** Auxiliary lambda functions ******/ extern const std::function default_helloworld_print; diff --git a/test/blackbox/BlackboxTestsAcknackQos.cpp b/test/blackbox/common/BlackboxTestsAcknackQos.cpp similarity index 100% rename from test/blackbox/BlackboxTestsAcknackQos.cpp rename to test/blackbox/common/BlackboxTestsAcknackQos.cpp diff --git a/test/blackbox/BlackboxTestsDeadlineQos.cpp b/test/blackbox/common/BlackboxTestsDeadlineQos.cpp similarity index 97% rename from test/blackbox/BlackboxTestsDeadlineQos.cpp rename to test/blackbox/common/BlackboxTestsDeadlineQos.cpp index 33a96f3f2f2..f5d514e5527 100644 --- a/test/blackbox/BlackboxTestsDeadlineQos.cpp +++ b/test/blackbox/common/BlackboxTestsDeadlineQos.cpp @@ -238,10 +238,11 @@ TEST_P(DeadlineQos, KeyedTopicShortDeadline) INSTANTIATE_TEST_CASE_P(DeadlineQos, DeadlineQos, testing::Values(false, true), - [](const testing::TestParamInfo& info) { - if (info.param) - { - return "Intraprocess"; - } - return "NonIntraprocess"; -}); + [](const testing::TestParamInfo& info) + { + if (info.param) + { + return "Intraprocess"; + } + return "NonIntraprocess"; + }); diff --git a/test/blackbox/BlackboxTestsDiscovery.cpp b/test/blackbox/common/BlackboxTestsDiscovery.cpp similarity index 89% rename from test/blackbox/BlackboxTestsDiscovery.cpp rename to test/blackbox/common/BlackboxTestsDiscovery.cpp index c8ed314e13a..b948f9ce50c 100644 --- a/test/blackbox/BlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/BlackboxTestsDiscovery.cpp @@ -333,14 +333,14 @@ TEST(Discovery, ParticipantLivelinessAssertion) test_UDPv4Transport::always_drop_participant_builtin_topic_data = true; std::thread thread([&writer]() - { - HelloWorld msg; - for (int count = 0; count < 20; ++count) - { - writer.send_sample(msg); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - } - }); + { + HelloWorld msg; + for (int count = 0; count < 20; ++count) + { + writer.send_sample(msg); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + }); EXPECT_FALSE(reader.wait_participant_undiscovery(std::chrono::seconds(1))); EXPECT_FALSE(writer.wait_participant_undiscovery(std::chrono::seconds(1))); @@ -501,24 +501,25 @@ TEST_P(Discovery, PubSubAsReliableHelloworldParticipantDiscovery) ASSERT_TRUE(writer.isInitialized()); int count = 0; - reader.setOnDiscoveryFunction([&writer, &count](const ParticipantDiscoveryInfo& info) -> bool { - if (info.info.m_guid == writer.participant_guid()) - { - if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) - { - std::cout << "Discovered participant " << info.info.m_guid << std::endl; - ++count; - } - else if (info.status == ParticipantDiscoveryInfo::REMOVED_PARTICIPANT || - info.status == ParticipantDiscoveryInfo::DROPPED_PARTICIPANT) + reader.setOnDiscoveryFunction([&writer, &count](const ParticipantDiscoveryInfo& info) -> bool { - std::cout << "Removed participant " << info.info.m_guid << std::endl; - return ++count == 2; - } - } - - return false; - }); + if (info.info.m_guid == writer.participant_guid()) + { + if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) + { + std::cout << "Discovered participant " << info.info.m_guid << std::endl; + ++count; + } + else if (info.status == ParticipantDiscoveryInfo::REMOVED_PARTICIPANT || + info.status == ParticipantDiscoveryInfo::DROPPED_PARTICIPANT) + { + std::cout << "Removed participant " << info.info.m_guid << std::endl; + return ++count == 2; + } + } + + return false; + }); reader.history_depth(100). reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); @@ -545,19 +546,20 @@ TEST_P(Discovery, PubSubAsReliableHelloworldUserData) ASSERT_TRUE(writer.isInitialized()); - reader.setOnDiscoveryFunction([&writer](const ParticipantDiscoveryInfo& info) -> bool { - if (info.info.m_guid == writer.participant_guid()) - { - std::cout << "Received USER_DATA from the writer: "; - for (auto i: info.info.m_userData) + reader.setOnDiscoveryFunction([&writer](const ParticipantDiscoveryInfo& info) -> bool { - std::cout << i << ' '; - } - return info.info.m_userData == std::vector({'a', 'b', 'c', 'd'}); - } - - return false; - }); + if (info.info.m_guid == writer.participant_guid()) + { + std::cout << "Received USER_DATA from the writer: "; + for (auto i: info.info.m_userData) + { + std::cout << i << ' '; + } + return info.info.m_userData == std::vector({'a', 'b', 'c', 'd'}); + } + + return false; + }); reader.history_depth(100). reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); @@ -726,18 +728,18 @@ TEST_P(Discovery, RepeatPubGuid) PubSubWriter writer2(TEST_TOPIC_NAME); reader - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) - .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .participant_id(2) - .init(); + .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_depth(10) + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .participant_id(2) + .init(); writer - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) - .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .participant_id(1) - .init(); + .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_depth(10) + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .participant_id(1) + .init(); ASSERT_TRUE(reader.isInitialized()); ASSERT_TRUE(writer.isInitialized()); @@ -761,11 +763,11 @@ TEST_P(Discovery, RepeatPubGuid) reader.wait_participant_undiscovery(); writer2 - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) - .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .participant_id(1) - .init(); + .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_depth(10) + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .participant_id(1) + .init(); ASSERT_TRUE(writer2.isInitialized()); @@ -795,13 +797,13 @@ TEST_P(Discovery, EndpointCreationMultithreaded) participant_1.init(); auto endpoint_creation_process = [&creation_sleep, &stop, &participant_1]() - { - while (!stop) - { - std::this_thread::sleep_for(creation_sleep); - EXPECT_NO_THROW(participant_1.create_additional_topics(1)); - } - }; + { + while (!stop) + { + std::this_thread::sleep_for(creation_sleep); + EXPECT_NO_THROW(participant_1.create_additional_topics(1)); + } + }; // Start thread creating endpoints every 250ms std::thread endpoint_thr(endpoint_creation_process); @@ -810,20 +812,20 @@ TEST_P(Discovery, EndpointCreationMultithreaded) // When this participant is removed, the first one should stop sending // intraprocess delivery messages to the builtin endpoints of the second one. auto second_participant_process = [&participant_1]() - { - { - PubSubWriterReader participant_2(TEST_TOPIC_NAME); - participant_2.init(); - - // Ensure first participant has discovered the second one - participant_1.wait_discovery(); - } - - // Additional endpoints created just after the second participant. - // This gives the first participant very few time to receive the undiscovery, - // and makes the intraprocess delivery on a deleted builtin reader. - participant_1.create_additional_topics(1); - }; + { + { + PubSubWriterReader participant_2(TEST_TOPIC_NAME); + participant_2.init(); + + // Ensure first participant has discovered the second one + participant_1.wait_discovery(); + } + + // Additional endpoints created just after the second participant. + // This gives the first participant very few time to receive the undiscovery, + // and makes the intraprocess delivery on a deleted builtin reader. + participant_1.create_additional_topics(1); + }; EXPECT_NO_THROW(second_participant_process()); // Stop endpoint creation thread @@ -834,7 +836,8 @@ TEST_P(Discovery, EndpointCreationMultithreaded) INSTANTIATE_TEST_CASE_P(Discovery, Discovery, testing::Values(false, true), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) + { if (info.param) { return "Intraprocess"; diff --git a/test/blackbox/BlackboxTestsKeys.cpp b/test/blackbox/common/BlackboxTestsKeys.cpp similarity index 96% rename from test/blackbox/BlackboxTestsKeys.cpp rename to test/blackbox/common/BlackboxTestsKeys.cpp index a4672cea74c..41023495724 100644 --- a/test/blackbox/BlackboxTestsKeys.cpp +++ b/test/blackbox/common/BlackboxTestsKeys.cpp @@ -56,8 +56,8 @@ TEST(KeyedTopic, RegistrationFail) PubSubWriter writer(TEST_TOPIC_NAME); writer. - resource_limits_max_instances(1). - init(); + resource_limits_max_instances(1). + init(); ASSERT_TRUE(writer.isInitialized()); @@ -73,8 +73,8 @@ TEST(KeyedTopic, UnregistrationFail) PubSubWriter writer(TEST_TOPIC_NAME); writer. - resource_limits_max_instances(1). - init(); + resource_limits_max_instances(1). + init(); ASSERT_TRUE(writer.isInitialized()); @@ -91,8 +91,8 @@ TEST(KeyedTopic, DisposeFail) PubSubWriter writer(TEST_TOPIC_NAME); writer. - resource_limits_max_instances(1). - init(); + resource_limits_max_instances(1). + init(); ASSERT_TRUE(writer.isInitialized()); @@ -109,8 +109,8 @@ TEST(KeyedTopic, RegistrationAfterUnregistration) PubSubWriter writer(TEST_TOPIC_NAME); writer. - resource_limits_max_instances(1). - init(); + resource_limits_max_instances(1). + init(); ASSERT_TRUE(writer.isInitialized()); @@ -136,8 +136,8 @@ TEST(KeyedTopic, RegistrationAfterDispose) PubSubWriter writer(TEST_TOPIC_NAME); writer. - resource_limits_max_instances(1). - init(); + resource_limits_max_instances(1). + init(); ASSERT_TRUE(writer.isInitialized()); @@ -160,8 +160,8 @@ TEST(KeyedTopic, UnregisterWhenHistoryKeepAll) PubSubWriter writer(TEST_TOPIC_NAME); writer. - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - init(); + history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + init(); ASSERT_TRUE(writer.isInitialized()); diff --git a/test/blackbox/BlackboxTestsLatencyBudgetQos.cpp b/test/blackbox/common/BlackboxTestsLatencyBudgetQos.cpp similarity index 100% rename from test/blackbox/BlackboxTestsLatencyBudgetQos.cpp rename to test/blackbox/common/BlackboxTestsLatencyBudgetQos.cpp diff --git a/test/blackbox/BlackboxTestsLifespanQoS.cpp b/test/blackbox/common/BlackboxTestsLifespanQoS.cpp similarity index 97% rename from test/blackbox/BlackboxTestsLifespanQoS.cpp rename to test/blackbox/common/BlackboxTestsLifespanQoS.cpp index 67ff1789801..11b0596a200 100644 --- a/test/blackbox/BlackboxTestsLifespanQoS.cpp +++ b/test/blackbox/common/BlackboxTestsLifespanQoS.cpp @@ -157,11 +157,12 @@ TEST_P(LifespanQos, ShortLifespan) INSTANTIATE_TEST_CASE_P(LifespanQos, LifespanQos, testing::Values(false, true), - [](const testing::TestParamInfo& info) { - if (info.param) - { - return "Intraprocess"; - } - return "NonIntraprocess"; -}); + [](const testing::TestParamInfo& info) + { + if (info.param) + { + return "Intraprocess"; + } + return "NonIntraprocess"; + }); diff --git a/test/blackbox/BlackboxTestsLivelinessQos.cpp b/test/blackbox/common/BlackboxTestsLivelinessQos.cpp similarity index 99% rename from test/blackbox/BlackboxTestsLivelinessQos.cpp rename to test/blackbox/common/BlackboxTestsLivelinessQos.cpp index a98bcb9ee97..6242cf25783 100644 --- a/test/blackbox/BlackboxTestsLivelinessQos.cpp +++ b/test/blackbox/common/BlackboxTestsLivelinessQos.cpp @@ -1670,11 +1670,12 @@ TEST_P(LivelinessQos, AssertLivelinessParticipant) INSTANTIATE_TEST_CASE_P(LivelinessQos, LivelinessQos, testing::Values(false, true), - [](const testing::TestParamInfo& info) { - if (info.param) - { - return "Intraprocess"; - } - return "NonIntraprocess"; -}); + [](const testing::TestParamInfo& info) + { + if (info.param) + { + return "Intraprocess"; + } + return "NonIntraprocess"; + }); diff --git a/test/blackbox/BlackboxTestsNetworkConf.cpp b/test/blackbox/common/BlackboxTestsNetworkConf.cpp similarity index 76% rename from test/blackbox/BlackboxTestsNetworkConf.cpp rename to test/blackbox/common/BlackboxTestsNetworkConf.cpp index fdd8691262a..22bc62006ca 100644 --- a/test/blackbox/BlackboxTestsNetworkConf.cpp +++ b/test/blackbox/common/BlackboxTestsNetworkConf.cpp @@ -27,17 +27,21 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; -static void GetIP4s(std::vector& interfaces) +static void GetIP4s( + std::vector& interfaces) { IPFinder::getIPs(&interfaces, false); auto new_end = remove_if(interfaces.begin(), - interfaces.end(), - [](IPFinder::info_IP ip){return ip.type != IPFinder::IP4 && ip.type != IPFinder::IP4_LOCAL;}); + interfaces.end(), + [](IPFinder::info_IP ip) + { + return ip.type != IPFinder::IP4 && ip.type != IPFinder::IP4_LOCAL; + }); interfaces.erase(new_end, interfaces.end()); std::for_each(interfaces.begin(), interfaces.end(), [](IPFinder::info_IP& loc) - { - loc.locator.kind = LOCATOR_KIND_UDPv4; - }); + { + loc.locator.kind = LOCATOR_KIND_UDPv4; + }); } //Verify that outLocatorList is used to select the desired output channel @@ -56,21 +60,22 @@ TEST(BlackBox, PubSubOutLocatorSelection) reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - resource_limits_allocated_samples(2). - resource_limits_max_samples(2).init(); + history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + resource_limits_allocated_samples(2). + resource_limits_max_samples(2).init(); ASSERT_TRUE(reader.isInitialized()); std::shared_ptr descriptor = std::make_shared(); descriptor->m_output_udp_socket = static_cast(LocatorBuffer.port); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS). - resource_limits_allocated_samples(20). - disable_builtin_transport(). - add_user_transport_to_pparams(descriptor). - resource_limits_max_samples(20).init(); + writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_kind( + eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS). + resource_limits_allocated_samples(20). + disable_builtin_transport(). + add_user_transport_to_pparams(descriptor). + resource_limits_max_samples(20).init(); ASSERT_TRUE(writer.isInitialized()); @@ -98,16 +103,16 @@ TEST(BlackBox, PubSubInterfaceWhitelistLocalhost) descriptor->interfaceWhiteList.push_back("127.0.0.1"); reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_depth(10). - disable_multicast(0). - disable_builtin_transport(). - add_user_transport_to_pparams(descriptor).init(); + disable_multicast(0). + disable_builtin_transport(). + add_user_transport_to_pparams(descriptor).init(); ASSERT_TRUE(reader.isInitialized()); writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_depth(10). - disable_multicast(1). - disable_builtin_transport(). - add_user_transport_to_pparams(descriptor).init(); + disable_multicast(1). + disable_builtin_transport(). + add_user_transport_to_pparams(descriptor).init(); ASSERT_TRUE(writer.isInitialized()); @@ -134,20 +139,20 @@ TEST(BlackBox, PubSubInterfaceWhitelistUnicast) GetIP4s(interfaces); std::shared_ptr descriptor = std::make_shared(); - for(const auto& interface : interfaces) + for (const auto& interface : interfaces) { descriptor->interfaceWhiteList.push_back(interface.name); } reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_depth(10). - disable_builtin_transport(). - add_user_transport_to_pparams(descriptor).init(); + disable_builtin_transport(). + add_user_transport_to_pparams(descriptor).init(); ASSERT_TRUE(reader.isInitialized()); writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_depth(10). - disable_builtin_transport(). - add_user_transport_to_pparams(descriptor).init(); + disable_builtin_transport(). + add_user_transport_to_pparams(descriptor).init(); ASSERT_TRUE(writer.isInitialized()); diff --git a/test/blackbox/BlackboxTestsPubSubBasic.cpp b/test/blackbox/common/BlackboxTestsPubSubBasic.cpp similarity index 93% rename from test/blackbox/BlackboxTestsPubSubBasic.cpp rename to test/blackbox/common/BlackboxTestsPubSubBasic.cpp index c0d1d16bc8b..bb9384b8d86 100644 --- a/test/blackbox/BlackboxTestsPubSubBasic.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubBasic.cpp @@ -294,15 +294,15 @@ TEST_P(PubSubBasic, ReceivedDynamicDataWithNoSizeLimit) PubSubWriter writer(TEST_TOPIC_NAME); writer.history_depth(100) - .partition("A").partition("B").partition("C") - .userData({'a', 'b', 'c', 'd'}).init(); + .partition("A").partition("B").partition("C") + .userData({'a', 'b', 'c', 'd'}).init(); ASSERT_TRUE(writer.isInitialized()); reader.history_depth(100) - .partition("A") - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .partition("A") + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -327,17 +327,17 @@ TEST_P(PubSubBasic, ReceivedDynamicDataWithinSizeLimit) PubSubWriter writer(TEST_TOPIC_NAME); writer.history_depth(100) - .partition("A").partition("B").partition("C") - .userData({'a', 'b', 'c', 'd'}).init(); + .partition("A").partition("B").partition("C") + .userData({'a', 'b', 'c', 'd'}).init(); ASSERT_TRUE(writer.isInitialized()); reader.user_data_max_size(4) - .partitions_max_size(28) - .history_depth(100) - .partition("A") - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .partitions_max_size(28) + .history_depth(100) + .partition("A") + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -362,13 +362,13 @@ TEST_P(PubSubBasic, ReceivedUserDataExceedsSizeLimit) PubSubWriter writer(TEST_TOPIC_NAME); writer.history_depth(100) - .userData({'a', 'b', 'c', 'd', 'e', 'f'}).init(); + .userData({'a', 'b', 'c', 'd', 'e', 'f'}).init(); ASSERT_TRUE(writer.isInitialized()); reader.user_data_max_size(4) - .history_depth(100) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .history_depth(100) + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -385,15 +385,15 @@ TEST_P(PubSubBasic, ReceivedPartitionDataExceedsSizeLimit) PubSubWriter writer(TEST_TOPIC_NAME); writer.history_depth(100) - .partition("A").partition("B").partition("C") - .init(); + .partition("A").partition("B").partition("C") + .init(); ASSERT_TRUE(writer.isInitialized()); reader.partitions_max_size(20) - .history_depth(100) - .partition("A") - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .history_depth(100) + .partition("A") + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -580,9 +580,9 @@ TEST_P(PubSubBasic, ReceivedPropertiesDataExceedsSizeLimit) //Expected properties have size 52 reader.properties_max_size(50) - .static_discovery("PubSubReader.xml") - .unicastLocatorList(ReaderUnicastLocators).multicastLocatorList(ReaderMulticastLocators) - .setSubscriberIDs(3, 4).setManualTopicName(std::string("BlackBox_StaticDiscovery_") + TOPIC_RANDOM_NUMBER).init(); + .static_discovery("PubSubReader.xml") + .unicastLocatorList(ReaderUnicastLocators).multicastLocatorList(ReaderMulticastLocators) + .setSubscriberIDs(3, 4).setManualTopicName(std::string("BlackBox_StaticDiscovery_") + TOPIC_RANDOM_NUMBER).init(); ASSERT_TRUE(reader.isInitialized()); @@ -597,7 +597,8 @@ TEST_P(PubSubBasic, ReceivedPropertiesDataExceedsSizeLimit) INSTANTIATE_TEST_CASE_P(PubSubBasic, PubSubBasic, testing::Values(false, true), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) + { if (info.param) { return "Intraprocess"; diff --git a/test/blackbox/BlackboxTestsPubSubFlowControllers.cpp b/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp similarity index 99% rename from test/blackbox/BlackboxTestsPubSubFlowControllers.cpp rename to test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp index 2d1fb4b6556..14809835dd8 100644 --- a/test/blackbox/BlackboxTestsPubSubFlowControllers.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp @@ -168,7 +168,8 @@ TEST_P(PubSubFlowControllers, FlowControllerIfNotAsync) INSTANTIATE_TEST_CASE_P(PubSubFlowControllers, PubSubFlowControllers, testing::Values(false, true), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) + { if (info.param) { return "Intraprocess"; diff --git a/test/blackbox/BlackboxTestsPubSubFragments.cpp b/test/blackbox/common/BlackboxTestsPubSubFragments.cpp similarity index 97% rename from test/blackbox/BlackboxTestsPubSubFragments.cpp rename to test/blackbox/common/BlackboxTestsPubSubFragments.cpp index 9a72000cd70..e1c27a1ac7b 100644 --- a/test/blackbox/BlackboxTestsPubSubFragments.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubFragments.cpp @@ -62,12 +62,12 @@ class PubSubFragments : public testing::TestWithParam PubSubWriter writer(topic_name); reader - .socket_buffer_size(1048576) // accomodate large and fast fragments - .history_depth(static_cast(data.size())) - .reliability(reliable ? + .socket_buffer_size(1048576) // accomodate large and fast fragments + .history_depth(static_cast(data.size())) + .reliability(reliable ? eprosima::fastrtps::RELIABLE_RELIABILITY_QOS : eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) - .init(); + .init(); ASSERT_TRUE(reader.isInitialized()); @@ -87,11 +87,11 @@ class PubSubFragments : public testing::TestWithParam } writer - .history_depth(static_cast(data.size())) - .reliability(reliable ? + .history_depth(static_cast(data.size())) + .reliability(reliable ? eprosima::fastrtps::RELIABLE_RELIABILITY_QOS : eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) - .init(); + .init(); ASSERT_TRUE(writer.isInitialized()); @@ -115,6 +115,7 @@ class PubSubFragments : public testing::TestWithParam reader.block_for_at_least(2); } } + }; TEST_P(PubSubFragments, PubSubAsNonReliableData300kb) @@ -300,7 +301,7 @@ TEST(PubSubFragments, AsyncPubSubAsReliableData300kbInLossyConditionsSmallFragme PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -324,7 +325,7 @@ TEST(PubSubFragments, AsyncPubSubAsReliableData300kbInLossyConditionsSmallFragme writer.add_user_transport_to_pparams(testTransport); writer.history_depth(5). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -450,7 +451,8 @@ TEST(PubSubFragments, AsyncFragmentSizeTest) INSTANTIATE_TEST_CASE_P(PubSubFragments, PubSubFragments, testing::Values(false, true), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) + { if (info.param) { return "Intraprocess"; diff --git a/test/blackbox/BlackboxTestsPubSubHistory.cpp b/test/blackbox/common/BlackboxTestsPubSubHistory.cpp similarity index 98% rename from test/blackbox/BlackboxTestsPubSubHistory.cpp rename to test/blackbox/common/BlackboxTestsPubSubHistory.cpp index 14d97a3e612..339e3c33c10 100644 --- a/test/blackbox/BlackboxTestsPubSubHistory.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubHistory.cpp @@ -160,7 +160,7 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastReaderSmallDepth) while (data.size() > 1) { auto data_backup(data); - decltype(data)expected_data; + decltype(data) expected_data; expected_data.push_back(data_backup.back()); data_backup.pop_back(); expected_data.push_back(data_backup.back()); data_backup.pop_back(); @@ -566,10 +566,11 @@ TEST(BlackBox, PubSubAsReliableKeepLastReaderSmallDepthWithKey) INSTANTIATE_TEST_CASE_P(PubSubHistory, PubSubHistory, testing::Values(false, true), - [](const testing::TestParamInfo& info) { - if (info.param) - { - return "Intraprocess"; - } - return "NonIntraprocess"; -}); + [](const testing::TestParamInfo& info) + { + if (info.param) + { + return "Intraprocess"; + } + return "NonIntraprocess"; + }); diff --git a/test/blackbox/BlackboxTestsRealtimeAllocations.cpp b/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp similarity index 99% rename from test/blackbox/BlackboxTestsRealtimeAllocations.cpp rename to test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp index 2d625ae2cfc..08326f341a7 100644 --- a/test/blackbox/BlackboxTestsRealtimeAllocations.cpp +++ b/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp @@ -46,6 +46,7 @@ class RealtimeAllocations : public testing::TestWithParam xmlparser::XMLProfileManager::library_settings(library_settings); } } + }; TEST_P(RealtimeAllocations, PubSubReliableWithLimitedSubscribers) @@ -493,7 +494,8 @@ TEST_P(RealtimeAllocations, AsyncPubSubBestEffortWithLimitedPublishers) INSTANTIATE_TEST_CASE_P(RealtimeAllocations, RealtimeAllocations, testing::Values(false, true), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) + { if (info.param) { return "Intraprocess"; diff --git a/test/blackbox/BlackboxTestsSecurity.cpp b/test/blackbox/common/BlackboxTestsSecurity.cpp similarity index 97% rename from test/blackbox/BlackboxTestsSecurity.cpp rename to test/blackbox/common/BlackboxTestsSecurity.cpp index ed357680e59..de8b33ffd21 100644 --- a/test/blackbox/BlackboxTestsSecurity.cpp +++ b/test/blackbox/common/BlackboxTestsSecurity.cpp @@ -54,6 +54,7 @@ class Security : public testing::TestWithParam xmlparser::XMLProfileManager::library_settings(library_settings); } } + }; TEST_P(Security, BuiltinAuthenticationPlugin_PKIDH_validation_ok) @@ -341,37 +342,37 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_shm_transport_ok) PropertyPolicy pub_property_policy, sub_property_policy; sub_property_policy.properties().emplace_back(Property("dds.sec.auth.plugin", - "builtin.PKI-DH")); + "builtin.PKI-DH")); sub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.identity_ca", - "file://" + std::string(certs_path) + "/maincacert.pem")); + "file://" + std::string(certs_path) + "/maincacert.pem")); sub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.identity_certificate", - "file://" + std::string(certs_path) + "/mainsubcert.pem")); + "file://" + std::string(certs_path) + "/mainsubcert.pem")); sub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.private_key", - "file://" + std::string(certs_path) + "/mainsubkey.pem")); + "file://" + std::string(certs_path) + "/mainsubkey.pem")); sub_property_policy.properties().emplace_back(Property("dds.sec.crypto.plugin", - "builtin.AES-GCM-GMAC")); + "builtin.AES-GCM-GMAC")); sub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); reader.history_depth(10). - property_policy(sub_property_policy).init(); + property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.plugin", - "builtin.PKI-DH")); + "builtin.PKI-DH")); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.identity_ca", - "file://" + std::string(certs_path) + "/maincacert.pem")); + "file://" + std::string(certs_path) + "/maincacert.pem")); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.identity_certificate", - "file://" + std::string(certs_path) + "/mainpubcert.pem")); + "file://" + std::string(certs_path) + "/mainpubcert.pem")); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.private_key", - "file://" + std::string(certs_path) + "/mainpubkey.pem")); + "file://" + std::string(certs_path) + "/mainpubkey.pem")); pub_property_policy.properties().emplace_back(Property("dds.sec.crypto.plugin", - "builtin.AES-GCM-GMAC")); + "builtin.AES-GCM-GMAC")); pub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). - property_policy(pub_property_policy).init(); + reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + property_policy(pub_property_policy).init(); ASSERT_TRUE(writer.isInitialized()); @@ -415,37 +416,37 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_shm_udp_transport_ok) PropertyPolicy pub_property_policy, sub_property_policy; sub_property_policy.properties().emplace_back(Property("dds.sec.auth.plugin", - "builtin.PKI-DH")); + "builtin.PKI-DH")); sub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.identity_ca", - "file://" + std::string(certs_path) + "/maincacert.pem")); + "file://" + std::string(certs_path) + "/maincacert.pem")); sub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.identity_certificate", - "file://" + std::string(certs_path) + "/mainsubcert.pem")); + "file://" + std::string(certs_path) + "/mainsubcert.pem")); sub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.private_key", - "file://" + std::string(certs_path) + "/mainsubkey.pem")); + "file://" + std::string(certs_path) + "/mainsubkey.pem")); sub_property_policy.properties().emplace_back(Property("dds.sec.crypto.plugin", - "builtin.AES-GCM-GMAC")); + "builtin.AES-GCM-GMAC")); sub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); reader.history_depth(10). - property_policy(sub_property_policy).init(); + property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.plugin", - "builtin.PKI-DH")); + "builtin.PKI-DH")); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.identity_ca", - "file://" + std::string(certs_path) + "/maincacert.pem")); + "file://" + std::string(certs_path) + "/maincacert.pem")); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.identity_certificate", - "file://" + std::string(certs_path) + "/mainpubcert.pem")); + "file://" + std::string(certs_path) + "/mainpubcert.pem")); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.private_key", - "file://" + std::string(certs_path) + "/mainpubkey.pem")); + "file://" + std::string(certs_path) + "/mainpubkey.pem")); pub_property_policy.properties().emplace_back(Property("dds.sec.crypto.plugin", - "builtin.AES-GCM-GMAC")); + "builtin.AES-GCM-GMAC")); pub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). - property_policy(pub_property_policy).init(); + reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + property_policy(pub_property_policy).init(); ASSERT_TRUE(writer.isInitialized()); @@ -2274,19 +2275,19 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_user_data) sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); reader.setOnDiscoveryFunction([&writer](const ParticipantDiscoveryInfo& info) -> bool - { - if (info.info.m_guid == writer.participant_guid()) - { - std::cout << "Received USER_DATA from the writer: "; - for (auto i : info.info.m_userData) { - std::cout << i << ' '; - } - return info.info.m_userData == std::vector({ 'a', 'b', 'c', 'd', 'e' }); - } - - return false; - }); + if (info.info.m_guid == writer.participant_guid()) + { + std::cout << "Received USER_DATA from the writer: "; + for (auto i : info.info.m_userData) + { + std::cout << i << ' '; + } + return info.info.m_userData == std::vector({ 'a', 'b', 'c', 'd', 'e' }); + } + + return false; + }); reader.history_depth(100). reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). @@ -2381,7 +2382,9 @@ static void BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation reader.block_for_all(); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2390,7 +2393,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2399,7 +2404,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2408,8 +2415,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2418,7 +2426,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2427,7 +2437,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2436,7 +2448,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2445,8 +2459,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2455,7 +2470,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_enable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2464,7 +2481,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_disable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2473,7 +2492,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_disable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2482,8 +2503,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2492,7 +2514,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_enable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2501,7 +2525,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_disable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2510,7 +2536,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_disable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2520,7 +2548,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2529,7 +2559,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2538,7 +2570,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2547,7 +2581,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2556,8 +2592,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2566,7 +2603,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2575,7 +2614,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2584,7 +2625,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2594,7 +2637,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2603,7 +2648,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2612,7 +2659,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessNone_validation_ok_disable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2621,7 +2670,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessNone_validation_ok_disable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2630,8 +2681,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessNone_validation_ok_enable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2640,7 +2692,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2649,7 +2703,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessNone_validation_ok_disable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2658,7 +2714,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessNone_validation_ok_disable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2667,8 +2725,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessNone_validation_ok_enable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2677,7 +2736,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisabl BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2686,7 +2747,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2695,7 +2758,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2704,8 +2769,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2714,7 +2780,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2723,7 +2791,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2732,7 +2802,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2741,8 +2813,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2751,7 +2824,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2760,7 +2835,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_disable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2769,7 +2846,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_disable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2778,8 +2857,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2788,7 +2868,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2797,7 +2879,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_disable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2806,7 +2890,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_disable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2815,8 +2901,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2825,7 +2912,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2834,7 +2923,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2843,7 +2934,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2852,8 +2945,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2862,7 +2956,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2871,7 +2967,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2880,7 +2978,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2889,8 +2989,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2899,7 +3000,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2908,7 +3011,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_disable_discovery_enable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2917,7 +3022,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_disable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2926,8 +3033,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_disable_access_encrypt) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2936,7 +3044,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2945,7 +3055,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_disable_discovery_enable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2954,7 +3066,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_disable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2963,8 +3077,9 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnable BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_common(reader, writer, governance_file); } - +// *INDENT-OFF* TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_disable_access_none) +// *INDENT-ON* { PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); @@ -2987,7 +3102,8 @@ void blackbox_security_init() INSTANTIATE_TEST_CASE_P(Security, Security, testing::Values(false, true), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) + { if (info.param) { return "Intraprocess"; @@ -2996,4 +3112,4 @@ INSTANTIATE_TEST_CASE_P(Security, }); -#endif +#endif // if HAVE_SECURITY diff --git a/test/blackbox/BlackboxTestsTransportSHM.cpp b/test/blackbox/common/BlackboxTestsTransportSHM.cpp similarity index 85% rename from test/blackbox/BlackboxTestsTransportSHM.cpp rename to test/blackbox/common/BlackboxTestsTransportSHM.cpp index 133914b7fd7..8932f55fcbe 100644 --- a/test/blackbox/BlackboxTestsTransportSHM.cpp +++ b/test/blackbox/common/BlackboxTestsTransportSHM.cpp @@ -13,7 +13,7 @@ // limitations under the License. #ifndef FASTDDS_SHM_TRANSPORT_DISABLED - + #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -86,21 +86,21 @@ TEST(SHM, Test300KFragmentation) uint32_t big_buffers_send_count = 0; uint32_t big_buffers_recv_count = 0; shm_transport->big_buffer_size_ = shm_transport->segment_size() / 3; - shm_transport->big_buffer_size_send_count_= &big_buffers_send_count; + shm_transport->big_buffer_size_send_count_ = &big_buffers_send_count; shm_transport->big_buffer_size_recv_count_ = &big_buffers_recv_count; - + writer - .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) - .disable_builtin_transport() - .add_user_transport_to_pparams(shm_transport) - .init(); + .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) + .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .disable_builtin_transport() + .add_user_transport_to_pparams(shm_transport) + .init(); reader - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) - .disable_builtin_transport() - .add_user_transport_to_pparams(shm_transport) - .init(); + .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .disable_builtin_transport() + .add_user_transport_to_pparams(shm_transport) + .init(); ASSERT_TRUE(reader.isInitialized()); ASSERT_TRUE(writer.isInitialized()); @@ -129,7 +129,7 @@ TEST(SHM, Test300KNoFragmentation) auto data = default_data300kb_data_generator(1); auto data_size = data.front().data().size(); - + auto shm_transport = std::make_shared(); const uint32_t segment_size = 1024 * 1024; shm_transport->segment_size(segment_size); @@ -140,19 +140,19 @@ TEST(SHM, Test300KNoFragmentation) shm_transport->big_buffer_size_ = static_cast(data_size); shm_transport->big_buffer_size_send_count_ = &big_buffers_send_count; shm_transport->big_buffer_size_recv_count_ = &big_buffers_recv_count; - + writer - .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) - .disable_builtin_transport() - .add_user_transport_to_pparams(shm_transport) - .init(); + .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) + .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .disable_builtin_transport() + .add_user_transport_to_pparams(shm_transport) + .init(); reader - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) - .disable_builtin_transport() - .add_user_transport_to_pparams(shm_transport) - .init(); + .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .disable_builtin_transport() + .add_user_transport_to_pparams(shm_transport) + .init(); ASSERT_TRUE(reader.isInitialized()); ASSERT_TRUE(writer.isInitialized()); @@ -204,17 +204,17 @@ TEST(SHM, SHM_UDP_300KFragmentation) writer.asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE); writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); writer - .disable_builtin_transport() - .add_user_transport_to_pparams(shm_transport) - .add_user_transport_to_pparams(udp_transport) - .init(); + .disable_builtin_transport() + .add_user_transport_to_pparams(shm_transport) + .add_user_transport_to_pparams(udp_transport) + .init(); reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); reader - .disable_builtin_transport() - .add_user_transport_to_pparams(shm_transport) - .add_user_transport_to_pparams(udp_transport) - .init(); + .disable_builtin_transport() + .add_user_transport_to_pparams(shm_transport) + .add_user_transport_to_pparams(udp_transport) + .init(); ASSERT_TRUE(reader.isInitialized()); ASSERT_TRUE(writer.isInitialized()); @@ -256,7 +256,7 @@ TEST(SHM, UDPvsSHM_UDP) const uint32_t segment_size = 1024 * 1024; shm_transport->segment_size(segment_size); shm_transport->max_message_size(segment_size); - + auto udp_transport = std::make_shared(); uint32_t big_buffers_send_count = 0; @@ -268,16 +268,16 @@ TEST(SHM, UDPvsSHM_UDP) writer.asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE); writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); writer - .disable_builtin_transport() - .add_user_transport_to_pparams(udp_transport) - .init(); + .disable_builtin_transport() + .add_user_transport_to_pparams(udp_transport) + .init(); reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); reader - .disable_builtin_transport() - .add_user_transport_to_pparams(shm_transport) - .add_user_transport_to_pparams(udp_transport) - .init(); + .disable_builtin_transport() + .add_user_transport_to_pparams(shm_transport) + .add_user_transport_to_pparams(udp_transport) + .init(); ASSERT_TRUE(reader.isInitialized()); ASSERT_TRUE(writer.isInitialized()); @@ -318,22 +318,22 @@ TEST(SHM, SHM_UDPvsUDP) const uint32_t segment_size = 1024 * 1024; shm_transport->segment_size(segment_size); shm_transport->max_message_size(segment_size); - + auto udp_transport = std::make_shared(); writer.asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE); writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); writer - .disable_builtin_transport() - .add_user_transport_to_pparams(shm_transport) - .add_user_transport_to_pparams(udp_transport) - .init(); + .disable_builtin_transport() + .add_user_transport_to_pparams(shm_transport) + .add_user_transport_to_pparams(udp_transport) + .init(); reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); reader - .disable_builtin_transport() - .add_user_transport_to_pparams(udp_transport) - .init(); + .disable_builtin_transport() + .add_user_transport_to_pparams(udp_transport) + .init(); ASSERT_TRUE(reader.isInitialized()); ASSERT_TRUE(writer.isInitialized()); diff --git a/test/blackbox/BlackboxTestsTransportTCP.cpp b/test/blackbox/common/BlackboxTestsTransportTCP.cpp similarity index 99% rename from test/blackbox/BlackboxTestsTransportTCP.cpp rename to test/blackbox/common/BlackboxTestsTransportTCP.cpp index d7709b02366..be3ad41ec69 100644 --- a/test/blackbox/BlackboxTestsTransportTCP.cpp +++ b/test/blackbox/common/BlackboxTestsTransportTCP.cpp @@ -24,7 +24,7 @@ using namespace eprosima::fastrtps::rtps; #if TLS_FOUND static const char* certs_path = nullptr; -#endif +#endif // if TLS_FOUND // TCP and Domain management with logical ports tests TEST(BlackBox, TCPDomainHelloWorld_P0_P1_D0_D0) @@ -393,7 +393,8 @@ void tls_init() exit(-1); } } -#endif + +#endif // if TLS_FOUND // Regression test for ShrinkLocators/transform_remote_locators mechanism. TEST(BlackBox, TCPLocalhost) diff --git a/test/blackbox/BlackboxTestsTransportUDP.cpp b/test/blackbox/common/BlackboxTestsTransportUDP.cpp similarity index 97% rename from test/blackbox/BlackboxTestsTransportUDP.cpp rename to test/blackbox/common/BlackboxTestsTransportUDP.cpp index 2454d915507..ecb04a1ac2a 100644 --- a/test/blackbox/BlackboxTestsTransportUDP.cpp +++ b/test/blackbox/common/BlackboxTestsTransportUDP.cpp @@ -33,7 +33,7 @@ TEST(BlackBox, UDPv4TransportWrongConfig) testTransport->maxMessageSize = 100000; writer.disable_builtin_transport(). - add_user_transport_to_pparams(testTransport).init(); + add_user_transport_to_pparams(testTransport).init(); ASSERT_FALSE(writer.isInitialized()); } @@ -45,7 +45,7 @@ TEST(BlackBox, UDPv4TransportWrongConfig) testTransport->sendBufferSize = 64000; writer.disable_builtin_transport(). - add_user_transport_to_pparams(testTransport).init(); + add_user_transport_to_pparams(testTransport).init(); ASSERT_FALSE(writer.isInitialized()); } @@ -57,7 +57,7 @@ TEST(BlackBox, UDPv4TransportWrongConfig) testTransport->receiveBufferSize = 64000; writer.disable_builtin_transport(). - add_user_transport_to_pparams(testTransport).init(); + add_user_transport_to_pparams(testTransport).init(); ASSERT_FALSE(writer.isInitialized()); } diff --git a/test/blackbox/BlackboxTestsVolatile.cpp b/test/blackbox/common/BlackboxTestsVolatile.cpp similarity index 88% rename from test/blackbox/BlackboxTestsVolatile.cpp rename to test/blackbox/common/BlackboxTestsVolatile.cpp index e9d8c180c79..57b564bd09b 100644 --- a/test/blackbox/BlackboxTestsVolatile.cpp +++ b/test/blackbox/common/BlackboxTestsVolatile.cpp @@ -282,13 +282,13 @@ TEST_P(Volatile, VolatileSubBetweenPubs) PubSubWriter writer(TEST_TOPIC_NAME); writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). - resource_limits_allocated_samples(9). - resource_limits_max_samples(9). - asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE). - heartbeat_period_seconds(3600). - init(); + reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + resource_limits_allocated_samples(9). + resource_limits_max_samples(9). + asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE). + heartbeat_period_seconds(3600). + init(); ASSERT_TRUE(writer.isInitialized()); @@ -299,9 +299,9 @@ TEST_P(Volatile, VolatileSubBetweenPubs) writer.send_sample(hello); reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). - init(); + reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + init(); ASSERT_TRUE(reader.isInitialized()); @@ -324,14 +324,14 @@ TEST_P(Volatile, AsyncVolatileSubBetweenTransientPubs) PubSubWriter writer(TEST_TOPIC_NAME); writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) - .resource_limits_allocated_samples(9) - .resource_limits_max_samples(9) - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) - .heartbeat_period_seconds(3600) - .init(); + .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .resource_limits_allocated_samples(9) + .resource_limits_max_samples(9) + .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) + .heartbeat_period_seconds(3600) + .init(); ASSERT_TRUE(writer.isInitialized()); @@ -342,9 +342,9 @@ TEST_P(Volatile, AsyncVolatileSubBetweenTransientPubs) writer.send_sample(hello); reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). - init(); + reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + init(); ASSERT_TRUE(reader.isInitialized()); @@ -367,14 +367,14 @@ TEST_P(Volatile, VolatileSubBetweenTransientPubs) PubSubWriter writer(TEST_TOPIC_NAME); writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) - .resource_limits_allocated_samples(9) - .resource_limits_max_samples(9) - .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) - .heartbeat_period_seconds(3600) - .init(); + .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .resource_limits_allocated_samples(9) + .resource_limits_max_samples(9) + .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) + .heartbeat_period_seconds(3600) + .init(); ASSERT_TRUE(writer.isInitialized()); @@ -385,9 +385,9 @@ TEST_P(Volatile, VolatileSubBetweenTransientPubs) writer.send_sample(hello); reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). - init(); + reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + init(); ASSERT_TRUE(reader.isInitialized()); @@ -480,10 +480,11 @@ TEST_P(Volatile, VolatileLateJoinerSubGapLost) INSTANTIATE_TEST_CASE_P(Volatile, Volatile, testing::Values(false, true), - [](const testing::TestParamInfo& info) { - if (info.param) - { - return "Intraprocess"; - } - return "NonIntraprocess"; -}); + [](const testing::TestParamInfo& info) + { + if (info.param) + { + return "Intraprocess"; + } + return "NonIntraprocess"; + }); diff --git a/test/blackbox/RTPSAsSocketReader.hpp b/test/blackbox/common/RTPSAsSocketReader.hpp similarity index 96% rename from test/blackbox/RTPSAsSocketReader.hpp rename to test/blackbox/common/RTPSAsSocketReader.hpp index 7de1fc2d1db..6b3d8594e1b 100644 --- a/test/blackbox/RTPSAsSocketReader.hpp +++ b/test/blackbox/common/RTPSAsSocketReader.hpp @@ -49,7 +49,7 @@ #define GET_PID _getpid #else #define GET_PID getpid -#endif +#endif // if defined(_WIN32) using eprosima::fastrtps::rtps::IPLocator; @@ -65,7 +65,7 @@ class RTPSAsSocketReader class Listener : public eprosima::fastrtps::rtps::ReaderListener { -public: + public: Listener( RTPSAsSocketReader& reader) @@ -87,13 +87,14 @@ class RTPSAsSocketReader reader_.receive_one(reader, change); } -private: + private: Listener& operator =( const Listener&) = delete; RTPSAsSocketReader& reader_; - } listener_; + } + listener_; public: @@ -232,17 +233,19 @@ class RTPSAsSocketReader void block_for_all() { - block([this]() -> bool { - return number_samples_expected_ == current_received_count_; - }); + block([this]() -> bool + { + return number_samples_expected_ == current_received_count_; + }); } size_t block_for_at_least( size_t at_least) { - block([this, at_least]() -> bool { - return current_received_count_ >= at_least; - }); + block([this, at_least]() -> bool + { + return current_received_count_ >= at_least; + }); return current_received_count_; } diff --git a/test/blackbox/RTPSAsSocketWriter.hpp b/test/blackbox/common/RTPSAsSocketWriter.hpp similarity index 96% rename from test/blackbox/RTPSAsSocketWriter.hpp rename to test/blackbox/common/RTPSAsSocketWriter.hpp index 23997ca230a..6583b6ee1fe 100644 --- a/test/blackbox/RTPSAsSocketWriter.hpp +++ b/test/blackbox/common/RTPSAsSocketWriter.hpp @@ -133,10 +133,11 @@ class RTPSAsSocketWriter : public eprosima::fastrtps::rtps::WriterListener while (it != msgs.end()) { eprosima::fastrtps::rtps::CacheChange_t* ch = writer_->new_change([&]() -> uint32_t - { - size_t current_alignment = 4 + magicword_.size() + 1; - return (uint32_t)(current_alignment + type::getCdrSerializedSize(*it, current_alignment)); - } + { + size_t current_alignment = 4 + magicword_.size() + 1; + return (uint32_t)(current_alignment + type::getCdrSerializedSize(*it, + current_alignment)); + } , eprosima::fastrtps::rtps::ALIVE); eprosima::fastcdr::FastBuffer buffer((char*)ch->serializedPayload.data, ch->serializedPayload.max_size); diff --git a/test/blackbox/RTPSBlackboxTests.cpp b/test/blackbox/common/RTPSBlackboxTests.cpp similarity index 100% rename from test/blackbox/RTPSBlackboxTests.cpp rename to test/blackbox/common/RTPSBlackboxTests.cpp diff --git a/test/blackbox/RTPSBlackboxTestsBasic.cpp b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp similarity index 99% rename from test/blackbox/RTPSBlackboxTestsBasic.cpp rename to test/blackbox/common/RTPSBlackboxTestsBasic.cpp index a7c202eda75..bd75abc459a 100644 --- a/test/blackbox/RTPSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp @@ -50,6 +50,7 @@ class RTPS : public testing::TestWithParam xmlparser::XMLProfileManager::library_settings(library_settings); } } + }; TEST_P(RTPS, RTPSAsNonReliableSocket) @@ -362,7 +363,8 @@ TEST_P(RTPS, RTPSAsReliableVolatileSocket) INSTANTIATE_TEST_CASE_P(RTPS, RTPS, testing::Values(false, true), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) + { if (info.param) { return "Intraprocess"; diff --git a/test/blackbox/RTPSBlackboxTestsPersistence.cpp b/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp similarity index 99% rename from test/blackbox/RTPSBlackboxTestsPersistence.cpp rename to test/blackbox/common/RTPSBlackboxTestsPersistence.cpp index a0fc9810bae..7996a98a77e 100644 --- a/test/blackbox/RTPSBlackboxTestsPersistence.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp @@ -299,11 +299,12 @@ TEST_P(Persistence, AsyncRTPSAsReliableWithPersistence) INSTANTIATE_TEST_CASE_P(Persistence, Persistence, testing::Values(false, true), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) + { if (info.param) { return "Intraprocess"; } return "NonIntraprocess"; }); -#endif +#endif // if HAVE_SQLITE3 diff --git a/test/blackbox/RTPSBlackboxTestsVolatile.cpp b/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp similarity index 94% rename from test/blackbox/RTPSBlackboxTestsVolatile.cpp rename to test/blackbox/common/RTPSBlackboxTestsVolatile.cpp index 09d5b3a55f4..23908b6b15f 100644 --- a/test/blackbox/RTPSBlackboxTestsVolatile.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp @@ -88,10 +88,11 @@ TEST_P(Volatile, AsyncPubSubAsNonReliableVolatileKeepAllHelloworld) INSTANTIATE_TEST_CASE_P(Volatile, Volatile, testing::Values(false, true), - [](const testing::TestParamInfo& info) { - if (info.param) - { - return "Intraprocess"; - } - return "NonIntraprocess"; -}); + [](const testing::TestParamInfo& info) + { + if (info.param) + { + return "Intraprocess"; + } + return "NonIntraprocess"; + }); diff --git a/test/blackbox/RTPSWithRegistrationReader.hpp b/test/blackbox/common/RTPSWithRegistrationReader.hpp similarity index 94% rename from test/blackbox/RTPSWithRegistrationReader.hpp rename to test/blackbox/common/RTPSWithRegistrationReader.hpp index 46ae481aa3d..05ae0201b3c 100644 --- a/test/blackbox/RTPSWithRegistrationReader.hpp +++ b/test/blackbox/common/RTPSWithRegistrationReader.hpp @@ -57,7 +57,7 @@ class RTPSWithRegistrationReader class Listener : public eprosima::fastrtps::rtps::ReaderListener { -public: + public: Listener( RTPSWithRegistrationReader& reader) @@ -89,13 +89,14 @@ class RTPSWithRegistrationReader } } -private: + private: Listener& operator =( const Listener&) = delete; RTPSWithRegistrationReader& reader_; - } listener_; + } + listener_; public: @@ -240,26 +241,29 @@ class RTPSWithRegistrationReader void block_for_all() { - block([this]() -> bool { - return number_samples_expected_ == current_received_count_; - }); + block([this]() -> bool + { + return number_samples_expected_ == current_received_count_; + }); } size_t block_for_at_least( size_t at_least) { - block([this, at_least]() -> bool { - return current_received_count_ >= at_least; - }); + block([this, at_least]() -> bool + { + return current_received_count_ >= at_least; + }); return current_received_count_; } void block_until_seq_number_greater_or_equal( const eprosima::fastrtps::rtps::SequenceNumber_t& min_seq) { - block([this, min_seq]() -> bool { - return last_seq_ >= min_seq; - }); + block([this, min_seq]() -> bool + { + return last_seq_ >= min_seq; + }); } eprosima::fastrtps::rtps::SequenceNumber_t get_last_received_sequence_number() const @@ -273,9 +277,10 @@ class RTPSWithRegistrationReader if (matched_ == 0) { - cvDiscovery_.wait(lock, [this]() -> bool { - return matched_ != 0; - }); + cvDiscovery_.wait(lock, [this]() -> bool + { + return matched_ != 0; + }); } } @@ -361,14 +366,14 @@ class RTPSWithRegistrationReader reader_attr_.endpoint.persistence_guid.entityId = 0x55555555; std::cout << "Initializing persistent READER " << reader_attr_.endpoint.persistence_guid << " with file " << - filename << std::endl; + filename << std::endl; return durability(eprosima::fastrtps::rtps::DurabilityKind_t::TRANSIENT) .add_property("dds.persistence.plugin", "builtin.SQLITE3") .add_property("dds.persistence.sqlite3.filename", filename); } -#endif +#endif // if HAVE_SQLITE3 private: diff --git a/test/blackbox/RTPSWithRegistrationWriter.hpp b/test/blackbox/common/RTPSWithRegistrationWriter.hpp similarity index 97% rename from test/blackbox/RTPSWithRegistrationWriter.hpp rename to test/blackbox/common/RTPSWithRegistrationWriter.hpp index f792cbf6e95..229363e1904 100644 --- a/test/blackbox/RTPSWithRegistrationWriter.hpp +++ b/test/blackbox/common/RTPSWithRegistrationWriter.hpp @@ -51,7 +51,7 @@ class RTPSWithRegistrationWriter class Listener : public eprosima::fastrtps::rtps::WriterListener { -public: + public: Listener( RTPSWithRegistrationWriter& writer) @@ -73,14 +73,15 @@ class RTPSWithRegistrationWriter } } -private: + private: Listener& operator =( const Listener&) = delete; RTPSWithRegistrationWriter& writer_; - } listener_; + } + listener_; public: @@ -198,9 +199,10 @@ class RTPSWithRegistrationWriter if (matched_ == 0) { - cv_.wait(lock, [this]() -> bool { - return matched_ != 0; - }); + cv_.wait(lock, [this]() -> bool + { + return matched_ != 0; + }); } ASSERT_NE(matched_, 0u); @@ -296,7 +298,7 @@ class RTPSWithRegistrationWriter .add_property("dds.persistence.sqlite3.filename", filename); } -#endif +#endif // if HAVE_SQLITE3 RTPSWithRegistrationWriter& history_depth( const int32_t depth) diff --git a/test/blackbox/TCPReqRepHelloWorldReplier.cpp b/test/blackbox/common/TCPReqRepHelloWorldReplier.cpp similarity index 96% rename from test/blackbox/TCPReqRepHelloWorldReplier.cpp rename to test/blackbox/common/TCPReqRepHelloWorldReplier.cpp index db823254cbe..eb6408c8f8f 100644 --- a/test/blackbox/TCPReqRepHelloWorldReplier.cpp +++ b/test/blackbox/common/TCPReqRepHelloWorldReplier.cpp @@ -151,15 +151,17 @@ void TCPReqRepHelloWorldReplier::wait_discovery( if (timeout == std::chrono::seconds::zero()) { - cvDiscovery_.wait(lock, [&](){ - return matched_ > 1; - }); + cvDiscovery_.wait(lock, [&]() + { + return matched_ > 1; + }); } else { - cvDiscovery_.wait_for(lock, timeout, [&](){ - return matched_ > 1; - }); + cvDiscovery_.wait_for(lock, timeout, [&]() + { + return matched_ > 1; + }); } std::cout << "Replier discovery phase finished" << std::endl; diff --git a/test/blackbox/common/TCPReqRepHelloWorldReplier.hpp b/test/blackbox/common/TCPReqRepHelloWorldReplier.hpp new file mode 100644 index 00000000000..d40b18b0cf8 --- /dev/null +++ b/test/blackbox/common/TCPReqRepHelloWorldReplier.hpp @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TCPReqRepHelloWorldReplier.hpp + * + */ + +#ifndef _TEST_BLACKBOX_TCPReqRepHelloWorldReplier_HPP_ +#define _TEST_BLACKBOX_TCPReqRepHelloWorldReplier_HPP_ + +#include "../types/HelloWorldType.h" + +#include +#include +#include +#include +#include + +#include +#include +#include + +#if defined(_WIN32) +#define GET_PID _getpid +#include +#else +#define GET_PID getpid +#endif // if defined(_WIN32) + + + +class TCPReqRepHelloWorldReplier +{ +public: + + class ReplyListener : public eprosima::fastrtps::SubscriberListener + { + public: + + ReplyListener( + TCPReqRepHelloWorldReplier& replier) + : replier_(replier) + { + } + + ~ReplyListener() + { + } + + void onNewDataMessage( + eprosima::fastrtps::Subscriber* sub); + void onSubscriptionMatched( + eprosima::fastrtps::Subscriber* /*sub*/, + eprosima::fastrtps::rtps::MatchingInfo& info) + { + if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) + { + replier_.matched(); + } + } + + private: + + ReplyListener& operator =( + const ReplyListener&) = delete; + + TCPReqRepHelloWorldReplier& replier_; + } + request_listener_; + + class RequestListener : public eprosima::fastrtps::PublisherListener + { + public: + + RequestListener( + TCPReqRepHelloWorldReplier& replier) + : replier_(replier) + { + } + + ~RequestListener() + { + } + + void onPublicationMatched( + eprosima::fastrtps::Publisher* /*pub*/, + eprosima::fastrtps::rtps::MatchingInfo& info) + { + if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) + { + replier_.matched(); + } + } + + private: + + RequestListener& operator =( + const RequestListener&) = delete; + + TCPReqRepHelloWorldReplier& replier_; + + } + reply_listener_; + + TCPReqRepHelloWorldReplier(); + virtual ~TCPReqRepHelloWorldReplier(); + void init( + int participantId, + int domainId, + uint16_t listeningPort, + uint32_t maxInitialPeer = 0, + const char* certs_path = nullptr); + bool isInitialized() const + { + return initialized_; + } + + void newNumber( + eprosima::fastrtps::rtps::SampleIdentity sample_identity, + uint16_t number); + void wait_discovery( + std::chrono::seconds timeout = std::chrono::seconds::zero()); + void matched(); + bool is_matched(); + + virtual void configSubscriber( + const std::string& suffix) + { + sattr.qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + + std::ostringstream t; + + t << "TCPReqRepHelloworld_" << asio::ip::host_name() << "_" << GET_PID() << "_" << suffix; + + sattr.topic.topicName = t.str(); + } + + virtual void configPublisher( + const std::string& suffix) + { + puattr.qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + + // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some + // big CPU overhead sometimes + puattr.qos.m_reliability.max_blocking_time.seconds = 1; + puattr.qos.m_reliability.max_blocking_time.nanosec = 0; + + std::ostringstream t; + + t << "TCPReqRepHelloworld_" << asio::ip::host_name() << "_" << GET_PID() << "_" << suffix; + + puattr.topic.topicName = t.str(); + } + +protected: + + eprosima::fastrtps::SubscriberAttributes sattr; + eprosima::fastrtps::PublisherAttributes puattr; + +private: + + TCPReqRepHelloWorldReplier& operator =( + const TCPReqRepHelloWorldReplier&) = delete; + + eprosima::fastrtps::Participant* participant_; + eprosima::fastrtps::Subscriber* request_subscriber_; + eprosima::fastrtps::Publisher* reply_publisher_; + bool initialized_; + std::mutex mutexDiscovery_; + std::condition_variable cvDiscovery_; + std::atomic matched_; + HelloWorldType type_; +}; + +#endif // _TEST_BLACKBOX_TCPReqRepHelloWorldReplier_HPP_ diff --git a/test/blackbox/TCPReqRepHelloWorldRequester.cpp b/test/blackbox/common/TCPReqRepHelloWorldRequester.cpp similarity index 95% rename from test/blackbox/TCPReqRepHelloWorldRequester.cpp rename to test/blackbox/common/TCPReqRepHelloWorldRequester.cpp index a756a77d216..5b05c935838 100644 --- a/test/blackbox/TCPReqRepHelloWorldRequester.cpp +++ b/test/blackbox/common/TCPReqRepHelloWorldRequester.cpp @@ -160,9 +160,10 @@ void TCPReqRepHelloWorldRequester::newNumber( void TCPReqRepHelloWorldRequester::block() { std::unique_lock lock(mutex_); - cv_.wait(lock, [this]() -> bool { - return current_number_ == number_received_; - }); + cv_.wait(lock, [this]() -> bool + { + return current_number_ == number_received_; + }); ASSERT_EQ(related_sample_identity_, received_sample_identity_); } @@ -176,15 +177,17 @@ void TCPReqRepHelloWorldRequester::wait_discovery( if (timeout == std::chrono::seconds::zero()) { - cvDiscovery_.wait(lock, [&](){ - return matched_ > 1; - }); + cvDiscovery_.wait(lock, [&]() + { + return matched_ > 1; + }); } else { - cvDiscovery_.wait_for(lock, timeout, [&](){ - return matched_ > 1; - }); + cvDiscovery_.wait_for(lock, timeout, [&]() + { + return matched_ > 1; + }); } std::cout << "Requester discovery phase finished" << std::endl; diff --git a/test/blackbox/TCPReqRepHelloWorldRequester.hpp b/test/blackbox/common/TCPReqRepHelloWorldRequester.hpp similarity index 96% rename from test/blackbox/TCPReqRepHelloWorldRequester.hpp rename to test/blackbox/common/TCPReqRepHelloWorldRequester.hpp index f3849b677ca..2012a122dfa 100644 --- a/test/blackbox/TCPReqRepHelloWorldRequester.hpp +++ b/test/blackbox/common/TCPReqRepHelloWorldRequester.hpp @@ -20,7 +20,7 @@ #ifndef _TEST_BLACKBOX_TCPReqRepHelloWorldRequester_HPP_ #define _TEST_BLACKBOX_TCPReqRepHelloWorldRequester_HPP_ -#include "types/HelloWorldType.h" +#include "../types/HelloWorldType.h" #include #include @@ -38,7 +38,7 @@ #define GET_PID _getpid #else #define GET_PID getpid -#endif +#endif // if defined(_WIN32) @@ -48,7 +48,7 @@ class TCPReqRepHelloWorldRequester class ReplyListener : public eprosima::fastrtps::SubscriberListener { -public: + public: ReplyListener( TCPReqRepHelloWorldRequester& requester) @@ -72,17 +72,18 @@ class TCPReqRepHelloWorldRequester } } -private: + private: ReplyListener& operator =( const ReplyListener&) = delete; TCPReqRepHelloWorldRequester& requester_; - } reply_listener_; + } + reply_listener_; class RequestListener : public eprosima::fastrtps::PublisherListener { -public: + public: RequestListener( TCPReqRepHelloWorldRequester& requester) @@ -104,14 +105,15 @@ class TCPReqRepHelloWorldRequester } } -private: + private: RequestListener& operator =( const RequestListener&) = delete; TCPReqRepHelloWorldRequester& requester_; - } request_listener_; + } + request_listener_; TCPReqRepHelloWorldRequester(); virtual ~TCPReqRepHelloWorldRequester(); diff --git a/test/blackbox/utils/data_generators.cpp b/test/blackbox/utils/data_generators.cpp index 6e6397db3c9..d7c17b8a5fd 100644 --- a/test/blackbox/utils/data_generators.cpp +++ b/test/blackbox/utils/data_generators.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "../BlackboxTests.hpp" +#include "../common/BlackboxTests.hpp" #include #include @@ -28,15 +28,15 @@ std::list default_helloworld_data_generator( std::list returnedValue(maximum); std::generate(returnedValue.begin(), returnedValue.end(), [&index] - { - HelloWorld hello; - hello.index(index); - std::stringstream ss; - ss << "HelloWorld " << index; - hello.message(ss.str()); - ++index; - return hello; - }); + { + HelloWorld hello; + hello.index(index); + std::stringstream ss; + ss << "HelloWorld " << index; + hello.message(ss.str()); + ++index; + return hello; + }); return returnedValue; } @@ -49,12 +49,12 @@ std::list default_fixed_sized_data_generator( std::list returnedValue(maximum); std::generate(returnedValue.begin(), returnedValue.end(), [&index] - { - FixedSized fs; - fs.index(index); - ++index; - return fs; - }); + { + FixedSized fs; + fs.index(index); + ++index; + return fs; + }); return returnedValue; } @@ -67,16 +67,16 @@ std::list default_keyedhelloworld_data_generator( std::list returnedValue(maximum); std::generate(returnedValue.begin(), returnedValue.end(), [&index] - { - KeyedHelloWorld hello; - hello.index(index); - hello.key(index % 2 + 1); - std::stringstream ss; - ss << "HelloWorld " << index; - hello.message(ss.str()); - ++index; - return hello; - }); + { + KeyedHelloWorld hello; + hello.index(index); + hello.key(index % 2 + 1); + std::stringstream ss; + ss << "HelloWorld " << index; + hello.message(ss.str()); + ++index; + return hello; + }); return returnedValue; } @@ -89,14 +89,14 @@ std::list default_large_string_data_generator( std::list returnedValue(maximum); std::generate(returnedValue.begin(), returnedValue.end(), [&index] - { - String str; - std::stringstream ss; - ss << std::string(998, 'a') << std::setw(2) << std::setfill('0') << index; - str.message(ss.str()); - ++index; - return str; - }); + { + String str; + std::stringstream ss; + ss << std::string(998, 'a') << std::setw(2) << std::setfill('0') << index; + str.message(ss.str()); + ++index; + return str; + }); return returnedValue; } @@ -110,17 +110,17 @@ std::list default_data64kb_data_generator( std::list returnedValue(maximum); std::generate(returnedValue.begin(), returnedValue.end(), [&index] - { - Data64kb data; - data.data().resize(data64kb_length); - data.data()[0] = index; - for (size_t i = 1; i < data64kb_length; ++i) - { - data.data()[i] = static_cast(i + data.data()[0]); - } - ++index; - return data; - }); + { + Data64kb data; + data.data().resize(data64kb_length); + data.data()[0] = index; + for (size_t i = 1; i < data64kb_length; ++i) + { + data.data()[i] = static_cast(i + data.data()[0]); + } + ++index; + return data; + }); return returnedValue; } @@ -134,17 +134,17 @@ std::list default_data300kb_data_generator( std::list returnedValue(maximum); std::generate(returnedValue.begin(), returnedValue.end(), [&index] - { - Data1mb data; - data.data().resize(data300kb_length); - data.data()[0] = index; - for (size_t i = 1; i < data300kb_length; ++i) - { - data.data()[i] = static_cast(i + data.data()[0]); - } - ++index; - return data; - }); + { + Data1mb data; + data.data().resize(data300kb_length); + data.data()[0] = index; + for (size_t i = 1; i < data300kb_length; ++i) + { + data.data()[i] = static_cast(i + data.data()[0]); + } + ++index; + return data; + }); return returnedValue; } @@ -157,18 +157,18 @@ std::list default_data300kb_mix_data_generator( std::list returnedValue(maximum); std::generate(returnedValue.begin(), returnedValue.end(), [&index] - { - Data1mb data; - size_t length = index % 2 != 0 ? data300kb_length : 30000; - data.data().resize(length); - data.data()[0] = index; - for (size_t i = 1; i < length; ++i) - { - data.data()[i] = static_cast(i + data.data()[0]); - } - ++index; - return data; - }); + { + Data1mb data; + size_t length = index % 2 != 0 ? data300kb_length : 30000; + data.data().resize(length); + data.data()[0] = index; + for (size_t i = 1; i < length; ++i) + { + data.data()[i] = static_cast(i + data.data()[0]); + } + ++index; + return data; + }); return returnedValue; } @@ -182,18 +182,18 @@ std::list default_data96kb_data300kb_data_generator( std::list returnedValue(maximum); std::generate(returnedValue.begin(), returnedValue.end(), [&index] - { - Data1mb data; - size_t length = index % 2 != 0 ? data96kb_length : data300kb_length; - data.data().resize(length); - data.data()[0] = index; - for (size_t i = 1; i < length; ++i) - { - data.data()[i] = static_cast(i + data.data()[0]); - } - ++index; - return data; - }); + { + Data1mb data; + size_t length = index % 2 != 0 ? data96kb_length : data300kb_length; + data.data().resize(length); + data.data()[0] = index; + for (size_t i = 1; i < length; ++i) + { + data.data()[i] = static_cast(i + data.data()[0]); + } + ++index; + return data; + }); return returnedValue; } diff --git a/test/blackbox/utils/lambda_functions.cpp b/test/blackbox/utils/lambda_functions.cpp index 85b94f7eb4d..a7a7ac04ee5 100644 --- a/test/blackbox/utils/lambda_functions.cpp +++ b/test/blackbox/utils/lambda_functions.cpp @@ -12,38 +12,38 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "../BlackboxTests.hpp" +#include "../common/BlackboxTests.hpp" #include #include const std::function default_helloworld_print = [](const HelloWorld& hello) -{ - std::cout << hello.index() << " "; -}; + { + std::cout << hello.index() << " "; + }; const std::function default_fixed_sized_print = [](const FixedSized& hello) -{ - std::cout << hello.index() << " "; -}; + { + std::cout << hello.index() << " "; + }; const std::function default_keyedhelloworld_print = [](const KeyedHelloWorld& hello) -{ - std::cout << hello.message() << " " << hello.key(); -}; + { + std::cout << hello.message() << " " << hello.key(); + }; const std::function default_string_print = [](const String& str) -{ - std::cout << str.message()[str.message().size() - 2] - << str.message()[str.message().size() - 1] << " "; -}; + { + std::cout << str.message()[str.message().size() - 2] + << str.message()[str.message().size() - 1] << " "; + }; const std::function default_data64kb_print = [](const Data64kb& data) -{ - std::cout << (uint16_t)data.data()[0] << " "; -}; + { + std::cout << (uint16_t)data.data()[0] << " "; + }; const std::function default_data300kb_print = [](const Data1mb& data) -{ - std::cout << (uint16_t)data.data()[0] << " "; -}; + { + std::cout << (uint16_t)data.data()[0] << " "; + }; diff --git a/test/blackbox/utils/print_functions.cpp b/test/blackbox/utils/print_functions.cpp index 2f37e4a1141..db41ba64f5a 100644 --- a/test/blackbox/utils/print_functions.cpp +++ b/test/blackbox/utils/print_functions.cpp @@ -12,86 +12,99 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "../BlackboxTests.hpp" +#include "../common/BlackboxTests.hpp" #include template<> -void default_receive_print(const HelloWorld& hello) +void default_receive_print( + const HelloWorld& hello) { std::cout << "Received HelloWorld " << hello.index() << std::endl; } template<> -void default_receive_print(const KeyedHelloWorld& hello) +void default_receive_print( + const KeyedHelloWorld& hello) { std::cout << "Received HelloWorld " << hello.index() << " with key " << hello.key() << std::endl; } template<> -void default_receive_print(const FixedSized& hello) +void default_receive_print( + const FixedSized& hello) { std::cout << "Received FixedSized " << hello.index() << std::endl; } template<> -void default_receive_print(const String& str) +void default_receive_print( + const String& str) { std::cout << "Received String " << str.message()[str.message().size() - 2] - << str.message()[str.message().size() - 1] << std::endl; + << str.message()[str.message().size() - 1] << std::endl; } template<> -void default_receive_print(const Data64kb& data) +void default_receive_print( + const Data64kb& data) { std::cout << "Received Data64kb " << (uint16_t)data.data()[0] << std::endl; } template<> -void default_receive_print(const Data1mb& data) +void default_receive_print( + const Data1mb& data) { - std::cout << "Received Data1mb " << (uint16_t)data.data()[0] << std::endl;; + std::cout << "Received Data1mb " << (uint16_t)data.data()[0] << std::endl; } template<> -void default_send_print(const StringType&) +void default_send_print( + const StringType&) { std::cout << "Sent StringType" << std::endl; } template<> -void default_send_print(const HelloWorld& hello) +void default_send_print( + const HelloWorld& hello) { std::cout << "Sent HelloWorld " << hello.index() << std::endl; } template<> -void default_send_print(const KeyedHelloWorld& hello) +void default_send_print( + const KeyedHelloWorld& hello) { std::cout << "Sent HelloWorld " << hello.index() << " with key " << hello.key() << std::endl; } template<> -void default_send_print(const FixedSized& hello) +void default_send_print( + const FixedSized& hello) { std::cout << "Sent FixedSized " << hello.index() << std::endl; } template<> -void default_send_print(const String& str) +void default_send_print( + const String& str) { std::cout << "Sent String " << str.message()[str.message().size() - 2] - << str.message()[str.message().size() - 1] << std::endl; + << str.message()[str.message().size() - 1] << std::endl; } template<> -void default_send_print(const Data64kb& data) +void default_send_print( + const Data64kb& data) { std::cout << "Sent Data64kb " << (uint16_t)data.data()[0] << std::endl; } template<> -void default_send_print(const Data1mb& data) +void default_send_print( + const Data1mb& data) { - std::cout << "Sent Data1mb " << (uint16_t)data.data()[0] << std::endl;; + std::cout << "Sent Data1mb " << (uint16_t)data.data()[0] << std::endl; } diff --git a/test/unittest/transport/CMakeLists.txt b/test/unittest/transport/CMakeLists.txt index eae4c1d68b2..86da061f4a8 100644 --- a/test/unittest/transport/CMakeLists.txt +++ b/test/unittest/transport/CMakeLists.txt @@ -204,6 +204,7 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) target_link_libraries(UDPv4Tests ${PRIVACY} iphlpapi Shlwapi ) endif() add_gtest(UDPv4Tests SOURCES ${UDPV4TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST XFAIL_UDP4) option(DISABLE_UDPV6_TESTS "Disable UDPv6 tests because fails in some systems" OFF) @@ -222,6 +223,7 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) target_link_libraries(UDPv6Tests ${PRIVACY} iphlpapi Shlwapi ) endif() add_gtest(UDPv6Tests SOURCES ${UDPV6TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_UDP6) add_executable(TCPv6Tests ${TCPV6TESTS_SOURCE}) target_compile_definitions(TCPv6Tests PRIVATE FASTRTPS_NO_LIB) @@ -242,6 +244,7 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) target_link_libraries(TCPv6Tests ${PRIVACY} fastcdr) endif() add_gtest(TCPv6Tests SOURCES ${TCPV6TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TCP6) endif() add_executable(test_UDPv4Tests ${TEST_UDPV4TESTS_SOURCE}) @@ -262,6 +265,7 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) target_link_libraries(test_UDPv4Tests ${PRIVACY}) endif() add_gtest(test_UDPv4Tests SOURCES ${TEST_UDPV4TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TEST_UDP4) add_executable(TCPv4Tests ${TCPV4TESTS_SOURCE}) target_compile_definitions(TCPv4Tests PRIVATE FASTRTPS_NO_LIB) @@ -282,7 +286,7 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) target_link_libraries(TCPv4Tests ${PRIVACY} fastcdr) endif() add_gtest(TCPv4Tests SOURCES ${TCPV4TESTS_SOURCE}) - + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TCP4) if(IS_THIRDPARTY_BOOST_OK) add_executable(SharedMemTests ${SHAREDMEMTESTS_SOURCE}) @@ -307,6 +311,11 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) target_link_libraries(SharedMemTests ${PRIVACY} ) endif() add_gtest(SharedMemTests SOURCES ${SHAREDMEMTESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_SHM) endif() + + foreach(TRANSPORT_XFAIL_TEST ${TRANSPORT_XFAIL_LIST}) + add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${TRANSPORT_XFAIL_TEST}.list) + endforeach() endif() endif() diff --git a/test/unittest/transport/XFAIL_SHM.list b/test/unittest/transport/XFAIL_SHM.list new file mode 100644 index 00000000000..0ebe06a1c64 --- /dev/null +++ b/test/unittest/transport/XFAIL_SHM.list @@ -0,0 +1 @@ +SHMTransportTests.buffer_recover