Commit graph

912 commits

Author SHA1 Message Date
Erik Boasson
15179910d1 Write test fails to stdout/stderr even from ctest
Running tests while writing failed assertions to a text file means the
little information there is that causes test failures becomes pretty
much inaccessible on Travis.  Sending the output to stdout/stderr means
it can be trivially shown for failed tests using the --output-on-failure
option of ctest.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-19 15:16:52 +01:00
Erik Boasson
8cbd67c32b Report failure from CUnit only on test failure
Non-automated mode too should allow running a subset of the tests
without reporting failure.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-19 15:16:52 +01:00
Erik Boasson
0426e4b355 Delete unused CRC32 implementation
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-19 15:16:52 +01:00
Erik Boasson
8849392c5e Accept invalid pre-emptive ACKNACK from Connext
Connext (sometimes, for some versions?) sends a pre-emptive ACKNACK with
a base sequence number of 0, which were rejected following the DDSI
specification (8.3.4.1, 8.3.5.5 and 8.3.7.1.3).  That doesn't really
help anyone.  (https://github.com/ros2/ros2/issues/824)

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-19 10:52:09 +01:00
Erik Boasson
3a3fb64a35 Fix casing of domain "Id" attribute in test config (#283)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 15:11:02 +01:00
Erik Boasson
a16118c8c8 Remove references to deleted make, solution files (#236)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 14:37:54 +01:00
Erik Boasson
e43bdb73c7 Fix install dir of CycloneDDSConfig.cmake (#321)
Installing Cyclone DDS for multiple architectures with the same
installation prefix gave problems because the CMake configuration files
ended up overwriting each other.  This brings it in line with the
recommended locations.  Thanks to @hansfn.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 14:21:10 +01:00
Erik Boasson
3da21315f2 Improve errors for invalid port numbers (#303)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 14:20:55 +01:00
Erik Boasson
2d8bf36f8e Fix ddsperf interpretation of kHz
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 14:20:55 +01:00
Erik Boasson
210fa7e78f Add keyless topics with small payloads to ddsperf
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 14:20:55 +01:00
Erik Boasson
c603fdd4ed Fix trivial white space, compiler warnings
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 14:20:55 +01:00
Erik Boasson
fc0b402584 Delete some leftover type definitions
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 14:20:55 +01:00
Dan Rose
6ed01fc62a Fix string literal under cpp compiler
PGUIDFMT creates invalid C++ code.

In file included from /opt/ros/master/src/ros2/rmw_cyclonedds/rmw_cyclonedds_cpp/src/serdata.cpp:23:
In file included from /opt/ros/master/install/include/dds/ddsi/q_radmin.h:17:
In file included from /opt/ros/master/install/include/dds/ddsi/ddsi_tran.h:19:
In file included from /opt/ros/master/install/include/dds/ddsi/q_protocol.h:19:
/opt/ros/master/install/include/dds/ddsi/q_rtps.h:30:21: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
                    ^

/opt/ros/master/install/include/dds/ddsi/q_rtps.h:30:31: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]

Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-18 10:26:03 +01:00
Erik Boasson
9b7d93ec02 Fix editing error in README config example
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-14 22:03:17 +01:00
Martin Bremmer
b6b0c25355 Add domain creation torture test.
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>

Disabled domain_torture_imlicit test.

Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
2019-11-14 14:17:37 +01:00
Martin Bremmer
fc8b8fef3a Small entity deletion wip refactoring.
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
2019-11-14 14:17:37 +01:00
Martin Bremmer
40973d8e29 Update function headers and added dds_create_domain() tests.
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
2019-11-14 14:17:37 +01:00
Erik Boasson
33ba911192 Fix dds_create_domain return and error handling
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-14 14:17:37 +01:00
Martin Bremmer
e2afccf4a0 Fixed security build.
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
2019-11-14 12:08:13 +01:00
Dan Rose
bd858ea97f Add idlc to packaging and examples
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-14 10:02:01 +01:00
Dan Rose
d12b926ff1 Move IDLC to its own install component
This allows you to express a dependency on it as `find_package(CycloneDDS REQUIRED COMPONENTS idlc)`
Also added a warning if CycloneDDS was built with IDLC but IDLC is not requested.

Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-14 10:02:01 +01:00
Scott K Logan
eeeea486c8 fixup! Allow BUILD_IDLC to be 'AUTO' based on Maven presence
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-11-14 09:59:47 +01:00
Scott K Logan
7b428f14b9 Allow BUILD_IDLC to be 'AUTO' based on Maven presence
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-11-14 09:59:47 +01:00
Scott K Logan
9260464be8 fixup! Set default BUILD_IDLC based on presence of Maven
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-11-14 09:59:47 +01:00
Scott K Logan
94524bfd76 Set default BUILD_IDLC based on presence of Maven
This will modify the default behavior to select BUILD_IDLC based on
whether Maven is discovered or not.

The behavior when `-DBUILD_IDLC` is specified on the command line remains
unchanged - the build will maintain the current behavior of failing to
configure if `BUILD_IDLC=ON` and Maven was later not found.

This reverts (part of) commit 860a6aadae.

Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-11-14 09:59:47 +01:00
Erik Boasson
ff79941aeb If possible, fail build on option doc mismatch
This adds a bunch of steps to the build process that verify
cyclonedds.xsd, cyclonedds.rnc and options.md as committed match the
configuration tables in the source.

The cyclonedds.rnc and options.md depend on having perl available,
cyclonedds.xsd on having Java and the "trang" conversion tool.  Not
having these tools simply means some of the checks are skipped.

Signed-off-by: Erik Boasson <eb@ilities.com>

makernc: more forgiving of line endings input

Signed-off-by: Erik Boasson <eb@ilities.com>

Ignore line endings comparing cyclonedds XSD, RNC

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 20:39:20 +01:00
Erik Boasson
c642f5676a Namespace generated XSD and add missing attributes
This adds two things to the XSD (and the RNC file and options.md):
* attributes previously missing because of a bug in the conversion
  script
* a name space (https://cdds.io/config)

Adding the name spacing requires a different set of attributes at the
top of a configuration file, which in turn need to be ignored by the
configuration parser, and which should be reflected in the configuration
example in the README.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 20:39:20 +01:00
Dan Rose
c5b22bf629 Fix most of the validation problems
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-06 20:39:20 +01:00
Dan Rose
4f2addef1a Allow xmlns attribute on the root element
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-06 20:39:20 +01:00
Dan Rose
ae1a8130c7 Namespace the schema and add references in xml files
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-06 20:39:20 +01:00
Erik Boasson
a1aaa2808f Check once for system-independent headers (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 14:39:01 +01:00
Erik Boasson
b9e5e8cd7d Xcode 11.1 for macOS 10.12 build, Xcode 9 via cron
The Xcode 9 builds often fail because of some nasty interaction between
it and the Travis build cache -- but not caching means they always take
forever because of homebrew updates.  This commit changes the build to
use a new Xcode but with a deployment target of 10.12 instead.

This means that macOS version macros for versions later than 10.12 are
available and that the tests run on a later version of macOS as well.
Therefore, it doesn't prove that a "real" Xcode 9 / macOS 10.12 build
will work.

ROS2 relies on macOS 10.12 so this introduces a (small) risk of build
failures over there.  To mitigate that, a pure Xcode 9 build is included
in the cron job.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 14:17:40 +01:00
Erik Boasson
3652fe6330 Update to Xcode 11.1 image on Travis CI
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 14:17:40 +01:00
Erik Boasson
389d6b1789 Remove repetitive debug print from "mpt_qosmatch"
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 14:17:40 +01:00
Erik Boasson
9e61bff9b9 Use unsigned char for XML input
Sign extension causes some character values to be interpreted as special
tokens, potentially causing the parser to hang, pass a null pointer as
element name to the "elem_open" callback (which would crash the
configuration processing).

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Erik Boasson
5883b96f6a Handle unterminated comment in XML parser (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Erik Boasson
d545551a60 Fix input buffer allocation in XML parser (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Erik Boasson
151159a5ea Clear sa_mask in sigaction for DDS_LC_FATAL test
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Erik Boasson
57ac8a457b Skip irrelevant buckets in hopscotch lookup (#270)
When scanning buckets while looking for a specific element, it is faster
to only inspect those buckets for which the corresponding bit in
"hopinfo" is set.  Sadly, simple scanning is faster than the far more
elegant perfect hash based on a De Bruijn sequence.

Add a simple test/performance measurement.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
eboasson
e53920031f
Merge pull request #251 from kurtuluso/authentication_plugin
Builtin authentication plugin for DDS Security
2019-10-30 12:20:16 +01:00
Kurtulus Oksuztepe
2c1d3010d0 Builtin authentication plugin for DDS Security
Builtin authentication plugin of DDS Security implementation was added.
This plugin is the first implementation and it also contains the functions that are used initially in the secure communication sequence.

The builtin authentication plugin implements authentication using a trusted Certificate Authority (CA). It performs mutual authentication between discovered participants using the RSA or ECDSA Digital Signature Algorithms and establishes a shared secret using Diffie-Hellman (DH) or Elliptic Curve Diffie-Hellman (ECDH) Key Agreement Methods.

DDS Security core component is introduced with this commit. DDSI and other builtin plugins will also use the security core.

Like all builtin plugins, dds security authentication plugin is a shared library for providing dynamic library loading on runtime. So that, dds participants can use different plugin implementations with different configurations.

Authentication plugin uses ddsrt functions. ddsrt is not expected to be a shared library and statically adding ddsrt objects to authentication library produces linkage errors in windows. So, dynamically linking authentication plugin to ddc library is decided. Another decision should be taken for the platforms that are not supporting dynamic libraries later.

Signed-off-by: Kurtulus Oksuztepe <kurtulus.oksuztepe@adlinktech.com>
2019-10-30 11:41:00 +01:00
Martin Bremmer
d0035cfdbd Protected discovery preparation.
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
2019-10-30 10:57:13 +01:00
Kurtulus Oksuztepe
aa3b95ee7f Merge branch 'master' into security
Signed-off-by: Kurtulus Oksuztepe <kurtulus.oksuztepe@adlinktech.com>

Conflicts:
	.travis.yml
2019-10-29 17:40:33 +01:00
dennis-adlink
7f59a46ff8 Add PropertyPolicy to QoS API for Security settings (#278)
* Add PropertyPolicy to QoS API for Security settings

This commit adds the public API for PropertyQosPolicy including
tests. This policy can be used to set the parameters for the DDS security
implementation, as an alternative for using the xml configuration.
Tests are also inlcuded for setting security properties and conflict
resolving when both security configuration and qos properties are present.
Finally, the pubsub tool is updated so that is handles this qos correctly.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Init binary_value.props to fix failing qos merge and moved init code in qset_prop functions

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Add additional test and some validation improvements based on review comments

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Refactoring of qos property

Refactored the qos property handling based on review comments. Setting
and unsettings functions are simplified and now use helper functions
for lookup, property initialisation is simplified. Added an additional
check for required security properties when creating participant using
security settings from qos, and added a test-case for this code.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Check for qos flag before getting property index from qos

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Participant creation should fail on inconsistent security qos properties, and some minor code improvements in property qos api functions

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Update log message in test security_config_qos

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Fixed unused label compiler error in q_entity.c when security is disabled

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Refactored qprop functions with macros to avoid code duplicate code

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2019-10-29 16:56:12 +01:00
Marcel Jordense
43ee3f87ca use ddsrt_malloc for allocating iov array
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2019-10-28 21:45:41 +01:00
dennis-adlink
c8aa6fee5a Moved bswap functions to ddsrt (#297)
* Moved bswap functions to ddsrt

Moved the byte swapping functions from ddsi to ddsrt so that
these can be re-used in e.g. the security plugins and tests.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Moved  decarations for bswap functions to ddsrt

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2019-10-28 15:03:46 +01:00
Dan Rose
76fa688086 CMAKE_SOURCE_DIR -> CMAKE_CURRENT_SOURCE_DIR
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-23 09:36:38 +02:00
Scott K Logan
860a6aadae Drop IDLC when building with colcon
This will eliminate two large dependencies when building CycloneDDS with
colcon for ROS 2, which doesn't appear to need the IDLC.

Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-10-22 22:37:40 +02:00
Scott K Logan
1cc6caff14 First check the CMake Package Registry for CUnit
This is useful when building CycloneDDS on platforms that provide CMake
configuration for CUnit outside of Conan.

If no configuration is found in the system CMake registry the module
continues as before.

Co-authored-by: Steven! Ragnarök <steven@nuclearsandwich.com>
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-10-22 22:33:10 +02:00
eboasson
5399e5103c
Merge pull request #279 from martinbremmer/merge4
Merge master into security
2019-10-22 20:31:12 +02:00