Skip to content

Commit

Permalink
Merge pull request #49 from eProsima/v1.3.0
Browse files Browse the repository at this point in the history
Release v1.3.0
  • Loading branch information
pablogs9 authored May 22, 2020
2 parents fcded8c + d0db4b4 commit 272c5ad
Show file tree
Hide file tree
Showing 15 changed files with 462 additions and 160 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

project(microxrcedds VERSION "1.2.1")
project(microxrcedds VERSION "1.3.0")

set(_client_tag v1.2.3)
set(_agent_tag v1.3.2)
set(_agent_tag v1.4.0)
set(_gen_tag v1.1.0)

###############################################################################
Expand Down
4 changes: 2 additions & 2 deletions ci/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ project(microxrcedds_ci LANGUAGES C CXX)

include(ExternalProject)

ExternalProject_Add(microxrcedds
ExternalProject_Add(uxrce
SOURCE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/../../
BINARY_DIR
${PROJECT_BINARY_DIR}/microxrcedds-build
${PROJECT_BINARY_DIR}/uxrce
INSTALL_DIR
${PROJECT_BINARY_DIR}/temp_install
BUILD_COMMAND
Expand Down
2 changes: 1 addition & 1 deletion cmake/dev/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ macro(add_gtest test)
else()
add_test(NAME ${GTEST_GROUP_NAME}.${GTEST_NAME}
COMMAND ${test}
--gtest_filter=${GTEST_GROUP_NAME}.${GTEST_NAME})
--gtest_filter=*${GTEST_GROUP_NAME}.${GTEST_NAME}*)
# Add environment
if(WIN32)
set_property(TEST ${GTEST_GROUP_NAME}.${GTEST_NAME} APPEND PROPERTY ENVIRONMENT "PATH=${WIN_PATH}")
Expand Down
2 changes: 1 addition & 1 deletion test/cmake/common/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ macro(add_gtest test)
else()
add_test(NAME ${GTEST_GROUP_NAME}.${GTEST_NAME}
COMMAND ${test}
--gtest_filter=${GTEST_GROUP_NAME}.${GTEST_NAME})
--gtest_filter=*${GTEST_GROUP_NAME}.${GTEST_NAME}*)
# Add environment
if(WIN32)
set_property(TEST ${GTEST_GROUP_NAME}.${GTEST_NAME} APPEND PROPERTY ENVIRONMENT "PATH=${WIN_PATH}")
Expand Down
179 changes: 154 additions & 25 deletions test/test/client_agent/ClientAgentInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,30 @@

#include <thread>

class ClientAgentInteraction : public ::testing::TestWithParam<Transport>
class ClientAgentInteraction : public ::testing::TestWithParam<std::tuple<Transport, MiddlewareKind>>
{
public:
const uint16_t AGENT_PORT = 2018 + uint16_t(this->GetParam());
const uint16_t AGENT_PORT = 2018 + uint16_t(std::get<0>(GetParam()));
const float LOST = 0.1f;

ClientAgentInteraction()
: transport_(GetParam())
, client_(0.0f, 8)
{}
: transport_(std::get<0>(GetParam()))
, middleware_{}
, client_(0.0f, 8)
{
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
middleware_ = eprosima::uxr::Middleware::Kind::FASTDDS;
break;
case MiddlewareKind::FASTRTPS:
middleware_ = eprosima::uxr::Middleware::Kind::FASTRTPS;
break;
case MiddlewareKind::CED:
middleware_ = eprosima::uxr::Middleware::Kind::CED;
break;
}
}

~ClientAgentInteraction()
{}
Expand Down Expand Up @@ -55,22 +69,22 @@ class ClientAgentInteraction : public ::testing::TestWithParam<Transport>
switch(transport_)
{
case Transport::UDP_IPV4_TRANSPORT:
agent_udp4_.reset(new eprosima::uxr::UDPv4Agent(port, eprosima::uxr::Middleware::Kind::FAST));
agent_udp4_.reset(new eprosima::uxr::UDPv4Agent(port, middleware_));
agent_udp4_->set_verbose_level(6);
ASSERT_TRUE(agent_udp4_->start());
break;
case Transport::UDP_IPV6_TRANSPORT:
agent_udp6_.reset(new eprosima::uxr::UDPv6Agent(port, eprosima::uxr::Middleware::Kind::FAST));
agent_udp6_.reset(new eprosima::uxr::UDPv6Agent(port, middleware_));
agent_udp6_->set_verbose_level(6);
ASSERT_TRUE(agent_udp6_->start());
break;
case Transport::TCP_IPV4_TRANSPORT:
agent_tcp4_.reset(new eprosima::uxr::TCPv4Agent(port, eprosima::uxr::Middleware::Kind::FAST));
agent_tcp4_.reset(new eprosima::uxr::TCPv4Agent(port, middleware_));
agent_tcp4_->set_verbose_level(6);
ASSERT_TRUE(agent_tcp4_->start());
break;
case Transport::TCP_IPV6_TRANSPORT:
agent_tcp6_.reset(new eprosima::uxr::TCPv6Agent(port, eprosima::uxr::Middleware::Kind::FAST));
agent_tcp6_.reset(new eprosima::uxr::TCPv6Agent(port, middleware_));
agent_tcp6_->set_verbose_level(6);
ASSERT_TRUE(agent_tcp6_->start());
break;
Expand Down Expand Up @@ -102,11 +116,10 @@ class ClientAgentInteraction : public ::testing::TestWithParam<Transport>
std::unique_ptr<eprosima::uxr::UDPv6Agent> agent_udp6_;
std::unique_ptr<eprosima::uxr::TCPv4Agent> agent_tcp4_;
std::unique_ptr<eprosima::uxr::TCPv6Agent> agent_tcp6_;
eprosima::uxr::Middleware::Kind middleware_;
Client client_;
};

