Skip to content

Commit

Permalink
Refs 11857. Added comments on test.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Jun 23, 2021
1 parent b9342d2 commit e3fd130
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/blackbox/common/DDSBlackboxTestsDiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@
// Regression test for redmine issue 11857
TEST(DDSDiscovery, IgnoreParticipantFlags)
{
// This participant is created with:
// - ignoreParticipantFlags = FILTER_SAME_PROCESS (will avoid discovery of p2)
// - metatrafficUnicastLocatorList = 127.0.0.1:7399, 127.0.0.1:7398 (to ensure two listening threads are created)
PubSubReader<HelloWorldType> p1(TEST_TOPIC_NAME);
p1.set_xml_filename("discovery_participant_flags.xml");
p1.set_participant_profile("participant_1");
p1.init();
EXPECT_TRUE(p1.isInitialized());

// This participant is created with initialPeersList = 127.0.0.1:7399
// When the announcements of this participant arrive to p1, they will be ignored, and thus p1 will not
// announce itself back to p2.
PubSubReader<HelloWorldType> p2(TEST_TOPIC_NAME);
p2.set_xml_filename("discovery_participant_flags.xml");
p2.set_participant_profile("participant_2");
Expand All @@ -35,6 +41,11 @@ TEST(DDSDiscovery, IgnoreParticipantFlags)
EXPECT_FALSE(p2.wait_participant_discovery(1, std::chrono::seconds(1)));
EXPECT_FALSE(p1.wait_participant_discovery(1, std::chrono::seconds(1)));

// This participant is created with:
// - initialPeersList = 127.0.0.1:7398
// - a custom guid prefix
// The announcements of this participant will arrive to p1 on a different listening thread.
// Due to the custom prefix, they should not be ignored, and mutual discovery should happen
PubSubReader<HelloWorldType> p3(TEST_TOPIC_NAME);
p3.set_xml_filename("discovery_participant_flags.xml");
p3.set_participant_profile("participant_3");
Expand Down

0 comments on commit e3fd130

Please sign in to comment.