Skip to content

Commit

Permalink
Feature: Fast DDS ROS2_EASY_MODE tests (#112)
Browse files Browse the repository at this point in the history
* Refs #22106: Update test with new CLI params

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #22106: Add test for AUTO mode

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #22518: Adapt tests to new daemon

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #22518: Fix supbrocesses termination and replace shutdown

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #22518: Increase test_85 margins

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #22623: Regression test for TCP reconnection

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #22627: Refactor to EASY_MODE

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #22627: Use UDP for discovery purposes

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #22627: ROS2_EASY_MODE

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
  • Loading branch information
cferreiragonz authored Jan 23, 2025
1 parent 50938b2 commit e092959
Show file tree
Hide file tree
Showing 22 changed files with 2,150 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Install Python dependencies
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2 psutil
upgrade: false

- name: Setup CCache
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
- name: Install Python dependencies
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2 psutil
upgrade: false

- name: Setup CCache
Expand Down
19 changes: 17 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ list(APPEND TEST_LIST
test_60_disconnection
test_61_superclient_environment_variable

test_80_auto
test_81_auto_ros_domain_id_env_var
test_82_auto_ros_static_peers_env_var
test_83_start
test_84_add
test_85_set_add_stop
test_86_stop_all_servers

test_93_tcp_reconnect_with_clients
test_94_tcpv4_custom_guid_transform_locators
test_95_tcpv4_cli
test_96_tcpv6_cli
Expand Down Expand Up @@ -145,6 +154,12 @@ set(TEST_CASE_LIST)
set(FAIL_TEST_CASES)

# For each test case, create different executables for each configuration
find_program(FASTDDS_PYTHON_EXECUTABLE fastdds PATHS ${CMAKE_INSTALL_PREFIX}/bin)
if(FASTDDS_PYTHON_EXECUTABLE)
message(STATUS "Found Fast DDS CLI executable at: ${FASTDDS_PYTHON_EXECUTABLE}")
else()
message(WARNING "Fast DDS CLI Executable not found!")
endif()
foreach(TEST IN LISTS TEST_LIST)

unset(TEST_NAME)
Expand All @@ -155,7 +170,7 @@ foreach(TEST IN LISTS TEST_LIST)
COMMAND ${PYTHON_EXECUTABLE} ${RUN_TEST}
-e $<TARGET_FILE:${PROJECT_NAME}>
-p ${TESTS_PARAMS}
-f $<$<TARGET_EXISTS:fastdds::fast-discovery-server>:$<TARGET_FILE:fastdds::fast-discovery-server>>
-f ${FASTDDS_PYTHON_EXECUTABLE}
-t ${TEST}
-s true
-i false) # Remove this argument to execute test with and without intraprocess
Expand All @@ -176,7 +191,7 @@ foreach(TEST IN LISTS TEST_LIST)
COMMAND ${PYTHON_EXECUTABLE} ${RUN_TEST}
-e $<TARGET_FILE:${PROJECT_NAME}>
-p ${TESTS_PARAMS}
-f $<$<TARGET_EXISTS:fastdds::fast-discovery-server>:$<TARGET_FILE:fastdds::fast-discovery-server>>
-f ${FASTDDS_PYTHON_EXECUTABLE}
-t ${TEST}
-s false
-i false) # Remove this argument to execute test with and without intraprocess
Expand Down
32 changes: 32 additions & 0 deletions test/configuration/test_cases/test_80_auto.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">

<!-- S1 is created with Fast DDS CLI tool in ROS2_EASY_MODE.
Default domain is used (0).
Clients must know their matching participants:
S1: C1 & C2
C1: C2 & S1
C2: C1 & S1
Note that in ROS2_EASY_MODE all clients are Superclients-->

<simples>
<simple name="client1">
<publisher topic="topic1"/>
</simple>
<simple name="client2">
<subscriber topic="topic1"/>
</simple>
</simples>

<snapshots file="./test_80_auto.snapshot~">
<snapshot time="5">test_80_auto_snapshot</snapshot>
</snapshots>

<profiles>
<topic profile_name="topic1">
<name>topic_1</name>
<dataType>HelloWorld</dataType>
</topic>

</profiles>
</DS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">

<!-- S1 is created with Fast DDS CLI tool in ROS2_EASY_MODE.
Domain ID is given to the tool using the environment variable.
Clients must know their matching participants:
S1: C1 & C2
C1: C2 & S1
C2: C1 & S1
Note that in ROS2_EASY_MODE all clients are Superclients-->

<simples>
<simple name="client1">
<publisher topic="topic1"/>
</simple>
<simple name="client2">
<subscriber topic="topic1"/>
</simple>
</simples>

<snapshots file="./test_81_auto_ros_domain_id_env_var.snapshot~">
<snapshot time="5">test_81_auto_ros_domain_id_env_var</snapshot>
</snapshots>

<profiles>
<topic profile_name="topic1">
<name>topic_1</name>
<dataType>HelloWorld</dataType>
</topic>
</profiles>
</DS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">

<!-- Servers are created with Fast DDS CLI tool in ROS2_EASY_MODE.
S2 uses the ROS_STATIC_PEERS environment variable to point to S1.
Clients must know their matching participants:
S1: C1 & S2
S2: C2 & S1
C1: C2 & S1
C2: C1 & S2
Note that in ROS2_EASY_MODE all clients are Superclients-->

<clients>
<client name="client1_S1" profile_name="client1_S1" listening_port="0">
<publisher topic="topic1"/>
</client>
<client name="client1_S2" profile_name="client1_S2" listening_port="0">
<subscriber topic="topic1"/>
</client>
</clients>