INSTANTIATE_TEST_CASE_P(Transports, ClientAgentInteraction, ::testing::Values(Transport::UDP_IPV4_TRANSPORT, Transport::TCP_IPV4_TRANSPORT, Transport::UDP_IPV6_TRANSPORT, Transport::TCP_IPV6_TRANSPORT));

TEST_P(ClientAgentInteraction, InitCloseSession)
{
for (int i = 0; i < 20; ++i)
Expand All @@ -118,28 +131,85 @@ TEST_P(ClientAgentInteraction, InitCloseSession)

TEST_P(ClientAgentInteraction, NewEntitiesCreationXMLBestEffort)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x01, UXR_STATUS_OK, 0));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x01, UXR_STATUS_OK, 0));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x01, UXR_STATUS_OK, 0));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x01, UXR_STATUS_OK, 0));
break;
}
}

TEST_P(ClientAgentInteraction, NewEntitiesCreationXMLReliable)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_OK, 0));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK, 0));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK, 0));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK, 0));
break;
}
}

TEST_P(ClientAgentInteraction, NewEntitiesCreationREFBestEffort)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref(1, 0x01, UXR_STATUS_OK, 0));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::FASTDDS>(1, 0x01, UXR_STATUS_OK, 0));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::FASTRTPS>(1, 0x01, UXR_STATUS_OK, 0));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::CED>(1, 0x01, UXR_STATUS_OK, 0));
break;
}
}

TEST_P(ClientAgentInteraction, NewEntitiesCreationREFReliable)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref(1, 0x80, UXR_STATUS_OK, 0));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK, 0));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK, 0));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK, 0));
break;
}
}

TEST_P(ClientAgentInteraction, ExistantEntitiesCreationReuseXMLXMLReliable)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REUSE));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REUSE));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REUSE));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REUSE));
break;
}
}

/* TODO (#3589): Fix XML and REF reference issue to enable this test.
Expand All @@ -152,28 +222,87 @@ TEST_P(ClientAgentInteraction, ExistantEntitiesCreationReuseXMLREFReliable)

TEST_P(ClientAgentInteraction, ExistantEntitiesCreationReuseREFREFReliable)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REUSE));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REUSE));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REUSE));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_ref<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REUSE));
break;
}
}

TEST_P(ClientAgentInteraction, ExistantEntitiesCreationReplaceReliable)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_OK, UXR_REPLACE));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK, UXR_REPLACE));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK, UXR_REPLACE));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK, UXR_REPLACE));
break;
}
}

TEST_P(ClientAgentInteraction, ExistantEntitiesCreationNoReplaceReliable)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_ERR_ALREADY_EXISTS, 0));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_ERR_ALREADY_EXISTS, 0));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_ERR_ALREADY_EXISTS, 0));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_ERR_ALREADY_EXISTS, 0));
break;
}
}

TEST_P(ClientAgentInteraction, ExistantEntitiesCreationReplaceReuseReliable)
{
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REPLACE | UXR_REUSE));
switch (std::get<1>(GetParam()))
{
case MiddlewareKind::FASTDDS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTDDS>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REPLACE | UXR_REUSE));
break;
case MiddlewareKind::FASTRTPS:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::FASTRTPS>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REPLACE | UXR_REUSE));
break;
case MiddlewareKind::CED:
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK, 0));
ASSERT_NO_FATAL_FAILURE(client_.create_entities_xml<MiddlewareKind::CED>(1, 0x80, UXR_STATUS_OK_MATCHED, UXR_REPLACE | UXR_REUSE));
break;
}
}

INSTANTIATE_TEST_CASE_P(
Transports,
ClientAgentInteraction,
::testing::Combine(
::testing::Values(Transport::UDP_IPV4_TRANSPORT, Transport::TCP_IPV4_TRANSPORT, Transport::UDP_IPV6_TRANSPORT, Transport::TCP_IPV6_TRANSPORT),
::testing::Values(MiddlewareKind::FASTDDS, MiddlewareKind::FASTRTPS, MiddlewareKind::CED)));

int main(int args, char** argv)
{
::testing::InitGoogleTest(&args, argv);
Expand Down
8 changes: 6 additions & 2 deletions test/test/client_agent/DEFAULT_FASTRTPS_PROFILES.xml.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<profiles>
<participant profile_name="default_xrce_participant">
<domainId>0</domainId>
<rtps>
<builtin>
<leaseDuration>INFINITE</leaseDuration>
<domainId>0</domainId>
<discovery_config>
<leaseDuration>
<sec>DURATION_INFINITY</sec>
</leaseDuration>
</discovery_config>
</builtin>
<name>default_xrce_participant</name>
</rtps>
Expand Down
Loading

0 comments on commit 272c5ad

Please sign in to comment.