Skip to content

Commit

Permalink
Remove unnecessary TCP warning & Fix some tests (#4217) (#4275)
Browse files Browse the repository at this point in the history
* Remove unnecessary warning (#4217)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit ab94226)

* Refs #20485: Fix tests using PubSubParticipant

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20485: PubSubBasic test fix

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

---------

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
Co-authored-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
3 people authored Feb 29, 2024
1 parent 47591e4 commit 464de2d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/cpp/rtps/transport/TCPTransportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,9 +1169,6 @@ bool TCPTransportInterface::send(
{
//std::cout << "ChannelLocator: " << IPLocator::to_string(channel->locator()) << std::endl;
//std::cout << "RemoteLocator: " << IPLocator::to_string(remote_locator) << std::endl;

logWarning(RTCP, "SEND [RTPS] Failed: Not connect: " << IPLocator::getLogicalPort(remote_locator) \
<< " @ IP: " << IPLocator::toIPv4string(remote_locator));
return false;
}

Expand Down
1 change: 1 addition & 0 deletions test/blackbox/api/dds-pim/PubSubParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ class PubSubParticipant

if (participant_ != nullptr)
{
participant_qos_ = participant_->get_qos();
type_.reset(new type_support());
participant_->register_type(type_);
return true;
Expand Down
35 changes: 31 additions & 4 deletions test/blackbox/common/BlackboxTestsPubSubBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,15 @@ TEST_P(PubSubBasic, ReceivedPropertiesDataWithinSizeLimit)

Locator_t LocatorBuffer;

// Set statistics properties manually to ensure a fixed size of participant properties
PropertyPolicy property_policy;
property_policy.properties().emplace_back(
eprosima::fastdds::dds::parameter_policy_physical_data_host, "test_host");
property_policy.properties().emplace_back(
eprosima::fastdds::dds::parameter_policy_physical_data_user, "test_user");
property_policy.properties().emplace_back(
eprosima::fastdds::dds::parameter_policy_physical_data_process, "test_process");

PubSubWriter<HelloWorldPubSubType> writer(TEST_TOPIC_NAME);

LocatorList_t WriterUnicastLocators;
Expand All @@ -559,7 +568,8 @@ TEST_P(PubSubBasic, ReceivedPropertiesDataWithinSizeLimit)
writer.static_discovery("file://PubSubWriter.xml").
unicastLocatorList(WriterUnicastLocators).multicastLocatorList(WriterMulticastLocators).
setPublisherIDs(1,
2).setManualTopicName(std::string("BlackBox_StaticDiscovery_") + TOPIC_RANDOM_NUMBER).init();
2).setManualTopicName(std::string("BlackBox_StaticDiscovery_") + TOPIC_RANDOM_NUMBER)
.property_policy(property_policy).init();

ASSERT_TRUE(writer.isInitialized());

Expand All @@ -573,12 +583,29 @@ TEST_P(PubSubBasic, ReceivedPropertiesDataWithinSizeLimit)
LocatorBuffer.port = static_cast<uint16_t>(MULTICAST_PORT_RANDOM_NUMBER);
ReaderMulticastLocators.push_back(LocatorBuffer);

//Expected properties have exactly size 92
reader.properties_max_size(92).
// The calculation of the exact maximum properties size has been done according to the following table
//
// | Type | Value | Size | Alignment | Extra | Total |
// |-------|-------------------------------------|------|-----------|-------|-------|
// | key | PARTICIPANT_TYPE | 17 | 3 | 4 | 24 |
// | value | SIMPLE | 7 | 1 | 4 | 12 |
// | key | fastdds.physical_data.host | 27 | 1 | 4 | 32 |
// | value | test_host | 10 | 2 | 4 | 16 |
// | key | fastdds.physical_data.user | 27 | 1 | 4 | 32 |
// | value | test_user | 10 | 2 | 4 | 16 |
// | key | fastdds.physical_data.process | 30 | 2 | 4 | 36 |
// | value | test_process | 13 | 3 | 4 | 20 |
// | key | eProsimaEDPStatic_Writer_ALIVE_ID_1 | 36 | 0 | 4 | 40 |
// | value | 0.0.2.3 | 8 | 0 | 4 | 12 |
//
// Total: 240 Bytes

reader.properties_max_size(240).
static_discovery("file://PubSubReader.xml").
unicastLocatorList(ReaderUnicastLocators).multicastLocatorList(ReaderMulticastLocators).
setSubscriberIDs(3,
4).setManualTopicName(std::string("BlackBox_StaticDiscovery_") + TOPIC_RANDOM_NUMBER).init();
4).setManualTopicName(std::string("BlackBox_StaticDiscovery_") + TOPIC_RANDOM_NUMBER)
.property_policy(property_policy).init();

ASSERT_TRUE(reader.isInitialized());

Expand Down

0 comments on commit 464de2d

Please sign in to comment.