<snapshots file="./test_82_auto_ros_static_peers_env_var.snapshot~">
<snapshot time="5">test_82_auto_ros_static_peers_env_var</snapshot>
</snapshots>

<profiles>
<participant profile_name="client1_S1" >
<rtps>
<prefix>63.6c.69.65.6e.74.31.5f.73.31.5f.5f</prefix>
<builtin>
<discovery_config>
<discoveryProtocol>CLIENT</discoveryProtocol>
<discoveryServersList>
<locator>
<udpv4>
<address>127.0.0.1</address>
<port>7402</port>
</udpv4>
</locator>
</discoveryServersList>
<initialAnnouncements>
<count>0</count>
</initialAnnouncements>
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
<leaseDuration>DURATION_INFINITY</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>

<participant profile_name="client1_S2" >
<rtps>
<prefix>63.6c.69.65.6e.74.32.5f.73.31.5f.5f</prefix>
<builtin>
<discovery_config>
<discoveryProtocol>CLIENT</discoveryProtocol>
<discoveryServersList>
<locator>
<udpv4>
<address>127.0.0.1</address>
<port>8152</port>
</udpv4>
</locator>
</discoveryServersList>
<initialAnnouncements>
<count>0</count>
</initialAnnouncements>
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
<leaseDuration>DURATION_INFINITY</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>

<topic profile_name="topic1">
<name>topic_1</name>
<dataType>HelloWorld</dataType>
</topic>
</profiles>
</DS>
80 changes: 80 additions & 0 deletions test/configuration/test_cases/test_83_start.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">

<!-- S1 is created with Fast DDS CLI tool in ROS2_EASY_MODE.
S2 is created using the START keyword to point to S1.
Clients must know their matching participants:
S1: C1 & S2
S2: C2 & S1
C1: C2 & S1
C2: C1 & S2
Note that in ROS2_EASY_MODE all clients are Superclients-->

<clients>
<client name="client1_S1" profile_name="client1_S1" listening_port="0">
<publisher topic="topic1"/>
</client>
<client name="client1_S2" profile_name="client1_S2" listening_port="0">
<subscriber topic="topic1"/>
</client>
</clients>

<snapshots file="./test_83_start.snapshot~">
<snapshot time="5">test_83_start</snapshot>
</snapshots>

<profiles>
<participant profile_name="client1_S1" >
<rtps>
<prefix>63.6c.69.65.6e.74.31.5f.73.31.5f.5f</prefix>
<builtin>
<discovery_config>
<discoveryProtocol>CLIENT</discoveryProtocol>
<discoveryServersList>
<locator>
<udpv4>
<address>127.0.0.1</address>
<port>7402</port>
</udpv4>
</locator>
</discoveryServersList>
<initialAnnouncements>
<count>0</count>
</initialAnnouncements>
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
<leaseDuration>DURATION_INFINITY</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>

<participant profile_name="client1_S2" >
<rtps>
<prefix>63.6c.69.65.6e.74.32.5f.73.31.5f.5f</prefix>
<builtin>
<discovery_config>
<discoveryProtocol>CLIENT</discoveryProtocol>
<discoveryServersList>
<locator>
<udpv4>
<address>127.0.0.1</address>
<port>8152</port>
</udpv4>
</locator>
</discoveryServersList>
<initialAnnouncements>
<count>0</count>
</initialAnnouncements>
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
<leaseDuration>DURATION_INFINITY</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>

<topic profile_name="topic1">
<name>topic_1</name>
<dataType>HelloWorld</dataType>
</topic>
</profiles>
</DS>
80 changes: 80 additions & 0 deletions test/configuration/test_cases/test_84_add.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">

<!-- Servers are created with Fast DDS CLI tool in ROS2_EASY_MODE.
Then, the Fast DDS CLI tool is called with the ADD keyword to make S2 point to S1.
Clients must know their matching participants:
S1: C1 & S2
S2: C2 & S1
C1: C2 & S1
C2: C1 & S2
Note that in ROS2_EASY_MODE all clients are Superclients-->

<clients>
<client name="client1_S1" profile_name="client1_S1" listening_port="0">
<publisher topic="topic1"/>
</client>
<client name="client1_S2" profile_name="client1_S2" listening_port="0">
<subscriber topic="topic1"/>
</client>
</clients>

<snapshots file="./test_84_add.snapshot~">
<snapshot time="5">test_84_add</snapshot>
</snapshots>

<profiles>
<participant profile_name="client1_S1" >
<rtps>
<prefix>63.6c.69.65.6e.74.31.5f.73.31.5f.5f</prefix>
<builtin>
<discovery_config>
<discoveryProtocol>CLIENT</discoveryProtocol>
<discoveryServersList>
<locator>
<udpv4>
<address>127.0.0.1</address>
<port>7402</port>
</udpv4>
</locator>
</discoveryServersList>
<initialAnnouncements>
<count>0</count>
</initialAnnouncements>
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
<leaseDuration>DURATION_INFINITY</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>

<participant profile_name="client1_S2" >
<rtps>
<prefix>63.6c.69.65.6e.74.32.5f.73.31.5f.5f</prefix>
<builtin>
<discovery_config>
<discoveryProtocol>CLIENT</discoveryProtocol>
<discoveryServersList>
<locator>
<udpv4>
<address>127.0.0.1</address>
<port>8152</port>
</udpv4>
</locator>
</discoveryServersList>
<initialAnnouncements>
<count>0</count>
</initialAnnouncements>
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
<leaseDuration>DURATION_INFINITY</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>

<topic profile_name="topic1">
<name>topic_1</name>
<dataType>HelloWorld</dataType>
</topic>
</profiles>
</DS>
Loading

0 comments on commit e092959

Please sign in to comment.