Skip to content

Commit cefb948

Browse files
Fix failing tests in Router 2.x (#508)
* Refs #21670: Fix destructor in tests for 2.x Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Use whitelist for DS with Fast 2.x Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
1 parent 5bdb8b4 commit cefb948

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ddsrouter_core/test/blackbox/ddsrouter_core/dds/WAN/DDSTestWAN.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ discovery_server_participant_configuration(
128128
);
129129
}
130130

131+
// Localhost translation is never accomplished in DS with Fast DDS 2.x due to fixed GUIDs.
132+
// TCPv6 suffers from this issue as it will not be able to make any connection. A whitelist is needed to enforce
133+
// localhost connections.
134+
// This issue is fixed in Fast DDS 3.x with machine_id based translations and non-fixed GUIDs DS's.
135+
participants::types::WhitelistType lo_wl = (ip_version == participants::types::IpVersion::v4 ? "127.0.0.1" : "::1");
136+
conf.whitelist.insert(lo_wl);
137+
131138
conf.id = core::types::ParticipantId("WanDsParticipant_" + std::to_string((this_server_id_is_1 ? 1 : 0)));
132139

133140
conf.discovery_server_guid_prefix = core::types::GuidPrefix((this_server_id_is_1 ? 1u : 0u));

ddsrouter_core/test/blackbox/ddsrouter_core/dds/types/test_participants.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,6 @@ class TestSubscriber
286286
{
287287
if (participant_ != nullptr)
288288
{
289-
if (topic_ != nullptr)
290-
{
291-
participant_->delete_topic(topic_);
292-
}
293289
if (subscriber_ != nullptr)
294290
{
295291
if (reader_ != nullptr)
@@ -298,6 +294,10 @@ class TestSubscriber
298294
}
299295
participant_->delete_subscriber(subscriber_);
300296
}
297+
if (topic_ != nullptr)
298+
{
299+
participant_->delete_topic(topic_);
300+
}
301301
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant_);
302302
}
303303
}

0 commit comments

Comments
 (0)