Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve simple communication tests #342

Merged
merged 5 commits into from
Dec 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/fastrtps/rtps/messages/CDRMessage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ inline bool CDRMessage::readSequenceNumberSet(CDRMessage_t* msg,SequenceNumberSe
{
bool valid = true;
valid &=CDRMessage::readSequenceNumber(msg,&sns->base);
uint32_t numBits;
uint32_t numBits = 0;
valid &=CDRMessage::readUInt32(msg,&numBits);
int32_t bitmap;
SequenceNumber_t seqNum;
Expand All @@ -183,7 +183,7 @@ inline bool CDRMessage::readFragmentNumberSet(CDRMessage_t* msg, FragmentNumberS
{
bool valid = true;
valid &= CDRMessage::readUInt32(msg, &fns->base);
uint32_t numBits;
uint32_t numBits = 0;
valid &= CDRMessage::readUInt32(msg, &numBits);
int32_t bitmap;
FragmentNumber_t fragNum;
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/messages/RTPSMessageGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void get_participants_from_endpoints(const std::vector<GUID_t>& endpoints, std::
{
participants.clear();

for (auto& endpoint : endpoints)
for (const GUID_t& endpoint : endpoints)
{
if (std::find(participants.begin(), participants.end(), endpoint.guidPrefix) == participants.end())
participants.push_back(endpoint.guidPrefix);
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/BlackboxTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ BLACKBOXTEST(BlackBox, AsyncPubSubWithFlowController64kb)
slowWriter.send(data);
// In 1 second only one of the messages has time to arrive
std::this_thread::sleep_for(std::chrono::milliseconds(500));
ASSERT_EQ(reader.getReceivedCount(), 1);
ASSERT_EQ(reader.getReceivedCount(), 1u);
}

BLACKBOXTEST(BlackBox, AsyncPubSubAsReliableData300kbInLossyConditions)
Expand Down
1 change: 0 additions & 1 deletion test/certs/governance.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
openssl smime -sign -in governance.xml -text -out governance.smime -signer maincacert.pem -inkey maincakey.pem


openssl smime -sign -in permissions.xml -text -out permissions.smime -signer maincacert.pem -inkey maincakey.pem

72 changes: 72 additions & 0 deletions test/certs/governance_helloworld_all_enable.smime
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----164906A0CF14A77A8223B425D3824F71"

This is an S/MIME signed message

------164906A0CF14A77A8223B425D3824F71
Content-Type: text/plain

<?xml version="1.0" encoding="utf-8"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="omg_shared_ca_domain_governance.xsd">
<domain_access_rules>
<domain_rule>
<domains>
<id_range>
<min>0</min>
<max>230</max>
</id_range>
</domains>
<allow_unauthenticated_participants>false</allow_unauthenticated_participants>
<enable_join_access_control>true</enable_join_access_control>
<discovery_protection_kind>ENCRYPT</discovery_protection_kind>
<liveliness_protection_kind>ENCRYPT</liveliness_protection_kind>
<rtps_protection_kind>ENCRYPT</rtps_protection_kind>
<topic_access_rules>
<topic_rule>
<topic_expression>HelloWorldTopic_*</topic_expression>
<enable_discovery_protection>true</enable_discovery_protection>
<enable_liveliness_protection>true</enable_liveliness_protection>
<enable_read_access_control>true</enable_read_access_control>
<enable_write_access_control>true</enable_write_access_control>
<metadata_protection_kind>ENCRYPT</metadata_protection_kind>
<data_protection_kind>ENCRYPT</data_protection_kind>
</topic_rule>
</topic_access_rules>
</domain_rule>
</domain_access_rules>
</dds>


------164906A0CF14A77A8223B425D3824F71
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"

MIIEegYJKoZIhvcNAQcCoIIEazCCBGcCAQExDzANBglghkgBZQMEAgEFADALBgkq
hkiG9w0BBwGgggJAMIICPDCCAeOgAwIBAgIJALZwpgo2sxthMAoGCCqGSM49BAMC
MIGaMQswCQYDVQQGEwJFUzELMAkGA1UECAwCTUExFDASBgNVBAcMC1RyZXMgQ2Fu
dG9zMREwDwYDVQQKDAhlUHJvc2ltYTERMA8GA1UECwwIZVByb3NpbWExHjAcBgNV
BAMMFWVQcm9zaW1hIE1haW4gVGVzdCBDQTEiMCAGCSqGSIb3DQEJARYTbWFpbmNh
QGVwcm9zaW1hLmNvbTAeFw0xNzA5MDYwOTAzMDNaFw0yNzA5MDQwOTAzMDNaMIGa
MQswCQYDVQQGEwJFUzELMAkGA1UECAwCTUExFDASBgNVBAcMC1RyZXMgQ2FudG9z
MREwDwYDVQQKDAhlUHJvc2ltYTERMA8GA1UECwwIZVByb3NpbWExHjAcBgNVBAMM
FWVQcm9zaW1hIE1haW4gVGVzdCBDQTEiMCAGCSqGSIb3DQEJARYTbWFpbmNhQGVw
cm9zaW1hLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGLlhB3WQ8l1fpUE
3DfOoulA/de38Zfj7hmpKtOnxiH2q6RJbwhxvJeA7R7mkmAKaJKmzx695BjyiXVS
7bE7vgejEDAOMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDRwAwRAIgVTY1BEvT
4pw3GyBMzaUqmp69wi0kBkyOgq04OhyJ13UCICR125vvt0fUhXsXaxOAx28E4Ac9
SVxpI+3UYs2kV5n0MYIB/jCCAfoCAQEwgagwgZoxCzAJBgNVBAYTAkVTMQswCQYD
VQQIDAJNQTEUMBIGA1UEBwwLVHJlcyBDYW50b3MxETAPBgNVBAoMCGVQcm9zaW1h
MREwDwYDVQQLDAhlUHJvc2ltYTEeMBwGA1UEAwwVZVByb3NpbWEgTWFpbiBUZXN0
IENBMSIwIAYJKoZIhvcNAQkBFhNtYWluY2FAZXByb3NpbWEuY29tAgkAtnCmCjaz
G2EwDQYJYIZIAWUDBAIBBQCggeQwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
BgkqhkiG9w0BCQUxDxcNMTgxMTMwMTE1MzE3WjAvBgkqhkiG9w0BCQQxIgQgRfiH
rgLPG4v5NHu+eyK3h7RsS0DXzTQPCjgjiwI6N+YweQYJKoZIhvcNAQkPMWwwajAL
BglghkgBZQMEASowCwYJYIZIAWUDBAEWMAsGCWCGSAFlAwQBAjAKBggqhkiG9w0D
BzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYIKoZI
hvcNAwICASgwCgYIKoZIzj0EAwIESDBGAiEAzh8X2N5oodm27sbFCmV79kbVEv3e
+uDsXpEUEzCmZaMCIQDDCIUmQ4Z0t+LVOOdzRCo72pmnKDZhT2HsX8Hnk3D7aw==

------164906A0CF14A77A8223B425D3824F71--

31 changes: 31 additions & 0 deletions test/certs/governance_helloworld_all_enable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="omg_shared_ca_domain_governance.xsd">
<domain_access_rules>
<domain_rule>
<domains>
<id_range>
<min>0</min>
<max>230</max>
</id_range>
</domains>
<allow_unauthenticated_participants>false</allow_unauthenticated_participants>
<enable_join_access_control>true</enable_join_access_control>
<discovery_protection_kind>ENCRYPT</discovery_protection_kind>
<liveliness_protection_kind>ENCRYPT</liveliness_protection_kind>
<rtps_protection_kind>ENCRYPT</rtps_protection_kind>
<topic_access_rules>
<topic_rule>
<topic_expression>HelloWorldTopic_*</topic_expression>
<enable_discovery_protection>true</enable_discovery_protection>
<enable_liveliness_protection>true</enable_liveliness_protection>
<enable_read_access_control>true</enable_read_access_control>
<enable_write_access_control>true</enable_write_access_control>
<metadata_protection_kind>ENCRYPT</metadata_protection_kind>
<data_protection_kind>ENCRYPT</data_protection_kind>
</topic_rule>
</topic_access_rules>
</domain_rule>
</domain_access_rules>
</dds>

88 changes: 88 additions & 0 deletions test/certs/permissions_helloworld.smime
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----1F82A5302084D025100F3FD8FDAD15C3"

This is an S/MIME signed message

------1F82A5302084D025100F3FD8FDAD15C3
Content-Type: text/plain

<?xml version="1.0" encoding="utf-8"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.omg.org/spec/DDS-Security/20170801/omg_shared_ca_permissions.xsd">
<permissions>
<grant name="PublisherPermissions">
<subject_name>emailAddress=mainpub@eprosima.com, CN=Main Publisher, OU=eProsima, O=eProsima, ST=MA, C=ES</subject_name>
<validity>
<not_before>2013-06-01T13:00:00</not_before>
<not_after>2038-06-01T13:00:00</not_after>
</validity>
<allow_rule>
<domains>
<id_range>
<min>0</min>
<max>230</max>
</id_range>
</domains>
<publish>
<topics>
<topic>HelloWorldTopic_*</topic>
</topics>
</publish>
</allow_rule>
<default>DENY</default>
</grant>
<grant name="SubscriberPermissions">
<subject_name> emailAddress=mainsub@eprosima.com, CN=Main Subscriber, OU=eProsima, O=eProsima, ST=MA, C=ES</subject_name>
<validity>
<not_before>2013-06-01T13:00:00</not_before>
<not_after>2038-06-01T13:00:00</not_after>
</validity>
<allow_rule>
<domains>
<id_range>
<min>0</min>
<max>230</max>
</id_range>
</domains>
<subscribe>
<topics>
<topic>HelloWorldTopic_*</topic>
</topics>
</subscribe>
</allow_rule>
<default>DENY</default>
</grant>
</permissions>
</dds>

------1F82A5302084D025100F3FD8FDAD15C3
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transf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SIwIAYJKoZIhvcNAQkBFhNtYWluY2FAZXByb3NpbWEuY29tAgkAtnCmCjaz
G2EwDQYJYIZIAWUDBAIBBQCggeQwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
BgkqhkiG9w0BCQUxDxcNMTgxMTMwMTE1NzM0WjAvBgkqhkiG9w0BCQQxIgQg8Jau
J4cuVYqsY6gXCm3V1AubIShOsMGUP2ei1KmLiK4weQYJKoZIhvcNAQkPMWwwajAL
BglghkgBZQMEASowCwYJYIZIAWUDBAEWMAsGCWCGSAFlAwQBAjAKBggqhkiG9w0D
BzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYIKoZI
hvcNAwICASgwCgYIKoZIzj0EAwIERzBFAiBv3W4P/l1EOSHqzKaozvRFUL6E/K4I
CUOktT7YbkzWEQIhALKDGdtcwvwNUBkpUugccEQyaunDFc672Vcq3J1V8tek

------1F82A5302084D025100F3FD8FDAD15C3--

47 changes: 47 additions & 0 deletions test/certs/permissions_helloworld.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.omg.org/spec/DDS-Security/20170801/omg_shared_ca_permissions.xsd">
<permissions>
<grant name="PublisherPermissions">
<subject_name>emailAddress=mainpub@eprosima.com, CN=Main Publisher, OU=eProsima, O=eProsima, ST=MA, C=ES</subject_name>
<validity>
<not_before>2013-06-01T13:00:00</not_before>
<not_after>2038-06-01T13:00:00</not_after>
</validity>
<allow_rule>
<domains>
<id_range>
<min>0</min>
<max>230</max>
</id_range>
</domains>
<publish>
<topics>
<topic>HelloWorldTopic_*</topic>
</topics>
</publish>
</allow_rule>
<default>DENY</default>
</grant>
<grant name="SubscriberPermissions">
<subject_name> emailAddress=mainsub@eprosima.com, CN=Main Subscriber, OU=eProsima, O=eProsima, ST=MA, C=ES</subject_name>
<validity>
<not_before>2013-06-01T13:00:00</not_before>
<not_after>2038-06-01T13:00:00</not_after>
</validity>
<allow_rule>
<domains>
<id_range>
<min>0</min>
<max>230</max>
</id_range>
</domains>
<subscribe>
<topics>
<topic>HelloWorldTopic_*</topic>
</topics>
</subscribe>
</allow_rule>
<default>DENY</default>
</grant>
</permissions>
</dds>
Loading