diff --git a/CMakeLists.txt b/CMakeLists.txt index b506c027beb..854c23b3110 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -554,12 +554,17 @@ install(FILES ${PROJECT_SOURCE_DIR}/LICENSE COMPONENT licenses ) -# Install xml validator +# Install xml validators install(FILES ${PROJECT_SOURCE_DIR}/resources/xsd/fastRTPS_profiles.xsd DESTINATION ${DATA_INSTALL_DIR} COMPONENT xsd ) +install(FILES ${PROJECT_SOURCE_DIR}/resources/xsd/fastdds_static_discovery.xsd + DESTINATION ${DATA_INSTALL_DIR} + COMPONENT xsd + ) + option(INSTALL_EXAMPLES "Install example" OFF) if(INSTALL_EXAMPLES) diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher_static_disc.xml b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher_static_disc.xml index f6997ff9092..93cd6a06a0e 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher_static_disc.xml +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher_static_disc.xml @@ -1,13 +1,13 @@ - - HelloWorldPublisher - - 1 - 2 + + HelloWorldPublisher + + 1 + 2 HelloWorldTopic - HelloWorld - NO_KEY - RELIABLE_RELIABILITY_QOS - - + HelloWorld + NO_KEY + RELIABLE_RELIABILITY_QOS + + diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber_static_disc.xml b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber_static_disc.xml index 28f44534c5d..ee78157bbdd 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber_static_disc.xml +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber_static_disc.xml @@ -1,13 +1,13 @@ - - HelloWorldSubscriber - - 3 - 4 + + HelloWorldSubscriber + + 3 + 4 HelloWorldTopic - HelloWorld - NO_KEY - RELIABLE_RELIABILITY_QOS - - + HelloWorld + NO_KEY + RELIABLE_RELIABILITY_QOS + + diff --git a/resources/xsd/fastdds_static_discovery.xsd b/resources/xsd/fastdds_static_discovery.xsd new file mode 100644 index 00000000000..2e79288c12a --- /dev/null +++ b/resources/xsd/fastdds_static_discovery.xsd @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/blackbox/PubSubReaderPersistence_static_disc.xml.in b/test/blackbox/PubSubReaderPersistence_static_disc.xml.in index 074c2e7bf7c..a42841f696b 100644 --- a/test/blackbox/PubSubReaderPersistence_static_disc.xml.in +++ b/test/blackbox/PubSubReaderPersistence_static_disc.xml.in @@ -10,12 +10,10 @@ RELIABLE_RELIABILITY_QOS - + port="@W_UNICAST_PORT_RANDOM_NUMBER@"/> - + port="@MULTICAST_PORT_RANDOM_NUMBER@"/> TRANSIENT_DURABILITY_QOS diff --git a/test/blackbox/PubSubReader_static_disc.xml.in b/test/blackbox/PubSubReader_static_disc.xml.in index fda94441cd6..3d0fe1ed68f 100644 --- a/test/blackbox/PubSubReader_static_disc.xml.in +++ b/test/blackbox/PubSubReader_static_disc.xml.in @@ -10,12 +10,10 @@ RELIABLE_RELIABILITY_QOS - + port="@W_UNICAST_PORT_RANDOM_NUMBER@"/> - + port="@MULTICAST_PORT_RANDOM_NUMBER@"/> TRANSIENT_LOCAL_DURABILITY_QOS diff --git a/test/blackbox/PubSubWriterPersistence_static_disc.xml.in b/test/blackbox/PubSubWriterPersistence_static_disc.xml.in index 3de512887a5..1a5ef21f454 100644 --- a/test/blackbox/PubSubWriterPersistence_static_disc.xml.in +++ b/test/blackbox/PubSubWriterPersistence_static_disc.xml.in @@ -11,12 +11,10 @@ RELIABLE_RELIABILITY_QOS - + port="@R_UNICAST_PORT_RANDOM_NUMBER@"/> - + port="@MULTICAST_PORT_RANDOM_NUMBER@"/> TRANSIENT_DURABILITY_QOS diff --git a/test/blackbox/PubSubWriter_static_disc.xml.in b/test/blackbox/PubSubWriter_static_disc.xml.in index 113ac85a023..bea02cb3617 100644 --- a/test/blackbox/PubSubWriter_static_disc.xml.in +++ b/test/blackbox/PubSubWriter_static_disc.xml.in @@ -11,12 +11,10 @@ RELIABLE_RELIABILITY_QOS - + port="@R_UNICAST_PORT_RANDOM_NUMBER@"/> - + port="@MULTICAST_PORT_RANDOM_NUMBER@"/> TRANSIENT_LOCAL_DURABILITY_QOS diff --git a/test/system/tools/fastdds/CMakeLists.txt b/test/system/tools/fastdds/CMakeLists.txt index bdc578a3eec..82ba17dc1c8 100644 --- a/test/system/tools/fastdds/CMakeLists.txt +++ b/test/system/tools/fastdds/CMakeLists.txt @@ -169,3 +169,58 @@ endif() # Define test add_test(NAME xml.validate COMMAND ${env_fast_command} xml validate xmldocuments) + +############################################################################### +# XML Static discovery validation +############################################################################### + +# Copy the examples validation files over to the build directory +file(GLOB_RECURSE STATIC_DISC_XML_EXAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/../../../../examples/*_static_disc.xml) + +# for each xml file detected in examples folder +foreach(STATIC_DISC_XML_EXAMPLE_COMPLETE_PATH ${STATIC_DISC_XML_EXAMPLE}) + # obtain the file name + get_filename_component(STATIC_DISC_XML_EXAMPLE ${STATIC_DISC_XML_EXAMPLE_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${STATIC_DISC_XML_EXAMPLE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xml_static_disc_docs/examples/${STATIC_DISC_XML_EXAMPLE}.xml # to relative build path + COPYONLY) +endforeach() + +# Copy the test validation files over to the build directory +file(GLOB_RECURSE STATIC_DISC_XML_TEST ${CMAKE_CURRENT_SOURCE_DIR}/../*_static_disc.xml) + +# for each xml file detected in test folder +foreach(STATIC_DISC_XML_TEST_COMPLETE_PATH ${STATIC_DISC_XML_TEST}) + # obtain the file name + get_filename_component(STATIC_DISC_XML_TEST ${STATIC_DISC_XML_TEST_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${STATIC_DISC_XML_TEST_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xml_static_disc_docs/test/system/${STATIC_DISC_XML_TEST}.xml # to relative build path + COPYONLY) +endforeach() + +# Copy the sampled test files over to the build directory +file(GLOB_RECURSE STATIC_DISC_XML_SAMPLED_TEST ${CMAKE_CURRENT_SOURCE_DIR}/../../../blackbox/*_static_disc.xml.in) + +# set the expected CMake variables for the samples +set(TOPIC_RANDOM_NUMBER "123") +set(W_UNICAST_PORT_RANDOM_NUMBER "456") +set(R_UNICAST_PORT_RANDOM_NUMBER "654") +set(MULTICAST_PORT_RANDOM_NUMBER "789") + +# for each xml file detected in examples folder +foreach(STATIC_DISC_XML_SAMPLED_TEST_COMPLETE_PATH ${STATIC_DISC_XML_SAMPLED_TEST}) + # obtain the file name + get_filename_component(STATIC_DISC_XML_SAMPLED_TEST ${STATIC_DISC_XML_SAMPLED_TEST_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${STATIC_DISC_XML_SAMPLED_TEST_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xml_static_disc_docs/test/blackbox/${STATIC_DISC_XML_SAMPLED_TEST}.xml # to relative build path + ) +endforeach() + +# Define test +add_test(NAME xml.static_disc_validate COMMAND ${env_fast_command} xml validate xml_static_disc_docs -x ${CMAKE_SOURCE_DIR}/resources/xsd/fastdds_static_discovery.xsd) diff --git a/test/system/tools/xmlvalidation/discovery_static_disc.xml b/test/system/tools/xmlvalidation/discovery_static_disc.xml new file mode 100644 index 00000000000..021dc2a26e4 --- /dev/null +++ b/test/system/tools/xmlvalidation/discovery_static_disc.xml @@ -0,0 +1,38 @@ + + + writer_participant + + 1 + 2 + true + HelloWorldTopic + HelloWorld + NO_KEY + customqosgoeshere + TRANSIENT_LOCAL_DURABILITY_QOS + + + RELIABLE_RELIABILITY_QOS + + + + reader_participant + + 1 + 2 + false + HelloWorldTopic + HelloWorld + WITH_KEY + + + + + true + + DURATION_INFINITY + + + + + diff --git a/versions.md b/versions.md index c538315febe..7b0cfcccbf3 100644 --- a/versions.md +++ b/versions.md @@ -7,6 +7,7 @@ Forthcoming * Fixed exported symbols on ContentFilteredTopic (ABI break) * Deprecated the DDS:Crypto:AES-GCM-GMAC plugin configuration through the DomainParticipant PropertyPolicyQos (security vulnerability). * `DomainParticipantListener::on_participant_discovery` changed behavior (fix API break in 2.10.0). +* Included XML schema for static discovery profile configuration. Version 2.10.1 --------------