From 173b9f0a19b645f02b6493cb60f4d597addd96e3 Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Lizano Date: Wed, 6 Oct 2021 07:29:50 +0200 Subject: [PATCH 01/11] Revert "Revert "Reconnection tests [12522]"" Signed-off-by: RaulSanchez --- CMakeLists.txt | 14 +- src/DSLog.h.in | 8 +- src/main.cpp | 23 +- test/CMakeLists.txt | 9 +- .../test_39_trivial_reconnect_A.xml | 40 ++ .../test_39_trivial_reconnect_B.xml | 52 ++ .../test_40_trivial_server_reconnect_A.xml | 52 ++ .../test_40_trivial_server_reconnect_B.xml | 40 ++ .../test_41_reconnect_with_clients_A.xml | 89 +++ .../test_41_reconnect_with_clients_B.xml | 100 ++++ ...est_42_server_reconnect_with_clients_A.xml | 101 ++++ ...est_42_server_reconnect_with_clients_B.xml | 88 +++ .../test_43_complex_reconnect_A1.xml | 88 +++ .../test_43_complex_reconnect_A2.xml | 87 +++ .../test_43_complex_reconnect_B1.xml | 98 ++++ .../test_43_complex_reconnect_B2.xml | 100 ++++ ...l => test_50_environment_modification.xml} | 0 .../test_39_trivial_reconnect_A.snapshot | 19 + .../test_39_trivial_reconnect_B.snapshot | 13 + ...est_40_trivial_server_reconnect_A.snapshot | 19 + ...est_40_trivial_server_reconnect_B.snapshot | 13 + .../test_41_reconnect_with_clients_A.snapshot | 59 ++ .../test_41_reconnect_with_clients_B.snapshot | 38 ++ ...2_server_reconnect_with_clients_A.snapshot | 59 ++ ...2_server_reconnect_with_clients_B.snapshot | 38 ++ .../test_43_complex_reconnect_A1.snapshot | 59 ++ .../test_43_complex_reconnect_A2.snapshot | 38 ++ .../test_43_complex_reconnect_B1.snapshot | 24 + .../test_43_complex_reconnect_B2.snapshot | 59 ++ ...test_50_environment_modification.snapshot} | 0 test/configuration/tests_params.json | 546 +++++++++++++++++- 31 files changed, 1940 insertions(+), 33 deletions(-) create mode 100644 test/configuration/test_cases/test_39_trivial_reconnect_A.xml create mode 100644 test/configuration/test_cases/test_39_trivial_reconnect_B.xml create mode 100644 test/configuration/test_cases/test_40_trivial_server_reconnect_A.xml create mode 100644 test/configuration/test_cases/test_40_trivial_server_reconnect_B.xml create mode 100644 test/configuration/test_cases/test_41_reconnect_with_clients_A.xml create mode 100644 test/configuration/test_cases/test_41_reconnect_with_clients_B.xml create mode 100644 test/configuration/test_cases/test_42_server_reconnect_with_clients_A.xml create mode 100644 test/configuration/test_cases/test_42_server_reconnect_with_clients_B.xml create mode 100644 test/configuration/test_cases/test_43_complex_reconnect_A1.xml create mode 100644 test/configuration/test_cases/test_43_complex_reconnect_A2.xml create mode 100644 test/configuration/test_cases/test_43_complex_reconnect_B1.xml create mode 100644 test/configuration/test_cases/test_43_complex_reconnect_B2.xml rename test/configuration/test_cases/{test_39_environment_modification.xml => test_50_environment_modification.xml} (100%) create mode 100644 test/configuration/test_solutions/test_39_trivial_reconnect_A.snapshot create mode 100644 test/configuration/test_solutions/test_39_trivial_reconnect_B.snapshot create mode 100644 test/configuration/test_solutions/test_40_trivial_server_reconnect_A.snapshot create mode 100644 test/configuration/test_solutions/test_40_trivial_server_reconnect_B.snapshot create mode 100644 test/configuration/test_solutions/test_41_reconnect_with_clients_A.snapshot create mode 100644 test/configuration/test_solutions/test_41_reconnect_with_clients_B.snapshot create mode 100644 test/configuration/test_solutions/test_42_server_reconnect_with_clients_A.snapshot create mode 100644 test/configuration/test_solutions/test_42_server_reconnect_with_clients_B.snapshot create mode 100644 test/configuration/test_solutions/test_43_complex_reconnect_A1.snapshot create mode 100644 test/configuration/test_solutions/test_43_complex_reconnect_A2.snapshot create mode 100644 test/configuration/test_solutions/test_43_complex_reconnect_B1.snapshot create mode 100644 test/configuration/test_solutions/test_43_complex_reconnect_B2.snapshot rename test/configuration/test_solutions/{test_39_environment_modification.snapshot => test_50_environment_modification.snapshot} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34946582..af6e1142 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,17 +176,9 @@ endif() # Logging ############################################################################### -if(NOT DEFINED LOG_LEVEL_INFO) - set(LOG_LEVEL_INFO OFF) -endif() - -if(NOT DEFINED LOG_LEVEL_WARN) - set(LOG_LEVEL_WARN OFF) -endif() - -if(NOT DEFINED LOG_LEVEL_ERROR) - SET(LOG_LEVEL_ERROR ON) -endif() +option(LOG_LEVEL_INFO OFF) +option(LOG_LEVEL_WARN OFF) +option(LOG_LEVEL_ERROR OFF) add_definitions(-DLOG_LEVEL_INFO=$,ON>) add_definitions(-DLOG_LEVEL_WARN=$,ON>) diff --git a/src/DSLog.h.in b/src/DSLog.h.in index d63b0e24..fb4836d1 100644 --- a/src/DSLog.h.in +++ b/src/DSLog.h.in @@ -15,17 +15,17 @@ #ifndef _EPROSIMA_IS_LOG_H_ #define _EPROSIMA_IS_LOG_H_ -#if defined LOG_LEVEL_INFO && LOG_LEVEL_INFO +#if defined LOG_LEVEL_INFO && LOG_LEVEL_INFO #define __INTERNALDEBUG - #define __DEBUG + #define __DEBUG #undef LOG_NO_INFO #undef LOG_NO_WARN #undef LOG_NO_ERROR -#elif defined LOG_LEVEL_WARN && LOG_LEVEL_WARN +#elif defined LOG_LEVEL_WARN && LOG_LEVEL_WARN #define LOG_NO_INFO #undef LOG_NO_WARN #undef LOG_NO_ERROR -#elif defined LOG_LEVEL_ERROR && LOG_LEVEL_ERROR +#elif defined LOG_LEVEL_ERROR && LOG_LEVEL_ERROR #define LOG_NO_INFO #define LOG_NO_WARN #undef LOG_NO_ERROR diff --git a/src/main.cpp b/src/main.cpp index acc1a9e3..bdea8c46 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,7 +15,7 @@ #include "log/DSLog.h" #include "version/config.h" -#if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 1 +#if FASTRTPS_VERSION_MAJOR >= 2 || (FASTRTPS_VERSION_MAJOR == 2 && FASTRTPS_VERSION_MINOR >= 1) #include #endif // if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 1 #include @@ -40,18 +40,15 @@ int main( Log::ClearConsumers(); // Initialize loging -#if LOG_LEVEL_INFO - Log::SetVerbosity(Log::Kind::Info); -#elif LOG_LEVEL_WARN - Log::SetVerbosity(Log::Kind::Warning); -#elif LOG_LEVEL_ERROR - Log::SetVerbosity(Log::Kind::Error); -#else - Log::SetVerbosity(Log::Kind::Error); -#endif // if defined LOG_LEVEL_INFO - - - // Log::SetCategoryFilter(std::regex("(DISCOVERY_SERVER)")); + #if LOG_LEVEL_INFO + Log::SetVerbosity(Log::Kind::Info); + #elif LOG_LEVEL_WARN + Log::SetVerbosity(Log::Kind::Warning); + #elif LOG_LEVEL_ERROR + Log::SetVerbosity(Log::Kind::Error); + #else + Log::SetVerbosity(Log::Kind::Error); + #endif #if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 1 // Create a StdoutErrConsumer consumer that logs entries to stderr only when the Log::Kind is equal to WARNING diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 69a0c020..5a0d18dc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -85,6 +85,13 @@ list(APPEND TEST_LIST test_34_connect_locally_with_remote_server test_38_self_connection + + test_39_trivial_reconnect + test_40_trivial_server_reconnect + test_41_reconnect_with_clients + test_42_server_reconnect_with_clients + test_43_complex_reconnect + test_60_disconnection ) @@ -103,7 +110,7 @@ if(fastrtps_VERSION VERSION_GREATER_EQUAL "2.3.0") ) endif() -# Adding remote servers while running was introduced in Fast DDS v2.4.0 +# Adding DNS and Environment modification while running was introduced in Fast DDS v2.4.0 if(fastrtps_VERSION VERSION_GREATER_EQUAL "2.4.0") list(APPEND TEST_LIST test_36_dns_environment_variable_setup diff --git a/test/configuration/test_cases/test_39_trivial_reconnect_A.xml b/test/configuration/test_cases/test_39_trivial_reconnect_A.xml new file mode 100644 index 00000000..3bf1809d --- /dev/null +++ b/test/configuration/test_cases/test_39_trivial_reconnect_A.xml @@ -0,0 +1,40 @@ + + + + + + + + + Knows server B + Do not know server B + Knows server B + + + + + + 44.49.53.43.53.45.52.56.45.52.5F.31 + + + SERVER + + 0 + + DURATION_INFINITY + DURATION_INFINITY + + + + +
127.0.0.1
+ 39811 +
+
+
+
+
+
+ +
+
diff --git a/test/configuration/test_cases/test_39_trivial_reconnect_B.xml b/test/configuration/test_cases/test_39_trivial_reconnect_B.xml new file mode 100644 index 00000000..5fb5a5eb --- /dev/null +++ b/test/configuration/test_cases/test_39_trivial_reconnect_B.xml @@ -0,0 +1,52 @@ + + + + + + + + + Knows A + Do not know A + + + + + + + 44.49.53.43.53.45.52.56.45.52.5F.32 + + + SERVER + + + + + +
127.0.0.1
+ 39811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+ + + +
127.0.0.1
+ 39812 +
+
+
+
+
+
+ +
+
diff --git a/test/configuration/test_cases/test_40_trivial_server_reconnect_A.xml b/test/configuration/test_cases/test_40_trivial_server_reconnect_A.xml new file mode 100644 index 00000000..bfa18b65 --- /dev/null +++ b/test/configuration/test_cases/test_40_trivial_server_reconnect_A.xml @@ -0,0 +1,52 @@ + + + + + + + + + Knows server B + Do not know server B + Knows server B + + + + + + 44.49.53.43.53.45.52.56.45.52.5F.31 + + + SERVER + + + + + +
127.0.0.1
+ 40812 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+ + + +
127.0.0.1
+ 40811 +
+
+
+
+
+
+ +
+
diff --git a/test/configuration/test_cases/test_40_trivial_server_reconnect_B.xml b/test/configuration/test_cases/test_40_trivial_server_reconnect_B.xml new file mode 100644 index 00000000..0e11be67 --- /dev/null +++ b/test/configuration/test_cases/test_40_trivial_server_reconnect_B.xml @@ -0,0 +1,40 @@ + + + + + + + + + Knows A + Do not know A + + + + + + + 44.49.53.43.53.45.52.56.45.52.5F.32 + + + SERVER + + 0 + + DURATION_INFINITY + DURATION_INFINITY + + + + +
127.0.0.1
+ 40812 +
+
+
+
+
+
+ +
+
diff --git a/test/configuration/test_cases/test_41_reconnect_with_clients_A.xml b/test/configuration/test_cases/test_41_reconnect_with_clients_A.xml new file mode 100644 index 00000000..fa1882b5 --- /dev/null +++ b/test/configuration/test_cases/test_41_reconnect_with_clients_A.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + Knows server B, client A and client B + Do not know server B + Knows server B, client A and client B + + + + + + + 63.6c.69.65.6e.74.31.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 41811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + + 44.49.53.43.53.45.52.56.45.52.5F.31 + + + SERVER + + 0 + + DURATION_INFINITY + DURATION_INFINITY + + + + +
127.0.0.1
+ 41811 +
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_41_reconnect_with_clients_B.xml b/test/configuration/test_cases/test_41_reconnect_with_clients_B.xml new file mode 100644 index 00000000..45c5cf39 --- /dev/null +++ b/test/configuration/test_cases/test_41_reconnect_with_clients_B.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + Knows server A, client A and client B + Do not know server A + + + + + + + 63.6c.69.65.6e.74.32.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 41812 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + + 44.49.53.43.53.45.52.56.45.52.5F.32 + + + SERVER + + + + + +
127.0.0.1
+ 41811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+ + + +
127.0.0.1
+ 41812 +
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_42_server_reconnect_with_clients_A.xml b/test/configuration/test_cases/test_42_server_reconnect_with_clients_A.xml new file mode 100644 index 00000000..3d74074e --- /dev/null +++ b/test/configuration/test_cases/test_42_server_reconnect_with_clients_A.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + Knows server B, client A and client B + Do not know server B + Knows server B, client A and client B + + + + + + + 63.6c.69.65.6e.74.31.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 42811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + + 44.49.53.43.53.45.52.56.45.52.5F.31 + + + SERVER + + + + + +
127.0.0.1
+ 42812 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+ + + +
127.0.0.1
+ 42811 +
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_42_server_reconnect_with_clients_B.xml b/test/configuration/test_cases/test_42_server_reconnect_with_clients_B.xml new file mode 100644 index 00000000..e2bf1417 --- /dev/null +++ b/test/configuration/test_cases/test_42_server_reconnect_with_clients_B.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + Knows server A, client A and client B + Do not know server A + + + + + + + 63.6c.69.65.6e.74.32.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 42812 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + + 44.49.53.43.53.45.52.56.45.52.5F.32 + + + SERVER + + 0 + + DURATION_INFINITY + DURATION_INFINITY + + + + +
127.0.0.1
+ 42812 +
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_43_complex_reconnect_A1.xml b/test/configuration/test_cases/test_43_complex_reconnect_A1.xml new file mode 100644 index 00000000..3d0cf8d6 --- /dev/null +++ b/test/configuration/test_cases/test_43_complex_reconnect_A1.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + Knows server B, client A and client B + Do not know server B + Knows server B, client A and client B + + + + + + 63.6c.69.65.6e.74.31.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 43811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + + 44.49.53.43.53.45.52.56.45.52.5F.31 + + + SERVER + + 0 + + DURATION_INFINITY + DURATION_INFINITY + + + + +
127.0.0.1
+ 43811 +
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_43_complex_reconnect_A2.xml b/test/configuration/test_cases/test_43_complex_reconnect_A2.xml new file mode 100644 index 00000000..842b0be6 --- /dev/null +++ b/test/configuration/test_cases/test_43_complex_reconnect_A2.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + Knows server B, client A and client B + Not know B + + + + + + 63.6c.69.65.6e.74.31.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 43811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + + 44.49.53.43.53.45.52.56.45.52.5F.31 + + + SERVER + + 0 + + DURATION_INFINITY + DURATION_INFINITY + + + + +
127.0.0.1
+ 43811 +
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_43_complex_reconnect_B1.xml b/test/configuration/test_cases/test_43_complex_reconnect_B1.xml new file mode 100644 index 00000000..49704fce --- /dev/null +++ b/test/configuration/test_cases/test_43_complex_reconnect_B1.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + Knows server A, client A and client B + + + + + + 63.6c.69.65.6e.74.32.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 43812 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + + 44.49.53.43.53.45.52.56.45.52.5F.32 + + + SERVER + + + + + +
127.0.0.1
+ 43811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+ + + +
127.0.0.1
+ 43812 +
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_43_complex_reconnect_B2.xml b/test/configuration/test_cases/test_43_complex_reconnect_B2.xml new file mode 100644 index 00000000..365d0e5b --- /dev/null +++ b/test/configuration/test_cases/test_43_complex_reconnect_B2.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + Knows server A, client A and client B + Not know server A + Knows server A, client A and client B + + + + + + 63.6c.69.65.6e.74.32.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 43812 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + + 44.49.53.43.53.45.52.56.45.52.5F.32 + + + SERVER + + + + + +
127.0.0.1
+ 43811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+ + + +
127.0.0.1
+ 43812 +
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_39_environment_modification.xml b/test/configuration/test_cases/test_50_environment_modification.xml similarity index 100% rename from test/configuration/test_cases/test_39_environment_modification.xml rename to test/configuration/test_cases/test_50_environment_modification.xml diff --git a/test/configuration/test_solutions/test_39_trivial_reconnect_A.snapshot b/test/configuration/test_solutions/test_39_trivial_reconnect_A.snapshot new file mode 100644 index 00000000..f93ef9d6 --- /dev/null +++ b/test/configuration/test_solutions/test_39_trivial_reconnect_A.snapshot @@ -0,0 +1,19 @@ + + + + Knows server B + + + + + + Do not know server B + + + + Knows server B + + + + + diff --git a/test/configuration/test_solutions/test_39_trivial_reconnect_B.snapshot b/test/configuration/test_solutions/test_39_trivial_reconnect_B.snapshot new file mode 100644 index 00000000..a068759c --- /dev/null +++ b/test/configuration/test_solutions/test_39_trivial_reconnect_B.snapshot @@ -0,0 +1,13 @@ + + + + Knows A + + + + + + Do not know A + + + diff --git a/test/configuration/test_solutions/test_40_trivial_server_reconnect_A.snapshot b/test/configuration/test_solutions/test_40_trivial_server_reconnect_A.snapshot new file mode 100644 index 00000000..f93ef9d6 --- /dev/null +++ b/test/configuration/test_solutions/test_40_trivial_server_reconnect_A.snapshot @@ -0,0 +1,19 @@ + + + + Knows server B + + + + + + Do not know server B + + + + Knows server B + + + + + diff --git a/test/configuration/test_solutions/test_40_trivial_server_reconnect_B.snapshot b/test/configuration/test_solutions/test_40_trivial_server_reconnect_B.snapshot new file mode 100644 index 00000000..6f950d41 --- /dev/null +++ b/test/configuration/test_solutions/test_40_trivial_server_reconnect_B.snapshot @@ -0,0 +1,13 @@ + + + + Knows A + + + + + + Do not know A + + + diff --git a/test/configuration/test_solutions/test_41_reconnect_with_clients_A.snapshot b/test/configuration/test_solutions/test_41_reconnect_with_clients_A.snapshot new file mode 100644 index 00000000..a0fdbe5c --- /dev/null +++ b/test/configuration/test_solutions/test_41_reconnect_with_clients_A.snapshot @@ -0,0 +1,59 @@ + + + + Knows server B, client A and client B + + + + + + + + + + + + + + + + + + + + + Do not know server B + + + + + + + + + + + + + + Knows server B, client A and client B + + + + + + + + + + + + + + + + + + + + diff --git a/test/configuration/test_solutions/test_41_reconnect_with_clients_B.snapshot b/test/configuration/test_solutions/test_41_reconnect_with_clients_B.snapshot new file mode 100644 index 00000000..108f0af5 --- /dev/null +++ b/test/configuration/test_solutions/test_41_reconnect_with_clients_B.snapshot @@ -0,0 +1,38 @@ + + + + Knows server A, client A and client B + + + + + + + + + + + + + + + + + + + + + Do not know server A + + + + + + + + + + + + + diff --git a/test/configuration/test_solutions/test_42_server_reconnect_with_clients_A.snapshot b/test/configuration/test_solutions/test_42_server_reconnect_with_clients_A.snapshot new file mode 100644 index 00000000..5a8dc350 --- /dev/null +++ b/test/configuration/test_solutions/test_42_server_reconnect_with_clients_A.snapshot @@ -0,0 +1,59 @@ + + + + Knows server B, client A and client B + + + + + + + + + + + + + + + + + + + + + Do not know server B + + + + + + + + + + + + + + Knows server B, client A and client B + + + + + + + + + + + + + + + + + + + + diff --git a/test/configuration/test_solutions/test_42_server_reconnect_with_clients_B.snapshot b/test/configuration/test_solutions/test_42_server_reconnect_with_clients_B.snapshot new file mode 100644 index 00000000..6e0344ae --- /dev/null +++ b/test/configuration/test_solutions/test_42_server_reconnect_with_clients_B.snapshot @@ -0,0 +1,38 @@ + + + + Knows server A, client A and client B + + + + + + + + + + + + + + + + + + + + + Do not know server A + + + + + + + + + + + + + diff --git a/test/configuration/test_solutions/test_43_complex_reconnect_A1.snapshot b/test/configuration/test_solutions/test_43_complex_reconnect_A1.snapshot new file mode 100644 index 00000000..42dd1fb8 --- /dev/null +++ b/test/configuration/test_solutions/test_43_complex_reconnect_A1.snapshot @@ -0,0 +1,59 @@ + + + + Knows server B, client A and client B + + + + + + + + + + + + + + + + + + + + + Do not know server B + + + + + + + + + + + + + + Knows server B, client A and client B + + + + + + + + + + + + + + + + + + + + diff --git a/test/configuration/test_solutions/test_43_complex_reconnect_A2.snapshot b/test/configuration/test_solutions/test_43_complex_reconnect_A2.snapshot new file mode 100644 index 00000000..c5f4ca15 --- /dev/null +++ b/test/configuration/test_solutions/test_43_complex_reconnect_A2.snapshot @@ -0,0 +1,38 @@ + + + + Knows server B, client A and client B + + + + + + + + + + + + + + + + + + + + + Not know B + + + + + + + + + + + + + diff --git a/test/configuration/test_solutions/test_43_complex_reconnect_B1.snapshot b/test/configuration/test_solutions/test_43_complex_reconnect_B1.snapshot new file mode 100644 index 00000000..2a910970 --- /dev/null +++ b/test/configuration/test_solutions/test_43_complex_reconnect_B1.snapshot @@ -0,0 +1,24 @@ + + + + Knows server A, client A and client B + + + + + + + + + + + + + + + + + + + + diff --git a/test/configuration/test_solutions/test_43_complex_reconnect_B2.snapshot b/test/configuration/test_solutions/test_43_complex_reconnect_B2.snapshot new file mode 100644 index 00000000..a9563770 --- /dev/null +++ b/test/configuration/test_solutions/test_43_complex_reconnect_B2.snapshot @@ -0,0 +1,59 @@ + + + + Knows server A, client A and client B + + + + + + + + + + + + + + + + + + + + + Not know server A + + + + + + + + + + + + + + Knows server A, client A and client B + + + + + + + + + + + + + + + + + + + + diff --git a/test/configuration/test_solutions/test_39_environment_modification.snapshot b/test/configuration/test_solutions/test_50_environment_modification.snapshot similarity index 100% rename from test/configuration/test_solutions/test_39_environment_modification.snapshot rename to test/configuration/test_solutions/test_50_environment_modification.snapshot diff --git a/test/configuration/tests_params.json b/test/configuration/tests_params.json index 3bc38446..f0b68957 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -1519,7 +1519,545 @@ } }, - "test_39_environment_modification": + "test_39_trivial_reconnect": + { + "description": [ + "Server B connects with Server A. Server B leaves. Server B turns back with same configuration" + ], + + "processes": + { + "serverA": + { + "xml_config_file": "/test_cases/test_39_trivial_reconnect_A.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_39_trivial_reconnect_A.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "generate_validation": + { + "disposals": true, + "server_endpoints": false + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_39_trivial_reconnect_A.snapshot" + } + } + }, + + "serverB_1": + { + "xml_config_file": "/test_cases/test_39_trivial_reconnect_B.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + } + }, + + "serverB_2": + { + "creation_time": 7, + "xml_config_file": "/test_cases/test_39_trivial_reconnect_B.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "count_lines_validation": + { + "file_path": "/test_solutions/test_39_trivial_reconnect_B.snapshot" + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_39_trivial_reconnect_B.snapshot" + } + } + } + } + }, + + "test_40_trivial_server_reconnect": + { + "description": [ + "Server A connects with Server B. Server B leaves. Server B turns back with same configuration", + "It requires more time than usual in order to announce Server A DATA(P) and receive it and reply in B" + ], + + "processes": + { + "serverA": + { + "xml_config_file": "/test_cases/test_40_trivial_server_reconnect_A.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_40_trivial_server_reconnect_A.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "generate_validation": + { + "disposals": true, + "server_endpoints": false + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_40_trivial_server_reconnect_A.snapshot" + } + } + }, + + "serverB_1": + { + "xml_config_file": "/test_cases/test_40_trivial_server_reconnect_B.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + + } + }, + + "serverB_2": + { + "creation_time": 8, + "xml_config_file": "/test_cases/test_40_trivial_server_reconnect_B.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "count_lines_validation": + { + "file_path": "/test_solutions/test_40_trivial_server_reconnect_B.snapshot" + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_40_trivial_server_reconnect_B.snapshot" + } + } + } + } + }, + + "test_41_reconnect_with_clients": + { + "description": [ + "Server B connects with Server A. Server B leaves. Server B turns back with same configuration" + ], + + "processes": + { + "serverA": + { + "xml_config_file": "/test_cases/test_41_reconnect_with_clients_A.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_41_reconnect_with_clients_A.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "generate_validation": + { + "disposals": true, + "server_endpoints": false + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_41_reconnect_with_clients_A.snapshot" + } + } + }, + + "serverB_1": + { + "xml_config_file": "/test_cases/test_41_reconnect_with_clients_B.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + } + }, + + "serverB_2": + { + "creation_time": 9, + "xml_config_file": "/test_cases/test_41_reconnect_with_clients_B.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "count_lines_validation": + { + "file_path": "/test_solutions/test_41_reconnect_with_clients_B.snapshot" + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_41_reconnect_with_clients_B.snapshot" + } + } + } + } + }, + + "test_42_server_reconnect_with_clients": + { + "description": [ + "Server A connects with Server B. Server B leaves. Server B turns back with same configuration" + ], + + "processes": + { + "serverA": + { + "xml_config_file": "/test_cases/test_42_server_reconnect_with_clients_A.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_42_server_reconnect_with_clients_A.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "generate_validation": + { + "disposals": true, + "server_endpoints": false + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_42_server_reconnect_with_clients_A.snapshot" + } + } + }, + + "serverB_1": + { + "xml_config_file": "/test_cases/test_42_server_reconnect_with_clients_B.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + } + }, + + "serverB_2": + { + "creation_time": 9, + "xml_config_file": "/test_cases/test_42_server_reconnect_with_clients_B.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "count_lines_validation": + { + "file_path": "/test_solutions/test_42_server_reconnect_with_clients_B.snapshot" + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_42_server_reconnect_with_clients_B.snapshot" + } + } + } + } + }, + + "test_43_complex_reconnect": + { + "description": [ + "Server B connects with server A. Server B leaves. Server B start again. Server A leaves, Server A start again", + "Both Servers should know every information from the other before leaving and after restarting", + "t = 0 : A1 starts & B1 starts", + "t = 2 : A1 snapshot", + "t = 3 : B1 snapshot & B1 finish", + "t = 6 : A1 snapshot", + + "t = 7 : B2 starts", + "t = 11 : B2 snapshot", + "t = 12 : A1 snapshot & A1 finish", + "t = 15 : B2 snapshot", + + "t = 16 : A2 starts", + "t = 20 : A2 snapshot", + "t = 21 : B2 snapshot & B2 finish", + "t = 24 : A2 snapshot & A2 finish" + ], + + "processes": + { + "serverA_1": + { + "xml_config_file": "/test_cases/test_43_complex_reconnect_A1.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_43_complex_reconnect_A1.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "generate_validation": + { + "disposals": true, + "server_endpoints": false + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_43_complex_reconnect_A1.snapshot" + } + } + }, + + "serverA_2": + { + "creation_time": 16, + "xml_config_file": "/test_cases/test_43_complex_reconnect_A2.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_43_complex_reconnect_A2.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "generate_validation": + { + "disposals": true, + "server_endpoints": false + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_43_complex_reconnect_A2.snapshot" + } + } + }, + + "serverB_1": + { + "xml_config_file": "/test_cases/test_43_complex_reconnect_B1.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_43_complex_reconnect_B1.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "generate_validation": + { + "disposals": true, + "server_endpoints": false + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_43_complex_reconnect_B1.snapshot" + } + } + }, + + "serverB_2": + { + "creation_time": 7, + "xml_config_file": "/test_cases/test_43_complex_reconnect_B2.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_43_complex_reconnect_B2.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "generate_validation": + { + "disposals": true, + "server_endpoints": false + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_43_complex_reconnect_B2.snapshot" + } + } + } + } + }, + + "test_44_fast_discovery_server_tool_reconnect": + { + "processes": + { + "main": + { + "xml_config_file": "/test_cases/test_44_fast_discovery_server_tool_reconnect.xml", + "validation": + { + "count_lines_validation": + { + "file_path": "/test_solutions/test_44_fast_discovery_server_tool_reconnect.snapshot" + }, + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_44_fast_discovery_server_tool_reconnect.snapshot" + } + } + }, + "fastddstool_0": + { + "kill_time": 4, + "tool_config": + { + "id" : 0, + "address": "127.0.0.1", + "port": 44811 + }, + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + } + }, + "fastddstool_reconnect": + { + "creation_time": 9, + "kill_time": 19, + "tool_config": + { + "id" : 0, + "address": "127.0.0.1", + "port": 44811 + }, + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + } + } + } + }, + + "test_50_environment_modification": { "description": [ "Test to check the consequences of modifying the file referenced by FASTDDS_ENVIRONMENT_FILE on the ", @@ -1538,12 +2076,12 @@ "value": "/environment.json" } ], - "xml_config_file": "/test_cases/test_39_environment_modification.xml", + "xml_config_file": "/test_cases/test_50_environment_modification.xml", "validation": { "count_lines_validation": { - "file_path": "/test_solutions/test_39_environment_modification.snapshot" + "file_path": "/test_solutions/test_50_environment_modification.snapshot" }, "exit_code_validation": { @@ -1560,7 +2098,7 @@ }, "ground_truth_validation": { - "file_path": "/test_solutions/test_39_environment_modification.snapshot" + "file_path": "/test_solutions/test_50_environment_modification.snapshot" } } } From aece190962f745987de76a1b1a7875a57fab3775 Mon Sep 17 00:00:00 2001 From: jparisu Date: Tue, 26 Oct 2021 10:25:20 +0200 Subject: [PATCH 02/11] Refs #12522: Add test for tool reconnection Signed-off-by: jparisu --- test/CMakeLists.txt | 1 + ...4_fast_discovery_server_tool_reconnect.xml | 139 ++++++++++++++++++ ...t_discovery_server_tool_reconnect.snapshot | 113 ++++++++++++++ 3 files changed, 253 insertions(+) create mode 100644 test/configuration/test_cases/test_44_fast_discovery_server_tool_reconnect.xml create mode 100644 test/configuration/test_solutions/test_44_fast_discovery_server_tool_reconnect.snapshot diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5a0d18dc..58e6e5d6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -91,6 +91,7 @@ list(APPEND TEST_LIST test_41_reconnect_with_clients test_42_server_reconnect_with_clients test_43_complex_reconnect + test_44_fast_discovery_server_tool_reconnect test_60_disconnection ) diff --git a/test/configuration/test_cases/test_44_fast_discovery_server_tool_reconnect.xml b/test/configuration/test_cases/test_44_fast_discovery_server_tool_reconnect.xml new file mode 100644 index 00000000..5a1b679b --- /dev/null +++ b/test/configuration/test_cases/test_44_fast_discovery_server_tool_reconnect.xml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + C1 and C2 know each other and Server + C1 and C2 know only each other + C1 and C4 do not know each other + C1 and C4 know each other and Server + C4 only knows Server + C3 and C4 know each other and Server+ + + + + + + 63.6c.69.65.6e.74.31.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 44811 +
+
+
+
+
+
+
+
+
+ + + + 63.6c.69.65.6e.74.32.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 44811 +
+
+
+
+
+
+
+
+
+ + + + 63.6c.69.65.6e.74.33.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 44811 +
+
+
+
+
+
+
+
+
+ + + + 63.6c.69.65.6e.74.34.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 44811 +
+
+
+
+
+
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+ +
diff --git a/test/configuration/test_solutions/test_44_fast_discovery_server_tool_reconnect.snapshot b/test/configuration/test_solutions/test_44_fast_discovery_server_tool_reconnect.snapshot new file mode 100644 index 00000000..2754d18e --- /dev/null +++ b/test/configuration/test_solutions/test_44_fast_discovery_server_tool_reconnect.snapshot @@ -0,0 +1,113 @@ + + + + C1 and C2 know each other and Server + + + + + + + + + + + + + + + + + + + + + C1 and C2 know only each other + + + + + + + + + + + + + + + + + + + C1 and C4 do not know each other + + + + + + + + + + + + + + + + C1 and C4 know each other and Server + + + + + + + + + + + + + + + + + + + + + + + + C4 only knows Server + + + + + + + + + C3 and C4 know each other and Server + + + + + + + + + + + + + + + + + + + + From 7da8203c7c0521edb3f569d6916944210119344a Mon Sep 17 00:00:00 2001 From: jparisu Date: Thu, 28 Oct 2021 07:58:54 +0200 Subject: [PATCH 03/11] Refs #12522: Add client reconnect test Signed-off-by: jparisu --- test/CMakeLists.txt | 33 ++++----- ...est_45_trivial_client_reconnect_client.xml | 60 ++++++++++++++++ ...est_45_trivial_client_reconnect_server.xml | 38 +++++++++++ ...5_trivial_client_reconnect_client.snapshot | 29 ++++++++ test/configuration/tests_params.json | 68 +++++++++++++++++++ 5 files changed, 212 insertions(+), 16 deletions(-) create mode 100644 test/configuration/test_cases/test_45_trivial_client_reconnect_client.xml create mode 100644 test/configuration/test_cases/test_45_trivial_client_reconnect_server.xml create mode 100644 test/configuration/test_solutions/test_45_trivial_client_reconnect_client.snapshot diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 58e6e5d6..5e27e95b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -92,6 +92,7 @@ list(APPEND TEST_LIST test_42_server_reconnect_with_clients test_43_complex_reconnect test_44_fast_discovery_server_tool_reconnect + test_45_trivial_client_reconnect test_60_disconnection ) @@ -126,22 +127,22 @@ set(TEST_CASE_LIST) foreach(TEST IN LISTS TEST_LIST) - unset(TEST_NAME) - set(TEST_NAME "discovery_server_test.${TEST}.SHM_ON") - list(APPEND TEST_CASE_LIST ${TEST_NAME}) - # Test with shared memory - add_test(NAME ${TEST_NAME} - COMMAND ${PYTHON_EXECUTABLE} ${RUN_TEST} - -e $ - -p ${TESTS_PARAMS} - -f $<$:$> - -t ${TEST} - -s true - -i false) # Remove this argument to execute test with and without intraprocess - # --force-remove # Add this argument to erase every file generated during test execution - set_tests_properties(${TEST_NAME} PROPERTIES - REQUIRED_FILES ${RUN_TEST} - REQUIRED_FILES ${TESTS_PARAMS}) + # unset(TEST_NAME) + # set(TEST_NAME "discovery_server_test.${TEST}.SHM_ON") + # list(APPEND TEST_CASE_LIST ${TEST_NAME}) + # # Test with shared memory + # add_test(NAME ${TEST_NAME} + # COMMAND ${PYTHON_EXECUTABLE} ${RUN_TEST} + # -e $ + # -p ${TESTS_PARAMS} + # -f $<$:$> + # -t ${TEST} + # -s true + # -i false) # Remove this argument to execute test with and without intraprocess + # # --force-remove # Add this argument to erase every file generated during test execution + # set_tests_properties(${TEST_NAME} PROPERTIES + # REQUIRED_FILES ${RUN_TEST} + # REQUIRED_FILES ${TESTS_PARAMS}) unset(TEST_NAME) set(TEST_NAME "discovery_server_test.${TEST}.SHM_OFF") diff --git a/test/configuration/test_cases/test_45_trivial_client_reconnect_client.xml b/test/configuration/test_cases/test_45_trivial_client_reconnect_client.xml new file mode 100644 index 00000000..ce05047a --- /dev/null +++ b/test/configuration/test_cases/test_45_trivial_client_reconnect_client.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + Knows server B + Do not know server B + Knows server B + + + + + + 63.6c.69.65.6e.74.31.5f.73.31.5f.5f + + + CLIENT + + + + + +
127.0.0.1
+ 45811 +
+
+
+
+
+ + 0 + + DURATION_INFINITY + DURATION_INFINITY +
+
+
+
+ + + topic_1 + sample_type_1 + + + + + + + + + + + +
+
diff --git a/test/configuration/test_cases/test_45_trivial_client_reconnect_server.xml b/test/configuration/test_cases/test_45_trivial_client_reconnect_server.xml new file mode 100644 index 00000000..82b71157 --- /dev/null +++ b/test/configuration/test_cases/test_45_trivial_client_reconnect_server.xml @@ -0,0 +1,38 @@ + + + + + + + + + Do know the client + + + + + + 44.49.53.43.53.45.52.56.45.52.5F.31 + + + SERVER + + 0 + + DURATION_INFINITY + DURATION_INFINITY + + + + +
127.0.0.1
+ 45811 +
+
+
+
+
+
+ +
+
diff --git a/test/configuration/test_solutions/test_45_trivial_client_reconnect_client.snapshot b/test/configuration/test_solutions/test_45_trivial_client_reconnect_client.snapshot new file mode 100644 index 00000000..190c9f1d --- /dev/null +++ b/test/configuration/test_solutions/test_45_trivial_client_reconnect_client.snapshot @@ -0,0 +1,29 @@ + + + + Knows server B + + + + + + + + + Do not know server B + + + + + + + + Knows server B + + + + + + + + diff --git a/test/configuration/tests_params.json b/test/configuration/tests_params.json index f0b68957..1e6d1586 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -2057,6 +2057,74 @@ } }, + + "test_45_trivial_client_reconnect": + { + "description": [ + "Client connects with Server. Server leaves. Server turns back with same configuration." + ], + + "processes": + { + "client": + { + "xml_config_file": "/test_cases/test_45_trivial_client_reconnect_client.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "count_lines_validation": + { + "file_path": "/test_solutions/test_45_trivial_client_reconnect_client.snapshot" + }, + "ground_truth_validation": + { + "file_path": "/test_solutions/test_45_trivial_client_reconnect_client.snapshot" + } + } + }, + + "server_0": + { + "xml_config_file": "/test_cases/test_45_trivial_client_reconnect_server.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + } + }, + + "server_1": + { + "creation_time": 6, + "xml_config_file": "/test_cases/test_45_trivial_client_reconnect_server.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + } + } + } + }, + "test_50_environment_modification": { "description": [ From d34eeec3a296d9dfaa6d7555f3db3bab951f4072 Mon Sep 17 00:00:00 2001 From: jparisu Date: Fri, 29 Oct 2021 08:45:45 +0200 Subject: [PATCH 04/11] Refs #12522: Uncomment SHM_ON Signed-off-by: jparisu --- test/CMakeLists.txt | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5e27e95b..01bff0be 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -127,22 +127,22 @@ set(TEST_CASE_LIST) foreach(TEST IN LISTS TEST_LIST) - # unset(TEST_NAME) - # set(TEST_NAME "discovery_server_test.${TEST}.SHM_ON") - # list(APPEND TEST_CASE_LIST ${TEST_NAME}) - # # Test with shared memory - # add_test(NAME ${TEST_NAME} - # COMMAND ${PYTHON_EXECUTABLE} ${RUN_TEST} - # -e $ - # -p ${TESTS_PARAMS} - # -f $<$:$> - # -t ${TEST} - # -s true - # -i false) # Remove this argument to execute test with and without intraprocess - # # --force-remove # Add this argument to erase every file generated during test execution - # set_tests_properties(${TEST_NAME} PROPERTIES - # REQUIRED_FILES ${RUN_TEST} - # REQUIRED_FILES ${TESTS_PARAMS}) + unset(TEST_NAME) + set(TEST_NAME "discovery_server_test.${TEST}.SHM_ON") + list(APPEND TEST_CASE_LIST ${TEST_NAME}) + # Test with shared memory + add_test(NAME ${TEST_NAME} + COMMAND ${PYTHON_EXECUTABLE} ${RUN_TEST} + -e $ + -p ${TESTS_PARAMS} + -f $<$:$> + -t ${TEST} + -s true + -i false) # Remove this argument to execute test with and without intraprocess + # --force-remove # Add this argument to erase every file generated during test execution + set_tests_properties(${TEST_NAME} PROPERTIES + REQUIRED_FILES ${RUN_TEST} + REQUIRED_FILES ${TESTS_PARAMS}) unset(TEST_NAME) set(TEST_NAME "discovery_server_test.${TEST}.SHM_OFF") From 6c0789fdefe1fa8b58678cf59db5c529bbe9616e Mon Sep 17 00:00:00 2001 From: jparisu Date: Wed, 3 Nov 2021 09:53:16 +0100 Subject: [PATCH 05/11] Refs #12522: Set test 41 time longer for jenkins Signed-off-by: jparisu --- .../test_cases/test_41_reconnect_with_clients_A.xml | 4 ++-- .../test_cases/test_41_reconnect_with_clients_B.xml | 2 +- test/configuration/tests_params.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/configuration/test_cases/test_41_reconnect_with_clients_A.xml b/test/configuration/test_cases/test_41_reconnect_with_clients_A.xml index fa1882b5..213b2940 100644 --- a/test/configuration/test_cases/test_41_reconnect_with_clients_A.xml +++ b/test/configuration/test_cases/test_41_reconnect_with_clients_A.xml @@ -13,8 +13,8 @@ Knows server B, client A and client B - Do not know server B - Knows server B, client A and client B + Do not know server B + Knows server B, client A and client B diff --git a/test/configuration/test_cases/test_41_reconnect_with_clients_B.xml b/test/configuration/test_cases/test_41_reconnect_with_clients_B.xml index 45c5cf39..bd8e9829 100644 --- a/test/configuration/test_cases/test_41_reconnect_with_clients_B.xml +++ b/test/configuration/test_cases/test_41_reconnect_with_clients_B.xml @@ -13,7 +13,7 @@ Knows server A, client A and client B - Do not know server A + Do not know server A diff --git a/test/configuration/tests_params.json b/test/configuration/tests_params.json index 1e6d1586..90737356 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -1736,7 +1736,7 @@ "serverB_2": { - "creation_time": 9, + "creation_time": 13, "xml_config_file": "/test_cases/test_41_reconnect_with_clients_B.xml", "validation": { From 97f4f7c7acdacea49b75139fe3b03c0107591ce2 Mon Sep 17 00:00:00 2001 From: jparisu Date: Wed, 3 Nov 2021 09:56:21 +0100 Subject: [PATCH 06/11] Refs #12522: Set test 42 time longer for jenkins Signed-off-by: jparisu --- .../test_cases/test_42_server_reconnect_with_clients_A.xml | 4 ++-- .../test_cases/test_42_server_reconnect_with_clients_B.xml | 2 +- test/configuration/tests_params.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/configuration/test_cases/test_42_server_reconnect_with_clients_A.xml b/test/configuration/test_cases/test_42_server_reconnect_with_clients_A.xml index 3d74074e..025a5cb3 100644 --- a/test/configuration/test_cases/test_42_server_reconnect_with_clients_A.xml +++ b/test/configuration/test_cases/test_42_server_reconnect_with_clients_A.xml @@ -13,8 +13,8 @@ Knows server B, client A and client B - Do not know server B - Knows server B, client A and client B + Do not know server B + Knows server B, client A and client B diff --git a/test/configuration/test_cases/test_42_server_reconnect_with_clients_B.xml b/test/configuration/test_cases/test_42_server_reconnect_with_clients_B.xml index e2bf1417..7a54351d 100644 --- a/test/configuration/test_cases/test_42_server_reconnect_with_clients_B.xml +++ b/test/configuration/test_cases/test_42_server_reconnect_with_clients_B.xml @@ -13,7 +13,7 @@ Knows server A, client A and client B - Do not know server A + Do not know server A diff --git a/test/configuration/tests_params.json b/test/configuration/tests_params.json index 90737356..4a7d1ea3 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -1816,7 +1816,7 @@ "serverB_2": { - "creation_time": 9, + "creation_time": 13, "xml_config_file": "/test_cases/test_42_server_reconnect_with_clients_B.xml", "validation": { From 63aa017fc9bcba1f78885336f5df2868b5312a63 Mon Sep 17 00:00:00 2001 From: jparisu Date: Wed, 3 Nov 2021 10:02:00 +0100 Subject: [PATCH 07/11] Refs #12522: Set test 43 time longer for jenkins Signed-off-by: jparisu --- .../test_43_complex_reconnect_A1.xml | 4 ++-- .../test_43_complex_reconnect_A2.xml | 2 +- .../test_43_complex_reconnect_B2.xml | 4 ++-- test/configuration/tests_params.json | 22 +++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/configuration/test_cases/test_43_complex_reconnect_A1.xml b/test/configuration/test_cases/test_43_complex_reconnect_A1.xml index 3d0cf8d6..1bfd2787 100644 --- a/test/configuration/test_cases/test_43_complex_reconnect_A1.xml +++ b/test/configuration/test_cases/test_43_complex_reconnect_A1.xml @@ -13,8 +13,8 @@ Knows server B, client A and client B - Do not know server B - Knows server B, client A and client B + Do not know server B + Knows server B, client A and client B diff --git a/test/configuration/test_cases/test_43_complex_reconnect_A2.xml b/test/configuration/test_cases/test_43_complex_reconnect_A2.xml index 842b0be6..121dd018 100644 --- a/test/configuration/test_cases/test_43_complex_reconnect_A2.xml +++ b/test/configuration/test_cases/test_43_complex_reconnect_A2.xml @@ -13,7 +13,7 @@ Knows server B, client A and client B - Not know B + Not know B diff --git a/test/configuration/test_cases/test_43_complex_reconnect_B2.xml b/test/configuration/test_cases/test_43_complex_reconnect_B2.xml index 365d0e5b..d3f52822 100644 --- a/test/configuration/test_cases/test_43_complex_reconnect_B2.xml +++ b/test/configuration/test_cases/test_43_complex_reconnect_B2.xml @@ -13,8 +13,8 @@ Knows server A, client A and client B - Not know server A - Knows server A, client A and client B + Not know server A + Knows server A, client A and client B diff --git a/test/configuration/tests_params.json b/test/configuration/tests_params.json index 4a7d1ea3..c01330ed 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -1849,17 +1849,17 @@ "t = 0 : A1 starts & B1 starts", "t = 2 : A1 snapshot", "t = 3 : B1 snapshot & B1 finish", - "t = 6 : A1 snapshot", + "t = 7 : A1 snapshot", - "t = 7 : B2 starts", - "t = 11 : B2 snapshot", - "t = 12 : A1 snapshot & A1 finish", - "t = 15 : B2 snapshot", + "t = 8 : B2 starts", + "t = 12 : B2 snapshot", + "t = 13 : A1 snapshot & A1 finish", + "t = 17 : B2 snapshot", - "t = 16 : A2 starts", - "t = 20 : A2 snapshot", - "t = 21 : B2 snapshot & B2 finish", - "t = 24 : A2 snapshot & A2 finish" + "t = 18 : A2 starts", + "t = 22 : A2 snapshot", + "t = 23 : B2 snapshot & B2 finish", + "t = 27 : A2 snapshot & A2 finish" ], "processes": @@ -1895,7 +1895,7 @@ "serverA_2": { - "creation_time": 16, + "creation_time": 18, "xml_config_file": "/test_cases/test_43_complex_reconnect_A2.xml", "validation": { @@ -1954,7 +1954,7 @@ "serverB_2": { - "creation_time": 7, + "creation_time": 8, "xml_config_file": "/test_cases/test_43_complex_reconnect_B2.xml", "validation": { From c26202f3635c556de18b28fabe96a06db9ef71ce Mon Sep 17 00:00:00 2001 From: jparisu Date: Thu, 4 Nov 2021 16:26:19 +0100 Subject: [PATCH 08/11] Refs #12522: Apply suggestions Signed-off-by: jparisu --- src/main.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bdea8c46..fc8ae08d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,7 +15,7 @@ #include "log/DSLog.h" #include "version/config.h" -#if FASTRTPS_VERSION_MAJOR >= 2 || (FASTRTPS_VERSION_MAJOR == 2 && FASTRTPS_VERSION_MINOR >= 1) +#if FASTRTPS_VERSION_MAJOR > 2 || (FASTRTPS_VERSION_MAJOR == 2 && FASTRTPS_VERSION_MINOR >= 1) #include #endif // if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 1 #include @@ -40,15 +40,15 @@ int main( Log::ClearConsumers(); // Initialize loging - #if LOG_LEVEL_INFO - Log::SetVerbosity(Log::Kind::Info); - #elif LOG_LEVEL_WARN - Log::SetVerbosity(Log::Kind::Warning); - #elif LOG_LEVEL_ERROR - Log::SetVerbosity(Log::Kind::Error); - #else - Log::SetVerbosity(Log::Kind::Error); - #endif +#if LOG_LEVEL_INFO + Log::SetVerbosity(Log::Kind::Info); +#elif LOG_LEVEL_WARN + Log::SetVerbosity(Log::Kind::Warning); +#elif LOG_LEVEL_ERROR + Log::SetVerbosity(Log::Kind::Error); +#else + Log::SetVerbosity(Log::Kind::Error); +#endif // if LOG_LEVEL_INFO #if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 1 // Create a StdoutErrConsumer consumer that logs entries to stderr only when the Log::Kind is equal to WARNING From 41c80a8f2bdda4d90f22500c9936ee23bc66e279 Mon Sep 17 00:00:00 2001 From: jparisu Date: Tue, 16 Nov 2021 09:37:45 +0100 Subject: [PATCH 09/11] Refs #12522: Change 39 name number to 60 Signed-off-by: jparisu --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 01bff0be..cc51838d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -118,7 +118,7 @@ if(fastrtps_VERSION VERSION_GREATER_EQUAL "2.4.0") test_36_dns_environment_variable_setup test_37_dns_fast_discovery_server_tool - test_39_environment_modification + test_50_environment_modification ) endif() From d72162fab6bc0e982b53bf457d3db70f3d021178 Mon Sep 17 00:00:00 2001 From: jparisu Date: Tue, 16 Nov 2021 09:37:56 +0100 Subject: [PATCH 10/11] Refs #12522: Extend 39 test time Signed-off-by: jparisu --- test/configuration/test_cases/test_39_trivial_reconnect_A.xml | 4 ++-- test/configuration/test_cases/test_39_trivial_reconnect_B.xml | 2 +- test/configuration/tests_params.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/configuration/test_cases/test_39_trivial_reconnect_A.xml b/test/configuration/test_cases/test_39_trivial_reconnect_A.xml index 3bf1809d..a4e90e35 100644 --- a/test/configuration/test_cases/test_39_trivial_reconnect_A.xml +++ b/test/configuration/test_cases/test_39_trivial_reconnect_A.xml @@ -7,8 +7,8 @@ Knows server B - Do not know server B - Knows server B + Do not know server B + Knows server B diff --git a/test/configuration/test_cases/test_39_trivial_reconnect_B.xml b/test/configuration/test_cases/test_39_trivial_reconnect_B.xml index 5fb5a5eb..2850b2e2 100644 --- a/test/configuration/test_cases/test_39_trivial_reconnect_B.xml +++ b/test/configuration/test_cases/test_39_trivial_reconnect_B.xml @@ -7,7 +7,7 @@ Knows A - Do not know A + Do not know A diff --git a/test/configuration/tests_params.json b/test/configuration/tests_params.json index c01330ed..9f7ba3b8 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -1574,7 +1574,7 @@ "serverB_2": { - "creation_time": 7, + "creation_time": 8, "xml_config_file": "/test_cases/test_39_trivial_reconnect_B.xml", "validation": { From 20c5f9121aac64c7b30bae06c93db45ae3904d37 Mon Sep 17 00:00:00 2001 From: Javier Santiago Date: Mon, 22 Nov 2021 09:12:40 +0100 Subject: [PATCH 11/11] Refs #12522: Delayed third snapshot and all steps after that one for test 50 Signed-off-by: Javier Santiago --- .../test_cases/test_50_environment_modification.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/configuration/test_cases/test_50_environment_modification.xml b/test/configuration/test_cases/test_50_environment_modification.xml index a7f8733f..7d236e8c 100644 --- a/test/configuration/test_cases/test_50_environment_modification.xml +++ b/test/configuration/test_cases/test_50_environment_modification.xml @@ -18,14 +18,14 @@ --> - + - + @@ -40,8 +40,8 @@ test_39_environment_modification_initial test_39_environment_modification_add_server2 - test_39_environment_modification_add_server1 - test_39_environment_modification_final + test_39_environment_modification_add_server1 + test_39_environment_modification_final