Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20121] Remove unnecessary TCP warning & Fix some tests (backport #4217) #4275

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading