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..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_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 @@ -48,10 +48,7 @@ int main( Log::SetVerbosity(Log::Kind::Error); #else Log::SetVerbosity(Log::Kind::Error); -#endif // if defined LOG_LEVEL_INFO - - - // Log::SetCategoryFilter(std::regex("(DISCOVERY_SERVER)")); +#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 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 69a0c020..cc51838d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -85,6 +85,15 @@ 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_44_fast_discovery_server_tool_reconnect + test_45_trivial_client_reconnect + test_60_disconnection ) @@ -103,13 +112,13 @@ 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 test_37_dns_fast_discovery_server_tool - test_39_environment_modification + test_50_environment_modification ) endif() 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..a4e90e35 --- /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..2850b2e2 --- /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..213b2940 --- /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..bd8e9829 --- /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..025a5cb3 --- /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..7a54351d --- /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..1bfd2787 --- /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..121dd018 --- /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..d3f52822 --- /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_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_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_cases/test_39_environment_modification.xml b/test/configuration/test_cases/test_50_environment_modification.xml similarity index 97% rename from test/configuration/test_cases/test_39_environment_modification.xml rename to test/configuration/test_cases/test_50_environment_modification.xml index a7f8733f..7d236e8c 100644 --- a/test/configuration/test_cases/test_39_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 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_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 + + + + + + + + + + + + + + + + + + + + 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/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..9f7ba3b8 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -1519,7 +1519,613 @@ } }, - "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": 8, + "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": 13, + "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": 13, + "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 = 7 : A1 snapshot", + + "t = 8 : B2 starts", + "t = 12 : B2 snapshot", + "t = 13 : A1 snapshot & A1 finish", + "t = 17 : B2 snapshot", + + "t = 18 : A2 starts", + "t = 22 : A2 snapshot", + "t = 23 : B2 snapshot & B2 finish", + "t = 27 : 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": 18, + "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": 8, + "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_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": [ "Test to check the consequences of modifying the file referenced by FASTDDS_ENVIRONMENT_FILE on the ", @@ -1538,12 +2144,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 +2166,7 @@ }, "ground_truth_validation": { - "file_path": "/test_solutions/test_39_environment_modification.snapshot" + "file_path": "/test_solutions/test_50_environment_modification.snapshot" } } }