Skip to content

Commit 563466f

Browse files
authored
Add Repeater + TCP docker compose tests (#272)
* Add Repeater + TCP docker compose tests Signed-off-by: RaulSanchez <raul@eprosima.com> * Fix domains and add test to ctest suite Signed-off-by: RaulSanchez <raul@eprosima.com> Signed-off-by: RaulSanchez <raul@eprosima.com>
1 parent d343373 commit 563466f

5 files changed

Lines changed: 155 additions & 0 deletions

File tree

ddsrouter_test/compose/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# Name of files to test
1616
set(TESTS
1717
repeater
18+
repeater_tcp
1819
tcp
1920
udp
2021
discovery_server
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Test description:
2+
# This test checks the TCP and repeater functionality by creating 3 routers, 2 edges and 1 cloud.
3+
# This test aims to simulate the scenario in which one DDS Router in the Cloud has a single network address exposed
4+
# and accessible for incoming connections. Thus all DDS Routers deployed on the edge, or in other networks, will use
5+
# this unique address as the connection address.
6+
#
7+
# Test architecture:
8+
#
9+
# ┌────────────────────────────────────────────────────────────────┐
10+
# │ cloud_edge_net │
11+
# │ │
12+
# │ ┌──────────────────┐ │
13+
# │ │ ddsrouter_cloud │ │
14+
# │ │ (wan [repeater]) │ │
15+
# │ └─▲──────────────▲─┘ │
16+
# │ │ │ │
17+
# │ ┌──────────────┘ └─────────┐ │
18+
# ┌──────┼───────────┼──────────────────┐ ┌───────────┼────────────┼──────┐
19+
# │ │ │ │ │ │ │ │
20+
# │ │ ┌─────────▼────────┐ │ │ ┌───────▼──────────┐ │ │
21+
# │ │ │ ddsrouter_edge_1 │ │ │ │ ddsrouter_edge_2 │ │ │
22+
# │ │ │ (local + wan) │ │ │ │ (local + wan) │ │ │
23+
# │ │ └───────┬────▲─────┘ │ │ └───────┬──────────┘ │ │
24+
# │ │ │ │ │ │ │ │ │
25+
# │ └─────────┼────┼───────────────┼────────┼───────────┼────────────┘ │
26+
# │ │ │ │ │ │ │
27+
# │ ┌─────────────▼┐ ┌┴───────────┐ │ │ ┌──────▼───────┐ │
28+
# │ │ sub_edge_1 │ │ pub_edge_1 │ │ │ │ sub_edge_2 │ │
29+
# │ │ (subscriber) │ │ (publisher)│ │ │ │ (subscriber) │ │
30+
# │ └──────────────┘ └────────────┘ │ │ └──────────────┘ │
31+
# │ │ │ │
32+
# │ edge_1_net (domain 1) │ │ edge_2_net (domain 2) │
33+
# └─────────────────────────────────────┘ └───────────────────────────────┘
34+
35+
services:
36+
37+
ddsrouter_cloud:
38+
image: ${DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE}
39+
container_name: ddsrouter_cloud
40+
networks:
41+
- cloud_edge_net
42+
volumes:
43+
- ./ddsrouter_cloud.yaml:/config.yaml
44+
command: ddsrouter -c /config.yaml --timeout 10
45+
46+
ddsrouter_edge_1:
47+
image: ${DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE}
48+
container_name: ddsrouter_edge_1
49+
depends_on:
50+
- ddsrouter_cloud
51+
networks:
52+
- cloud_edge_net
53+
- edge_1_net
54+
volumes:
55+
- ./ddsrouter_edge_1.yaml:/config.yaml
56+
command: ddsrouter -c /config.yaml --timeout 10
57+
58+
pub_edge_1:
59+
image: ${DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE}
60+
container_name: pub_edge_1
61+
depends_on:
62+
- ddsrouter_edge_1
63+
networks:
64+
- edge_1_net
65+
command: install/BasicConfigurationExample/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationExample publisher -i 250 -s 30 -d 1
66+
67+
sub_edge_1:
68+
image: ${DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE}
69+
container_name: sub_edge_1
70+
depends_on:
71+
- ddsrouter_edge_1
72+
networks:
73+
- edge_1_net
74+
volumes:
75+
- ../execute_and_validate_subscriber.py:/execute_and_validate_subscriber.py
76+
command: python3 /execute_and_validate_subscriber.py --exe install/BasicConfigurationExample/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationExample --samples 10 --timeout 10 --domain 1
77+
78+
ddsrouter_edge_2:
79+
image: ${DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE}
80+
container_name: ddsrouter_edge_2
81+
depends_on:
82+
- ddsrouter_cloud
83+
networks:
84+
- cloud_edge_net
85+
- edge_2_net
86+
volumes:
87+
- ./ddsrouter_edge_2.yaml:/config.yaml
88+
command: ddsrouter -c /config.yaml --timeout 10
89+
90+
sub_edge_2:
91+
image: ${DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE}
92+
container_name: sub_edge_2
93+
depends_on:
94+
- ddsrouter_edge_2
95+
networks:
96+
- edge_2_net
97+
volumes:
98+
- ../execute_and_validate_subscriber.py:/execute_and_validate_subscriber.py
99+
command: python3 /execute_and_validate_subscriber.py --exe install/BasicConfigurationExample/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationExample --samples 10 --timeout 10 --domain 2
100+
101+
networks:
102+
edge_1_net:
103+
edge_2_net:
104+
cloud_edge_net:
105+
default:
106+
driver: none
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: v3.0
2+
3+
participants:
4+
5+
- name: EchoParticipant
6+
kind: echo
7+
8+
- name: Cloud_Participant_1
9+
kind: wan
10+
repeater: true
11+
listening-addresses:
12+
- domain: ddsrouter_cloud
13+
port: 11666
14+
transport: tcp
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: v3.0
2+
3+
participants:
4+
5+
- name: EchoParticipant
6+
kind: echo
7+
8+
- name: Simple_Participant
9+
kind: local
10+
domain: 1
11+
12+
- name: Edge_1_Participant
13+
kind: wan
14+
connection-addresses:
15+
- domain: ddsrouter_cloud
16+
port: 11666
17+
transport: tcp
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: v3.0
2+
3+
participants:
4+
5+
- name: EchoParticipant
6+
kind: echo
7+
8+
- name: Simple_Participant
9+
kind: local
10+
domain: 2
11+
12+
- name: Edge_2_Participant
13+
kind: wan
14+
connection-addresses:
15+
- domain: ddsrouter_cloud
16+
port: 11666
17+
transport: tcp

0 commit comments

Comments
 (0)