Commit graph

13 commits

Author SHA1 Message Date
Dennis Potman
edcbe1b22e Add a test that checks if all tokens and attributes are returned to the access control plugin
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
6185a5ab2a Add a test to validate that a non-secure participant can connect with a secure participant that allows unauthenticated participants. The non-secure pp should only be able to read data for a topic that is not secured
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
155f8c059d Add read-write protection tests
Introduced a test that checks for the correct matching behavious for  combinations
of the read/write access control settings in the governance xml (enable read/write
access control in the topic rules) and in the permissions xml (the publish/subscribe
grants for a topic).

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
45adb6f0c7 Extend access-control tests with validate_local_permissions
Add validate_local_permissions to the set of access control plugin
hooks tests, and add discovery_protection_enabled as an additional
parameter for the access control hook tests.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
0348bb2741 Security liveliness protection tests
Add testing liveness protection to the existing discovery protection
test. The test checks if the P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
is using the encode_decode_submessage function of the crypto plugin
to secure liveliness messages.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
231d820052 Add security encoding-mismatch test
A test that checks that the security handshake fails in case of non-matching
encoding settings in the governance xml. All combinations of values for
rtps, discovery and liveliness protection are checked. For meta-data and
payload encoding, this test checks that a reader and writer do not connect
in case of non-matching values.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
9f261423e3 Add tests for discovery protection
Adding a test that checks the effects of using different configuration settings
for discovery protection. This test set uses the cryptography wrapper to count
the number of invocations of the encode and decode functions during a session
and checks the counts with the expected values.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
19bc6f33cc Access control tests
Add test cases for the join_access_control governance setting and for
the access control plugin check_create_ and check_remote_ hooks,
using a wrapper plugin that simulates failure for each of these,
to test the DDSI integration with the access control plugin.
This commit also contains fixes for:
- an assert on DDS_RETCODE_OK in dds_create_reader and
dds_create_writer that cased the application to terminate in case
creation of a reader or writer is not allowed by security
- do not match a proxy reader that has the 'relay_only' set to
true, which is currently unsupported

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-22 17:41:27 +02:00
Dennis Potman
dae562c602 Improve delays/timing in permissions_expiry_multiple test
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
5e721c99e5 Change test timing and time-outs in access-control and authentication
expiry tests and add timestamps to test logging to get more stable
test results on Travis and enable analysing timeing issues.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
736d0a027a Add access control tests for permissions expiry and move some reused test
functions to common utils file.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
a6a9d1f7c1 Security core tests: new tests and refactoring
Refactoring security core tests and adding more tests:
- Dynamically generate ca and identity certificates in authentication tests, so that certificate expiry is tested.
Added writing/reading samples to these tests to ensure that nodes can (or cannot) communicate in a specific test case
- Secure communication tests: improved the validation of encryption in wrapper
- Added test for access control plugin settings
- Replaced the in-code test identities (and included ca private keys), added an additional identity

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
0a9d391c64 Fixed logging in find_own_ip
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-03-05 15:25:16 +01:00