From c2cfb0f6e3a06ac74a464bf650b810ff8485b9bf Mon Sep 17 00:00:00 2001 From: cferreiragonz Date: Mon, 18 Nov 2024 12:27:09 +0100 Subject: [PATCH 1/2] Bp #107: TCP tests Signed-off-by: cferreiragonz --- test/CMakeLists.txt | 6 ++ ...4_tcpv4_custom_guid_transform_locators.xml | 98 +++++++++++++++++++ ...v4_custom_guid_transform_locators.snapshot | 24 +++++ test/configuration/tests_params.json | 58 +++++++++++ 4 files changed, 186 insertions(+) create mode 100644 test/configuration/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml create mode 100644 test/configuration/test_solutions/test_94_tcpv4_custom_guid_transform_locators.snapshot diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d4c95261..a79f9d3c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -96,6 +96,12 @@ list(APPEND TEST_LIST test_60_disconnection test_61_superclient_environment_variable + + test_94_tcpv4_custom_guid_transform_locators + test_95_tcpv4_cli + test_96_tcpv6_cli + test_97_tcpv4_env_var + test_98_tcpv6_env_var test_99_tcp ) diff --git a/test/configuration/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml b/test/configuration/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml new file mode 100644 index 00000000..6ca39ec4 --- /dev/null +++ b/test/configuration/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + Knows all + + + + + + + transport_client_1 + TCPv4 + + 0 + + + + transport_client_2 + TCPv4 + + 0 + + + + + + + 63.6c.69.65.6e.74.31.5f.73.31.5f.5f + false + + transport_client_1 + + + + CLIENT + + + +
127.0.0.1
+ 42200 + 42200 +
+
+
+
+
+
+
+ + + + 63.6c.69.65.6e.74.32.5f.73.31.5f.5f + false + + transport_client_2 + + + + CLIENT + + + +
127.0.0.1
+ 42200 + 42200 +
+
+
+
+
+
+
+ + + topic_1 + HelloWorld + + +
+ +
diff --git a/test/configuration/test_solutions/test_94_tcpv4_custom_guid_transform_locators.snapshot b/test/configuration/test_solutions/test_94_tcpv4_custom_guid_transform_locators.snapshot new file mode 100644 index 00000000..30662b2c --- /dev/null +++ b/test/configuration/test_solutions/test_94_tcpv4_custom_guid_transform_locators.snapshot @@ -0,0 +1,24 @@ + + + + Knows all + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/configuration/tests_params.json b/test/configuration/tests_params.json index dfc9184f..69f2a796 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -2271,6 +2271,64 @@ } }, + "test_94_tcpv4_custom_guid_transform_locators": + { + "description": [ + "Test that a TCP discovery server with a custom GUID (-i CLI param) and listening on any (0.0.0.0)\n", + "is able to communicate with a client that connects to localhost (127.0.0.1).\n", + "This test is a regression from #22006" + ], + + "processes": + { + "main": + { + "xml_config_file": "/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml", + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + }, + "count_lines_validation": + { + "file_path": "/test_solutions/test_94_tcpv4_custom_guid_transform_locators.snapshot" + }, + "ground_truth_validation": + { + "guidless": false, + "file_path": "/test_solutions/test_94_tcpv4_custom_guid_transform_locators.snapshot" + } + } + }, + "fastddstool": + { + "kill_time": 6, + "tool_config": + { + "id" : 0, + "tcp_address": "0.0.0.0", + "tcp_port": 42200 + }, + "validation": + { + "exit_code_validation": + { + "expected_exit_code": 0 + }, + "stderr_validation": + { + "err_expected_lines": 0 + } + } + } + } + }, + "test_95_tcpv4_cli": { "description": [ From 040fc18a75578b9829d40ed6646b146624428953 Mon Sep 17 00:00:00 2001 From: cferreiragonz Date: Wed, 18 Dec 2024 12:41:55 +0100 Subject: [PATCH 2/2] Fix TCP tests in 1.2.x Signed-off-by: cferreiragonz --- ...4_tcpv4_custom_guid_transform_locators.xml | 40 +++++++++++-------- .../test_cases/test_95_tcpv4_cli.xml | 4 +- .../test_cases/test_96_tcpv6_cli.xml | 10 ++++- .../test_cases/test_97_tcpv4_env_var.xml | 4 +- .../test_cases/test_98_tcpv6_env_var.xml | 13 +++++- test/configuration/test_cases/test_99_tcp.xml | 40 +++++-------------- .../test_solutions/test_99_tcp.snapshot | 24 +++++------ test/configuration/tests_params.json | 2 +- test/run_test.py | 10 ++--- 9 files changed, 75 insertions(+), 72 deletions(-) diff --git a/test/configuration/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml b/test/configuration/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml index 6ca39ec4..33ab89ad 100644 --- a/test/configuration/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml +++ b/test/configuration/test_cases/test_94_tcpv4_custom_guid_transform_locators.xml @@ -9,10 +9,10 @@ This test is a regression from #22006.--> - + - + @@ -51,13 +51,17 @@ CLIENT - - -
127.0.0.1
- 42200 - 42200 -
-
+ + + + +
127.0.0.1
+ 42200 + 42200 +
+
+
+
@@ -75,13 +79,17 @@ CLIENT - - -
127.0.0.1
- 42200 - 42200 -
-
+ + + + +
127.0.0.1
+ 42200 + 42200 +
+
+
+
diff --git a/test/configuration/test_cases/test_95_tcpv4_cli.xml b/test/configuration/test_cases/test_95_tcpv4_cli.xml index 030df68e..64a914ec 100644 --- a/test/configuration/test_cases/test_95_tcpv4_cli.xml +++ b/test/configuration/test_cases/test_95_tcpv4_cli.xml @@ -2,10 +2,10 @@ - + - + diff --git a/test/configuration/test_cases/test_96_tcpv6_cli.xml b/test/configuration/test_cases/test_96_tcpv6_cli.xml index 01c1850f..480972fd 100644 --- a/test/configuration/test_cases/test_96_tcpv6_cli.xml +++ b/test/configuration/test_cases/test_96_tcpv6_cli.xml @@ -2,10 +2,10 @@ - + - + @@ -23,6 +23,9 @@ 0 + +
::1
+
transport_client_2 @@ -30,6 +33,9 @@ 0 + +
::1
+
diff --git a/test/configuration/test_cases/test_97_tcpv4_env_var.xml b/test/configuration/test_cases/test_97_tcpv4_env_var.xml index 705d2834..828c89d9 100644 --- a/test/configuration/test_cases/test_97_tcpv4_env_var.xml +++ b/test/configuration/test_cases/test_97_tcpv4_env_var.xml @@ -6,10 +6,10 @@ - + - + diff --git a/test/configuration/test_cases/test_98_tcpv6_env_var.xml b/test/configuration/test_cases/test_98_tcpv6_env_var.xml index 0eedf110..279632ff 100644 --- a/test/configuration/test_cases/test_98_tcpv6_env_var.xml +++ b/test/configuration/test_cases/test_98_tcpv6_env_var.xml @@ -6,10 +6,10 @@ - + - + @@ -27,6 +27,9 @@ 42100 + +
::1
+
transport_client_1 @@ -34,6 +37,9 @@ 0 + +
::1
+
transport_client_2 @@ -41,6 +47,9 @@ 0 + +
::1
+
diff --git a/test/configuration/test_cases/test_99_tcp.xml b/test/configuration/test_cases/test_99_tcp.xml index 470f8fdc..0170ce88 100644 --- a/test/configuration/test_cases/test_99_tcp.xml +++ b/test/configuration/test_cases/test_99_tcp.xml @@ -18,21 +18,21 @@ - + - + - - test_27_tcp_snapshot_1 + + test_99_tcp_snapshot_1 @@ -44,8 +44,6 @@ 27811 - false - false @@ -129,31 +127,13 @@ topic_2 - sample_type_2 + HelloWorld - - - - - - - - - - - - - - - - - - - - - - - + + HelloWorldTopic + HelloWorld + +
diff --git a/test/configuration/test_solutions/test_99_tcp.snapshot b/test/configuration/test_solutions/test_99_tcp.snapshot index 9f476ed6..8282bb82 100644 --- a/test/configuration/test_solutions/test_99_tcp.snapshot +++ b/test/configuration/test_solutions/test_99_tcp.snapshot @@ -1,20 +1,20 @@ - test_27_tcp_snapshot_1 + test_99_tcp_snapshot_1 - + - - + + - + @@ -22,16 +22,16 @@ - + - - + + - + @@ -40,15 +40,15 @@ - + - + - + diff --git a/test/configuration/tests_params.json b/test/configuration/tests_params.json index 69f2a796..345cce31 100644 --- a/test/configuration/tests_params.json +++ b/test/configuration/tests_params.json @@ -2545,7 +2545,7 @@ "generate_validation": { "disposals": false, - "server_endpoints": false + "server_endpoints": true }, "ground_truth_validation": { diff --git a/test/run_test.py b/test/run_test.py index ba0ada2a..1c131cb7 100644 --- a/test/run_test.py +++ b/test/run_test.py @@ -317,11 +317,11 @@ def execute_validate_thread_test( try: # Try to set args for fastdds tool # If any is missing could not be an error - server_id = process_params['tool_config']['id'] - server_udp_address = process_params['tool_config']['udp_address'] - server_udp_port = process_params['tool_config']['udp_port'] - server_tcp_port = process_params['tool_config']['tcp_address'] - server_tcp_port = process_params['tool_config']['tcp_port'] + server_id = process_params['tool_config'].get('id', None) + server_udp_address = process_params['tool_config'].get('udp_address', None) + server_udp_port = process_params['tool_config'].get('udp_port', None) + server_tcp_address = process_params['tool_config'].get('tcp_address', None) + server_tcp_port = process_params['tool_config'].get('tcp_port', None) except KeyError: pass