Skip to content

Commit c630fdf

Browse files
committed
Refs #20629: Fix Mac test and improve Inconsistent test
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
1 parent 5879d05 commit c630fdf

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

test/unittest/dds/participant/ParticipantTests.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,10 +1237,9 @@ TEST(ParticipantTests, ServerParticipantRemoteServerListConfiguration)
12371237
}
12381238

12391239
/**
1240-
* SERVER Participant with initial server with inconsistent GUID prefix.
1241-
* Dynamic addition of servers failure.
1240+
* Dynamic modification of servers. Replacing previous servers with new ones.
12421241
*/
1243-
TEST(ParticipantTests, ServerParticipantInconsistentRemoteServerListConfiguration)
1242+
TEST(ParticipantTests, ServerParticipantReplaceRemoteServerListConfiguration)
12441243
{
12451244
Log::ClearConsumers();
12461245
MockConsumer* mockConsumer = new MockConsumer("RTPS_QOS_CHECK");
@@ -1257,9 +1256,6 @@ TEST(ParticipantTests, ServerParticipantInconsistentRemoteServerListConfiguratio
12571256
DomainParticipantQos qos;
12581257
rtps::LocatorList qos_output;
12591258
fastrtps::rtps::Locator_t locator;
1260-
// Servers of the filename will overwrite the one set by QoS
1261-
set_participant_qos(qos, qos_output);
1262-
qos_output.clear();
12631259
fastrtps::rtps::IPLocator::setIPv4(locator, "84.22.253.128");
12641260
locator.port = 8888;
12651261
qos_output.push_back(locator);
@@ -1275,6 +1271,7 @@ TEST(ParticipantTests, ServerParticipantInconsistentRemoteServerListConfiguratio
12751271
DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant(
12761272
(uint32_t)GET_PID() % 230, qos);
12771273
ASSERT_NE(nullptr, participant);
1274+
#ifndef __APPLE__
12781275
fastrtps::rtps::RTPSParticipantAttributes attributes;
12791276
get_rtps_attributes(participant, attributes);
12801277
EXPECT_EQ(attributes.builtin.discovery_config.discoveryProtocol, fastrtps::rtps::DiscoveryProtocol::SERVER);
@@ -1283,15 +1280,17 @@ TEST(ParticipantTests, ServerParticipantInconsistentRemoteServerListConfiguratio
12831280
// Modify environment file: fails cause the initial guid prefix did not comply with the schema
12841281
std::this_thread::sleep_for(std::chrono::milliseconds(100));
12851282
file.open(filename);
1286-
file << "{\"ROS_DISCOVERY_SERVER\": \"84.22.253.128:8888;192.168.1.133:64863;127.0.0.1:1234\"}";
1283+
file << "{\"ROS_DISCOVERY_SERVER\": \"192.168.1.133:64863\"}";
12871284
file.close();
12881285
fastrtps::rtps::IPLocator::setIPv4(locator, "192.168.1.133");
12891286
locator.port = 64863;
1287+
qos_output.clear();
12901288
qos_output.push_back(locator);
12911289

12921290
std::this_thread::sleep_for(std::chrono::milliseconds(100));
12931291
get_rtps_attributes(participant, attributes);
12941292
EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, qos_output);
1293+
#endif // APPLE
12951294
DomainParticipantQos result_qos = participant->get_qos();
12961295
EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos));
12971296
EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant));
@@ -1380,6 +1379,7 @@ TEST(ParticipantTests, ServerParticipantCorrectRemoteServerListConfiguration)
13801379
file.close();
13811380

13821381
DomainParticipantQos qos;
1382+
DomainParticipantQos result_qos;
13831383
set_server_qos(qos);
13841384

13851385
rtps::LocatorList output;
@@ -1392,14 +1392,13 @@ TEST(ParticipantTests, ServerParticipantCorrectRemoteServerListConfiguration)
13921392
DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant(
13931393
(uint32_t)GET_PID() % 230, qos);
13941394
ASSERT_NE(nullptr, participant);
1395+
#ifndef __APPLE__
13951396
fastrtps::rtps::RTPSParticipantAttributes attributes;
13961397
get_rtps_attributes(participant, attributes);
13971398
EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output);
13981399
// Add new server through environment file
13991400
// Even though the server added previously through the environment file is being pinged, it is not really being
14001401
// checked because it is not included in the attributes.
1401-
DomainParticipantQos result_qos;
1402-
#ifndef __APPLE__
14031402
std::this_thread::sleep_for(std::chrono::milliseconds(100));
14041403
file.open(filename);
14051404
file << "{\"ROS_DISCOVERY_SERVER\": \"172.17.0.5:4321;;192.168.1.133:64863\"}";

0 commit comments

Comments
 (0)