Skip to content

Commit 3bd6c27

Browse files
committed
Refs #20629: Add GUIDLess tests
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
1 parent fa83982 commit 3bd6c27

9 files changed

Lines changed: 651 additions & 1 deletion

src/DiscoveryServerManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,7 @@ void DiscoveryServerManager::MapServerInfo(
15691569

15701570
if (prefix == c_GuidPrefix_Unknown)
15711571
{
1572-
LOG_ERROR("Servers cannot have a framework provided prefix"); // at least for now
1572+
LOG_INFO("Guidless server, locators must be set directly from the XML");
15731573
return;
15741574
}
15751575

test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ list(APPEND TEST_LIST
9494
test_44_fast_discovery_server_tool_reconnect
9595
test_45_trivial_client_reconnect
9696

97+
test_46_guidless_discovery
98+
test_47_guidless_server_double_ping
99+
test_48_guidless_complex
100+
97101
test_60_disconnection
98102
test_61_superclient_environment_variable
99103

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">
3+
4+
<simples>
5+
<simple name="client1" profile_name="UDP_client1_server1">
6+
<subscriber topic="topic1" />
7+
</simple>
8+
<simple name="client2" profile_name="UDP_client2_server1">
9+
<publisher topic="topic1"/>
10+
</simple>
11+
</simples>
12+
13+
<snapshots file="./test_46_guidless_discovery.snapshot~">
14+
<snapshot time="6">Know each other and server</snapshot>
15+
</snapshots>
16+
17+
<profiles>
18+
<participant profile_name="UDP_client1_server1"> </participant>
19+
<participant profile_name="UDP_client2_server1"> </participant>
20+
21+
<topic profile_name="topic1">
22+
<name>topic_1</name>
23+
<dataType>HelloWorld</dataType>
24+
</topic>
25+
26+
</profiles>
27+
</DS>
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">
3+
4+
<servers>
5+
<server name="server1" profile_name="UDP_server1"/>
6+
<server name="server2" profile_name="UDP_server2"/>
7+
<server name="server3" profile_name="UDP_server3"/>
8+
</servers>
9+
10+
<clients>
11+
<client name="client1_server1" profile_name="UDP_client1_server1">
12+
<publisher topic="topic1"/>
13+
</client>
14+
<client name="client1_server2" profile_name="UDP_client1_server2">
15+
<subscriber topic="topic1"/>
16+
</client>
17+
</clients>
18+
19+
<snapshots file="./test_47_guidless_server_double_ping.snapshot~">
20+
<snapshot time="6">test_47_guidless_server_double_ping_snapshot_1</snapshot>
21+
</snapshots>
22+
23+
<profiles>
24+
<participant profile_name="UDP_client1_server1" >
25+
<rtps>
26+
<builtin>
27+
<discovery_config>
28+
<discoveryProtocol>CLIENT</discoveryProtocol>
29+
<discoveryServersList>
30+
<locator>
31+
<udpv4>
32+
<address>127.0.0.1</address>
33+
<port>47811</port>
34+
</udpv4>
35+
</locator>
36+
</discoveryServersList>
37+
<initialAnnouncements>
38+
<count>0</count>
39+
</initialAnnouncements>
40+
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
41+
<leaseDuration>DURATION_INFINITY</leaseDuration>
42+
</discovery_config>
43+
</builtin>
44+
</rtps>
45+
</participant>
46+
47+
<participant profile_name="UDP_client1_server2" >
48+
<rtps>
49+
<builtin>
50+
<discovery_config>
51+
<discoveryProtocol>CLIENT</discoveryProtocol>
52+
<discoveryServersList>
53+
<locator>
54+
<udpv4>
55+
<address>127.0.0.1</address>
56+
<port>47812</port>
57+
</udpv4>
58+
</locator>
59+
</discoveryServersList>
60+
<initialAnnouncements>
61+
<count>0</count>
62+
</initialAnnouncements>
63+
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
64+
<leaseDuration>DURATION_INFINITY</leaseDuration>
65+
</discovery_config>
66+
</builtin>
67+
</rtps>
68+
</participant>
69+
70+
<participant profile_name="UDP_server1">
71+
<rtps>
72+
<builtin>
73+
<discovery_config>
74+
<discoveryProtocol>SERVER</discoveryProtocol>
75+
<initialAnnouncements>
76+
<count>5</count>
77+
</initialAnnouncements>
78+
<leaseAnnouncement>
79+
<nanosec>500000000</nanosec>
80+
</leaseAnnouncement>
81+
<leaseDuration>DURATION_INFINITY</leaseDuration>
82+
</discovery_config>
83+
<metatrafficUnicastLocatorList>
84+
<locator>
85+
<udpv4>
86+
<address>127.0.0.1</address>
87+
<port>47811</port>
88+
</udpv4>
89+
</locator>
90+
</metatrafficUnicastLocatorList>
91+
</builtin>
92+
</rtps>
93+
</participant>
94+
95+
<participant profile_name="UDP_server2">
96+
<rtps>
97+
<builtin>
98+
<discovery_config>
99+
<discoveryProtocol>SERVER</discoveryProtocol>
100+
<initialAnnouncements>
101+
<count>5</count>
102+
</initialAnnouncements>
103+
<leaseAnnouncement>
104+
<nanosec>500000000</nanosec>
105+
</leaseAnnouncement>
106+
<leaseDuration>DURATION_INFINITY</leaseDuration>
107+
</discovery_config>
108+
<metatrafficUnicastLocatorList>
109+
<locator>
110+
<udpv4>
111+
<address>127.0.0.1</address>
112+
<port>47812</port>
113+
</udpv4>
114+
</locator>
115+
</metatrafficUnicastLocatorList>
116+
</builtin>
117+
</rtps>
118+
</participant>
119+
120+
<participant profile_name="UDP_server3">
121+
<rtps>
122+
<builtin>
123+
<discovery_config>
124+
<discoveryServersList>
125+
<locator>
126+
<udpv4>
127+
<address>127.0.0.1</address>
128+
<port>47811</port>
129+
</udpv4>
130+
</locator>
131+
<locator>
132+
<udpv4>
133+
<address>127.0.0.1</address>
134+
<port>47812</port>
135+
</udpv4>
136+
</locator>
137+
</discoveryServersList>
138+
<discoveryProtocol>SERVER</discoveryProtocol>
139+
<initialAnnouncements>
140+
<count>5</count>
141+
</initialAnnouncements>
142+
<leaseAnnouncement>
143+
<nanosec>500000000</nanosec>
144+
</leaseAnnouncement>
145+
<leaseDuration>DURATION_INFINITY</leaseDuration>
146+
</discovery_config>
147+
<metatrafficUnicastLocatorList>
148+
<locator>
149+
<udpv4>
150+
<address>127.0.0.1</address>
151+
<port>47813</port>
152+
</udpv4>
153+
</locator>
154+
</metatrafficUnicastLocatorList>
155+
</builtin>
156+
</rtps>
157+
</participant>
158+
159+
<topic profile_name="topic1">
160+
<name>topic_1</name>
161+
<dataType>HelloWorld</dataType>
162+
</topic>
163+
164+
</profiles>
165+
</DS>
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">
3+
4+
<!-- S1 and S2 are created with fastdds tool and connected with env_var.
5+
Server 3 must know both servers and clients must know their matching
6+
participants:
7+
S1: S2 & S3 & C1 & C2 & C3
8+
C1: C2
9+
C2: C1 & C3
10+
C3: C2 -->
11+
12+
<servers>
13+
<server name="server3" profile_name="UDP_server3"/>
14+
</servers>
15+
16+
<clients>
17+
<client name="client1_server1" profile_name="UDP_client1_server1">
18+
<publisher topic="topic1"/>
19+
</client>
20+
<client name="client1_server2" profile_name="UDP_client1_server2">
21+
<subscriber topic="topic1"/>
22+
<publisher topic="topic2"/>
23+
</client>
24+
<client name="client1_server3" profile_name="UDP_client1_server3">
25+
<publisher topic="topic1"/>
26+
<subscriber topic="topic2"/>
27+
</client>
28+
</clients>
29+
30+
<snapshots file="./test_48_guidless_complex.snapshot~">
31+
<snapshot time="6">test_48_guidless_complex_snapshot_1</snapshot>
32+
</snapshots>
33+
34+
<profiles>
35+
<participant profile_name="UDP_client1_server1" >
36+
<rtps>
37+
<builtin>
38+
<discovery_config>
39+
<discoveryProtocol>CLIENT</discoveryProtocol>
40+
<discoveryServersList>
41+
<locator>
42+
<udpv4>
43+
<address>127.0.0.1</address>
44+
<port>48811</port>
45+
</udpv4>
46+
</locator>
47+
</discoveryServersList>
48+
<initialAnnouncements>
49+
<count>0</count>
50+
</initialAnnouncements>
51+
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
52+
<leaseDuration>DURATION_INFINITY</leaseDuration>
53+
</discovery_config>
54+
</builtin>
55+
</rtps>
56+
</participant>
57+
58+
<participant profile_name="UDP_client1_server2" >
59+
<rtps>
60+
<builtin>
61+
<discovery_config>
62+
<discoveryProtocol>CLIENT</discoveryProtocol>
63+
<discoveryServersList>
64+
<locator>
65+
<udpv4>
66+
<address>127.0.0.1</address>
67+
<port>48812</port>
68+
</udpv4>
69+
</locator>
70+
</discoveryServersList>
71+
<initialAnnouncements>
72+
<count>0</count>
73+
</initialAnnouncements>
74+
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
75+
<leaseDuration>DURATION_INFINITY</leaseDuration>
76+
</discovery_config>
77+
</builtin>
78+
</rtps>
79+
</participant>
80+
81+
<participant profile_name="UDP_client1_server3" >
82+
<rtps>
83+
<builtin>
84+
<discovery_config>
85+
<discoveryProtocol>CLIENT</discoveryProtocol>
86+
<discoveryServersList>
87+
<locator>
88+
<udpv4>
89+
<address>127.0.0.1</address>
90+
<port>48813</port>
91+
</udpv4>
92+
</locator>
93+
</discoveryServersList>
94+
<initialAnnouncements>
95+
<count>0</count>
96+
</initialAnnouncements>
97+
<leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
98+
<leaseDuration>DURATION_INFINITY</leaseDuration>
99+
</discovery_config>
100+
</builtin>
101+
</rtps>
102+
</participant>
103+
104+
<participant profile_name="UDP_server3">
105+
<rtps>
106+
<builtin>
107+
<discovery_config>
108+
<discoveryProtocol>SERVER</discoveryProtocol>
109+
<initialAnnouncements>
110+
<count>5</count>
111+
</initialAnnouncements>
112+
<leaseAnnouncement>
113+
<nanosec>500000000</nanosec>
114+
</leaseAnnouncement>
115+
<leaseDuration>DURATION_INFINITY</leaseDuration>
116+
</discovery_config>
117+
<metatrafficUnicastLocatorList>
118+
<locator>
119+
<udpv4>
120+
<address>127.0.0.1</address>
121+
<port>48813</port>
122+
</udpv4>
123+
</locator>
124+
</metatrafficUnicastLocatorList>
125+
</builtin>
126+
</rtps>
127+
</participant>
128+
129+
<topic profile_name="topic1">
130+
<name>topic_1</name>
131+
<dataType>HelloWorld</dataType>
132+
</topic>
133+
134+
<topic profile_name="topic2">
135+
<name>topic_2</name>
136+
<dataType>HelloWorld</dataType>
137+
</topic>
138+
139+
</profiles>
140+
</DS>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<DS_Snapshots xmlns="http://www.eprosima.com/XMLSchemas/ds-snapshot">
3+
<DS_Snapshot timestamp="1713777801549" process_time="6001" last_pdp_callback_time="472" last_edp_callback_time="923" someone="true">
4+
<description>Know each other and server</description>
5+
<ptdb guid_prefix="01.0f.f4.a0.70.ae.72.ff.00.00.00.00" guid_entity="0.0.1.c1">
6+
<ptdi guid_prefix="01.0f.f4.a0.6d.ec.9c.84.fb.df.05.a3" guid_entity="0.0.1.c1" server="false" alive="true" name="eProsima Guidless Server" discovered_timestamp="113"/>
7+
<ptdi guid_prefix="01.0f.f4.a0.70.ae.72.ff.00.00.00.00" guid_entity="0.0.1.c1" server="false" alive="true" name="" discovered_timestamp="14">
8+
<subscriber type="HelloWorld" topic="topic_1" guid_prefix="01.0f.f4.a0.70.ae.72.ff.00.00.00.00" guid_entity="0.0.1.4" discovered_timestamp="14"/>
9+
</ptdi>
10+
<ptdi guid_prefix="01.0f.f4.a0.70.ae.72.ff.01.00.00.00" guid_entity="0.0.1.c1" server="false" alive="true" name="client2" discovered_timestamp="472">
11+
<publisher type="HelloWorld" topic="topic_1" guid_prefix="01.0f.f4.a0.70.ae.72.ff.01.00.00.00" guid_entity="0.0.1.3" discovered_timestamp="923"/>
12+
</ptdi>
13+
</ptdb>
14+
<ptdb guid_prefix="01.0f.f4.a0.70.ae.72.ff.01.00.00.00" guid_entity="0.0.1.c1">
15+
<ptdi guid_prefix="01.0f.f4.a0.6d.ec.9c.84.fb.df.05.a3" guid_entity="0.0.1.c1" server="false" alive="true" name="eProsima Guidless Server" discovered_timestamp="118"/>
16+
<ptdi guid_prefix="01.0f.f4.a0.70.ae.72.ff.00.00.00.00" guid_entity="0.0.1.c1" server="false" alive="true" name="client1" discovered_timestamp="471">
17+
<subscriber type="HelloWorld" topic="topic_1" guid_prefix="01.0f.f4.a0.70.ae.72.ff.00.00.00.00" guid_entity="0.0.1.4" discovered_timestamp="923"/>
18+
</ptdi>
19+
<ptdi guid_prefix="01.0f.f4.a0.70.ae.72.ff.01.00.00.00" guid_entity="0.0.1.c1" server="false" alive="true" name="" discovered_timestamp="17">
20+
<publisher type="HelloWorld" topic="topic_1" guid_prefix="01.0f.f4.a0.70.ae.72.ff.01.00.00.00" guid_entity="0.0.1.3" discovered_timestamp="17"/>
21+
</ptdi>
22+
</ptdb>
23+
</DS_Snapshot>
24+
</DS_Snapshots>

0 commit comments

Comments
 (0)