1 // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
2 // This Source Code Form is subject to the terms of the Mozilla Public
3 // License, v. 2.0. If a copy of the MPL was not distributed with this
4 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
6 #include <cstdlib>
7 #include <iostream>
8
9 #include <gtest/gtest.h>
10
11 #include <vsomeip/constants.hpp>
12 #include <vsomeip/plugins/application_plugin.hpp>
13 #include <vsomeip/internal/logger.hpp>
14 #include "../implementation/configuration/include/configuration.hpp"
15
16 #include "../../implementation/plugin/include/plugin_manager_impl.hpp"
17 #include "../../implementation/configuration/include/configuration_impl.hpp"
18 #include "../../implementation/configuration/include/configuration_plugin.hpp"
19 #include "../../implementation/security/include/security_impl.hpp"
20
21 namespace vsomeip = vsomeip_v3;
22
23 #define CONFIGURATION_FILE "configuration-test.json"
24 #define DEPRECATED_CONFIGURATION_FILE "configuration-test-deprecated.json"
25
26 #define EXPECTED_UNICAST_ADDRESS "10.0.2.15"
27
28 #define EXPECTED_HAS_CONSOLE true
29 #define EXPECTED_HAS_FILE true
30 #define EXPECTED_HAS_DLT false
31 #define EXPECTED_LOGLEVEL "debug"
32 #define EXPECTED_LOGFILE "/home/someip/another-file.log"
33
34 #define EXPECTED_ROUTING_MANAGER_HOST "my_application"
35
36 // Logging
37 #define EXPECTED_VERSION_LOGGING_ENABLED false
38 #define EXPECTED_VERSION_LOGGING_INTERVAL 15
39
40 // Application
41 #define EXPECTED_APPLICATION_MAX_DISPATCHERS 25
42 #define EXPECTED_APPLICATION_MAX_DISPATCH_TIME 1234
43 #define EXPECTED_APPLICATION_THREADS 12
44 #define EXPECTED_APPLICATION_REQUEST_DEBOUNCE_TIME 5000
45
46 // Services
47 #define EXPECTED_UNICAST_ADDRESS_1234_0022 EXPECTED_UNICAST_ADDRESS
48 #define EXPECTED_RELIABLE_PORT_1234_0022 30506
49 #define EXPECTED_UNRELIABLE_PORT_1234_0022 31000
50
51 #define EXPECTED_UNICAST_ADDRESS_1234_0023 EXPECTED_UNICAST_ADDRESS
52 #define EXPECTED_RELIABLE_PORT_1234_0023 30503
53 #define EXPECTED_UNRELIABLE_PORT_1234_0023 vsomeip::ILLEGAL_PORT
54
55 #define EXPECTED_UNICAST_ADDRESS_2277_0022 EXPECTED_UNICAST_ADDRESS
56 #define EXPECTED_RELIABLE_PORT_2277_0022 30505
57 #define EXPECTED_UNRELIABLE_PORT_2277_0022 31001
58
59 #define EXPECTED_UNICAST_ADDRESS_2266_0022 EXPECTED_UNICAST_ADDRESS
60 #define EXPECTED_RELIABLE_PORT_2266_0022 30505
61 #define EXPECTED_UNRELIABLE_PORT_2266_0022 30507
62
63 #define EXPECTED_UNICAST_ADDRESS_4466_0321 "10.0.2.23"
64 #define EXPECTED_RELIABLE_PORT_4466_0321 30506
65 #define EXPECTED_UNRELIABLE_PORT_4466_0321 30444
66
67 // Service Discovery
68 #define EXPECTED_SD_ENABLED true
69 #define EXPECTED_SD_PROTOCOL "udp"
70 #define EXPECTED_SD_MULTICAST "224.212.244.223"
71 #define EXPECTED_SD_PORT 30666
72
73 #define EXPECTED_INITIAL_DELAY_MIN 1234
74 #define EXPECTED_INITIAL_DELAY_MAX 2345
75 #define EXPECTED_REPETITIONS_BASE_DELAY 4242
76 #define EXPECTED_REPETITIONS_MAX 4
77 #define EXPECTED_TTL 13
78 #define EXPECTED_CYCLIC_OFFER_DELAY 2132
79 #define EXPECTED_REQUEST_RESPONSE_DELAY 1111
80
81 #define EXPECTED_DEPRECATED_INITIAL_DELAY_MIN 10
82 #define EXPECTED_DEPRECATED_INITIAL_DELAY_MAX 100
83 #define EXPECTED_DEPRECATED_REPETITIONS_BASE_DELAY 200
84 #define EXPECTED_DEPRECATED_REPETITIONS_MAX 7
85 #define EXPECTED_DEPRECATED_TTL 5
86 #define EXPECTED_DEPRECATED_REQUEST_RESPONSE_DELAY 2001
87
88 template<class T>
check(const T & _is,const T & _expected,const std::string & _test)89 ::testing::AssertionResult check(const T &_is, const T &_expected, const std::string &_test) {
90 if (_is == _expected) {
91 return ::testing::AssertionSuccess() << "Test \"" << _test << "\" succeeded.";
92 } else {
93 return ::testing::AssertionFailure() << "Test \"" << _test << "\" failed! ("
94 << _is << " != " << _expected << ")";
95 }
96 }
97
loglevel_to_string(vsomeip::logger::level_e & _level)98 std::string loglevel_to_string(vsomeip::logger::level_e &_level) {
99 switch (_level) {
100 case vsomeip::logger::level_e::LL_FATAL:
101 return "fatal";
102 case vsomeip::logger::level_e::LL_ERROR:
103 return "error";
104 case vsomeip::logger::level_e::LL_WARNING:
105 return "warning";
106 case vsomeip::logger::level_e::LL_INFO:
107 return "info";
108 case vsomeip::logger::level_e::LL_DEBUG:
109 return "debug";
110 case vsomeip::logger::level_e::LL_VERBOSE:
111 return "verbose";
112 default:
113 return "unknown";
114 }
115 }
116
check_file(const std::string & _config_file,const std::string & _expected_unicast_address,bool _expected_has_console,bool _expected_has_file,bool _expected_has_dlt,bool _expected_version_logging_enabled,uint32_t _expected_version_logging_interval,uint32_t _expected_application_max_dispatcher,uint32_t _expected_application_max_dispatch_time,uint32_t _expected_application_threads,uint32_t _expected_application_request_debounce_time,const std::string & _expected_logfile,const std::string & _expected_loglevel,const std::string & _expected_unicast_address_1234_0022,uint16_t _expected_reliable_port_1234_0022,uint16_t _expected_unreliable_port_1234_0022,const std::string & _expected_unicast_address_1234_0023,uint16_t _expected_reliable_port_1234_0023,uint16_t _expected_unreliable_port_1234_0023,const std::string & _expected_unicast_address_2277_0022,uint16_t _expected_reliable_port_2277_0022,uint16_t _expected_unreliable_port_2277_0022,const std::string & _expected_unicast_address_2266_0022,uint16_t _expected_reliable_port_2266_0022,uint16_t _expected_unreliable_port_2266_0022,const std::string & _expected_unicast_address_4466_0321,uint16_t _expected_reliable_port_4466_0321,uint16_t _expected_unreliable_port_4466_0321,bool _expected_enabled,const std::string & _expected_protocol,const std::string & _expected_multicast,uint16_t _expected_port,uint32_t _expected_initial_delay_min,uint32_t _expected_initial_delay_max,int32_t _expected_repetitions_base_delay,uint8_t _expected_repetitions_max,vsomeip::ttl_t _expected_ttl,vsomeip::ttl_t _expected_cyclic_offer_delay,vsomeip::ttl_t _expected_request_response_delay)117 void check_file(const std::string &_config_file,
118 const std::string &_expected_unicast_address,
119 bool _expected_has_console,
120 bool _expected_has_file,
121 bool _expected_has_dlt,
122 bool _expected_version_logging_enabled,
123 uint32_t _expected_version_logging_interval,
124 uint32_t _expected_application_max_dispatcher,
125 uint32_t _expected_application_max_dispatch_time,
126 uint32_t _expected_application_threads,
127 uint32_t _expected_application_request_debounce_time,
128 const std::string &_expected_logfile,
129 const std::string &_expected_loglevel,
130 const std::string &_expected_unicast_address_1234_0022,
131 uint16_t _expected_reliable_port_1234_0022,
132 uint16_t _expected_unreliable_port_1234_0022,
133 const std::string &_expected_unicast_address_1234_0023,
134 uint16_t _expected_reliable_port_1234_0023,
135 uint16_t _expected_unreliable_port_1234_0023,
136 const std::string &_expected_unicast_address_2277_0022,
137 uint16_t _expected_reliable_port_2277_0022,
138 uint16_t _expected_unreliable_port_2277_0022,
139 const std::string &_expected_unicast_address_2266_0022,
140 uint16_t _expected_reliable_port_2266_0022,
141 uint16_t _expected_unreliable_port_2266_0022,
142 const std::string &_expected_unicast_address_4466_0321,
143 uint16_t _expected_reliable_port_4466_0321,
144 uint16_t _expected_unreliable_port_4466_0321,
145 bool _expected_enabled,
146 const std::string &_expected_protocol,
147 const std::string &_expected_multicast,
148 uint16_t _expected_port,
149 uint32_t _expected_initial_delay_min,
150 uint32_t _expected_initial_delay_max,
151 int32_t _expected_repetitions_base_delay,
152 uint8_t _expected_repetitions_max,
153 vsomeip::ttl_t _expected_ttl,
154 vsomeip::ttl_t _expected_cyclic_offer_delay,
155 vsomeip::ttl_t _expected_request_response_delay) {
156
157
158 // 0. Set environment variable to config file and load it
159 #ifndef _WIN32
160 setenv("VSOMEIP_CONFIGURATION", _config_file.c_str(), 1);
161 #else
162 _putenv_s("VSOMEIP_CONFIGURATION", _config_file.c_str()
163 #endif
164
165 // 1. Create configuration object
166 std::shared_ptr<vsomeip::configuration> its_configuration;
167 auto its_plugin = vsomeip::plugin_manager_impl::get()->get_plugin(
168 vsomeip::plugin_type_e::CONFIGURATION_PLUGIN, VSOMEIP_CFG_LIBRARY);
169 if (its_plugin) {
170 auto its_configuration_plugin
171 = std::dynamic_pointer_cast<vsomeip::configuration_plugin>(its_plugin);
172 if (its_configuration_plugin)
173 its_configuration = its_configuration_plugin->get_configuration(EXPECTED_ROUTING_MANAGER_HOST);
174 }
175
176 // 2. Did we get a configuration object?
177 if (0 == its_configuration) {
178 ADD_FAILURE() << "No configuration object. "
179 "Either memory overflow or loading error detected!";
180 return;
181 }
182
183 vsomeip::cfg::configuration_impl its_copied_config(
184 static_cast<vsomeip::cfg::configuration_impl&>(*its_configuration));
185 vsomeip::cfg::configuration_impl* its_new_config =
186 new vsomeip::cfg::configuration_impl(its_copied_config);
187 delete its_new_config;
188
189 its_configuration->set_configuration_path("/my/test/path");
190
191 // 3. Check host address
192 boost::asio::ip::address its_host_unicast_address
193 = its_configuration->get_unicast_address();
194 EXPECT_TRUE(check<std::string>(its_host_unicast_address.to_string(),
195 _expected_unicast_address, "UNICAST ADDRESS"));
196 EXPECT_TRUE(its_configuration->is_v4());
197 EXPECT_FALSE(its_configuration->is_v6());
198
199 // check diagnosis prefix
200 EXPECT_NE(0x54, its_configuration->get_diagnosis_address());
201 EXPECT_EQ(0x55, its_configuration->get_diagnosis_address());
202 EXPECT_NE(0x56, its_configuration->get_diagnosis_address());
203
204 // 4. Check logging
205 bool has_console = its_configuration->has_console_log();
206 bool has_file = its_configuration->has_file_log();
207 bool has_dlt = its_configuration->has_dlt_log();
208 std::string logfile = its_configuration->get_logfile();
209 vsomeip::logger::level_e loglevel
210 = its_configuration->get_loglevel();
211 bool has_version_logging = its_configuration->log_version();
212 std::uint32_t version_logging_interval = its_configuration->get_log_version_interval();
213
214 EXPECT_TRUE(check<bool>(has_console, _expected_has_console, "HAS CONSOLE"));
215 EXPECT_TRUE(check<bool>(has_file, _expected_has_file, "HAS FILE"));
216 EXPECT_TRUE(check<bool>(has_dlt, _expected_has_dlt, "HAS DLT"));
217 EXPECT_TRUE(check<std::string>(logfile, _expected_logfile, "LOGFILE"));
218 EXPECT_TRUE(check<std::string>(loglevel_to_string(loglevel),
219 _expected_loglevel, "LOGLEVEL"));
220 EXPECT_TRUE(check<bool>(has_version_logging, _expected_version_logging_enabled,
221 "VERSION LOGGING"));
222 EXPECT_TRUE(check<uint32_t>(version_logging_interval,
223 _expected_version_logging_interval,
224 "VERSION LOGGING INTERVAL"));
225
226 // watchdog
227 EXPECT_TRUE(its_configuration->is_watchdog_enabled());
228 EXPECT_EQ(1234u, its_configuration->get_watchdog_timeout());
229 EXPECT_EQ(7u, its_configuration->get_allowed_missing_pongs());
230
231 // file permissions
232 EXPECT_EQ(0444u, its_configuration->get_permissions_shm());
233 EXPECT_EQ(0222u, its_configuration->get_permissions_uds());
234
235 // selective broadcasts
236 EXPECT_TRUE(its_configuration->supports_selective_broadcasts(
237 boost::asio::ip::address::from_string("160.160.160.160")));
238
239 // tracing
240 std::shared_ptr<vsomeip::cfg::trace> its_trace = its_configuration->get_trace();
241 EXPECT_TRUE(its_trace->is_enabled_);
242 EXPECT_TRUE(its_trace->is_sd_enabled_);
243 EXPECT_EQ(4u, its_trace->channels_.size());
244 EXPECT_TRUE(its_trace->filters_.size() == 2u || its_trace->filters_.size() == 4u);
245 for (const auto &c : its_trace->channels_) {
246 EXPECT_TRUE(c->name_ == std::string("testname") || c->name_ == std::string("testname2") ||
247 c->name_ == std::string("testname3") || c->name_ == std::string("testname4"));
248 if (c->name_ == std::string("testname")) {
249 EXPECT_EQ(std::string("testid"), c->id_);
250 } else if (c->name_ == std::string("testname2")) {
251 EXPECT_EQ(std::string("testid2"), c->id_);
252 } else if (c->name_ == std::string("testname3")) {
253 EXPECT_EQ(std::string("testid3"), c->id_);
254 } else if (c->name_ == std::string("testname4")) {
255 EXPECT_EQ(std::string("testid4"), c->id_);
256 }
257 }
258 for (const auto &f : its_trace->filters_) {
259 auto its_channel_name = f->channels_.front();
260 auto its_matches = f->matches_;
261 EXPECT_TRUE(its_channel_name == std::string("testname") || its_channel_name == std::string("testname2") ||
262 its_channel_name == std::string("testname3") || its_channel_name == std::string("testname4"));
263 if (its_channel_name == std::string("testname")) {
264 EXPECT_EQ(2u, its_matches.size());
265
266 for (const vsomeip::trace::match_t m : its_matches) {
267 EXPECT_TRUE(std::get<0>(m) == vsomeip::service_t(0x1111) ||
268 std::get<0>(m) == vsomeip::service_t(2222));
269 EXPECT_TRUE(std::get<1>(m) == vsomeip::instance_t(0xffff));
270 EXPECT_TRUE(std::get<2>(m) == vsomeip::method_t(0xffff));
271 EXPECT_TRUE(f->is_positive_);
272 EXPECT_FALSE(f->is_range_);
273 }
274 } else if (its_channel_name == std::string("testname2")) {
275 EXPECT_EQ(2u, its_matches.size());
276
277 for (const vsomeip::trace::match_t m : its_matches) {
278 EXPECT_TRUE(std::get<0>(m) == vsomeip::service_t(0x3333) ||
279 std::get<0>(m) == vsomeip::service_t(4444));
280 EXPECT_TRUE(std::get<1>(m) == vsomeip::instance_t(0xffff));
281 EXPECT_TRUE(std::get<2>(m) == vsomeip::method_t(0xffff));
282 EXPECT_FALSE(f->is_positive_);
283 EXPECT_FALSE(f->is_range_);
284 }
285 } else if (its_channel_name == std::string("testname3")) {
286 EXPECT_EQ(2u, its_matches.size());
287
288 for (const vsomeip::trace::match_t m : its_matches) {
289 EXPECT_TRUE(std::get<0>(m) == vsomeip::service_t(0x1111) ||
290 std::get<0>(m) == vsomeip::service_t(0x3333));
291 EXPECT_TRUE(std::get<1>(m) == vsomeip::instance_t(0xffff));
292 EXPECT_TRUE(std::get<2>(m) == vsomeip::method_t(0xffff) ||
293 std::get<2>(m) == vsomeip::method_t(0x8888));
294 EXPECT_FALSE(f->is_positive_);
295 EXPECT_FALSE(f->is_range_);
296 }
297 } else if (its_channel_name == std::string("testname4")) {
298 EXPECT_EQ(2u, its_matches.size());
299
300 for (const vsomeip::trace::match_t m : its_matches) {
301 EXPECT_TRUE(std::get<0>(m) == vsomeip::service_t(0x1111) ||
302 std::get<0>(m) == vsomeip::service_t(0x3333));
303 EXPECT_TRUE(std::get<1>(m) == vsomeip::instance_t(0x0001));
304 EXPECT_TRUE(std::get<2>(m) == vsomeip::method_t(0xffff) ||
305 std::get<2>(m) == vsomeip::method_t(0x8888));
306 EXPECT_FALSE(f->is_positive_);
307 EXPECT_TRUE(f->is_range_);
308 }
309 }
310 }
311
312 // Applications
313 std::size_t max_dispatchers = its_configuration->get_max_dispatchers(
314 EXPECTED_ROUTING_MANAGER_HOST);
315 std::size_t max_dispatch_time = its_configuration->get_max_dispatch_time(
316 EXPECTED_ROUTING_MANAGER_HOST);
317 std::size_t io_threads = its_configuration->get_io_thread_count(
318 EXPECTED_ROUTING_MANAGER_HOST);
319 std::size_t request_time = its_configuration->get_request_debouncing(
320 EXPECTED_ROUTING_MANAGER_HOST);
321
322 EXPECT_TRUE(check<std::size_t>(max_dispatchers,
323 _expected_application_max_dispatcher, "MAX DISPATCHERS"));
324 EXPECT_TRUE(check<std::size_t>(max_dispatch_time,
325 _expected_application_max_dispatch_time, "MAX DISPATCH TIME"));
326 EXPECT_TRUE(check<std::size_t>(io_threads, _expected_application_threads,
327 "IO THREADS"));
328 EXPECT_TRUE(check<std::size_t>(request_time,
329 _expected_application_request_debounce_time, "REQUEST DEBOUNCE TIME"));
330
331 EXPECT_EQ(0x9933, its_configuration->get_id("other_application"));
332
333 std::map<vsomeip::plugin_type_e, std::set<std::string>> its_plugins =
334 its_configuration->get_plugins(EXPECTED_ROUTING_MANAGER_HOST);
335 EXPECT_EQ(1u, its_plugins.size());
336 for (const auto& plugin : its_plugins) {
337 EXPECT_EQ(vsomeip::plugin_type_e::APPLICATION_PLUGIN, plugin.first);
338 for (const auto& its_library : plugin.second)
339 EXPECT_EQ(std::string("libtestlibraryname.so." + std::to_string(VSOMEIP_APPLICATION_PLUGIN_VERSION)), its_library);
340 }
341 EXPECT_EQ(vsomeip::plugin_type_e::CONFIGURATION_PLUGIN, its_plugin->get_plugin_type());
342 EXPECT_EQ("vsomeip-configuration-plugin", its_plugin->get_plugin_name());
343 EXPECT_EQ(1u, its_plugin->get_plugin_version());
344
345
346 // 5. Services
347 std::string its_unicast_address
348 = its_configuration->get_unicast_address(0x1234, 0x0022);
349 uint16_t its_reliable_port
350 = its_configuration->get_reliable_port(0x1234, 0x0022);
351 uint16_t its_unreliable_port
352 = its_configuration->get_unreliable_port(0x1234, 0x0022);
353
354 EXPECT_TRUE(check<std::string>(its_unicast_address,
355 _expected_unicast_address_1234_0022,
356 "UNICAST_ADDRESS_1234_0022"));
357 EXPECT_TRUE(check<uint16_t>(its_reliable_port,
358 _expected_reliable_port_1234_0022,
359 "RELIABLE_PORT_1234_0022"));
360 EXPECT_TRUE(check<uint16_t>(its_unreliable_port,
361 _expected_unreliable_port_1234_0022,
362 "UNRELIABLE_PORT_1234_0022"));
363
364 its_unicast_address
365 = its_configuration->get_unicast_address(0x1234, 0x0023);
366 its_reliable_port
367 = its_configuration->get_reliable_port(0x1234, 0x0023);
368 its_unreliable_port
369 = its_configuration->get_unreliable_port(0x1234, 0x0023);
370
371 EXPECT_TRUE(check<std::string>(its_unicast_address,
372 _expected_unicast_address_1234_0023,
373 "UNICAST_ADDRESS_1234_0023"));
374 EXPECT_TRUE(check<uint16_t>(its_reliable_port,
375 _expected_reliable_port_1234_0023,
376 "RELIABLE_PORT_1234_0023"));
377 EXPECT_TRUE(check<uint16_t>(its_unreliable_port,
378 _expected_unreliable_port_1234_0023,
379 "UNRELIABLE_PORT_1234_0023"));
380
381 its_unicast_address
382 = its_configuration->get_unicast_address(0x2277, 0x0022);
383 its_reliable_port
384 = its_configuration->get_reliable_port(0x2277, 0x0022);
385 its_unreliable_port
386 = its_configuration->get_unreliable_port(0x2277, 0x0022);
387
388 EXPECT_TRUE(check<std::string>(its_unicast_address,
389 _expected_unicast_address_2277_0022,
390 "UNICAST_ADDRESS_2277_0022"));
391 EXPECT_TRUE(check<uint16_t>(its_reliable_port,
392 _expected_reliable_port_2277_0022,
393 "RELIABLE_PORT_2277_0022"));
394 EXPECT_TRUE(check<uint16_t>(its_unreliable_port,
395 _expected_unreliable_port_2277_0022,
396 "UNRELIABLE_PORT_2277_0022"));
397
398 its_unicast_address
399 = its_configuration->get_unicast_address(0x2266, 0x0022);
400 its_reliable_port
401 = its_configuration->get_reliable_port(0x2266, 0x0022);
402 its_unreliable_port
403 = its_configuration->get_unreliable_port(0x2266, 0x0022);
404
405 EXPECT_TRUE(check<std::string>(its_unicast_address,
406 _expected_unicast_address_2266_0022,
407 "UNICAST_ADDRESS_2266_0022"));
408 EXPECT_TRUE(check<uint16_t>(its_reliable_port,
409 _expected_reliable_port_2266_0022,
410 "RELIABLE_PORT_2266_0022"));
411 EXPECT_TRUE(check<uint16_t>(its_unreliable_port,
412 _expected_unreliable_port_2266_0022,
413 "UNRELIABLE_PORT_2266_0022"));
414
415 its_unicast_address
416 = its_configuration->get_unicast_address(0x4466, 0x0321);
417 its_reliable_port
418 = its_configuration->get_reliable_port(0x4466, 0x0321);
419 its_unreliable_port
420 = its_configuration->get_unreliable_port(0x4466, 0x0321);
421
422 EXPECT_TRUE(check<std::string>(its_unicast_address,
423 _expected_unicast_address_4466_0321,
424 "UNICAST_ADDRESS_4466_0321"));
425 EXPECT_TRUE(check<uint16_t>(its_reliable_port,
426 _expected_reliable_port_4466_0321,
427 "RELIABLE_PORT_4466_0321"));
428 EXPECT_TRUE(check<uint16_t>(its_unreliable_port,
429 _expected_unreliable_port_4466_0321,
430 "UNRELIABLE_PORT_4466_0321"));
431
432 std::string its_multicast_address;
433 std::uint16_t its_multicast_port;
434 its_configuration->get_multicast(0x7809, 0x1, 0x1111,
435 its_multicast_address, its_multicast_port);
436 EXPECT_EQ(1234u, its_multicast_port);
437 EXPECT_EQ(std::string("224.212.244.225"), its_multicast_address);
438 EXPECT_EQ(8u, its_configuration->get_threshold(0x7809, 0x1, 0x1111));
439
440 EXPECT_TRUE(its_configuration->is_offered_remote(0x1234,0x0022));
441 EXPECT_FALSE(its_configuration->is_offered_remote(0x3333,0x1));
442
443 EXPECT_TRUE(its_configuration->has_enabled_magic_cookies("10.0.2.15", 30506));
444 EXPECT_FALSE(its_configuration->has_enabled_magic_cookies("10.0.2.15", 30503));
445
446 std::set<std::pair<vsomeip::service_t, vsomeip::instance_t>> its_remote_services =
447 its_configuration->get_remote_services();
448 EXPECT_EQ(1u, its_remote_services.size());
449 for (const auto &p : its_remote_services) {
450 EXPECT_EQ(0x4466, p.first);
451 EXPECT_EQ(0x321, p.second);
452 }
453
454 EXPECT_TRUE(its_configuration->is_someip(0x3333,0x1));
455 EXPECT_FALSE(its_configuration->is_someip(0x3555,0x1));
456
457 // Internal services
458 EXPECT_TRUE(its_configuration->is_local_service(0x1234, 0x0022));
459 EXPECT_TRUE(its_configuration->is_local_service(0x3333,0x1));
460 // defined range, service level only
461 EXPECT_FALSE(its_configuration->is_local_service(0xF0FF,0x1));
462 EXPECT_TRUE(its_configuration->is_local_service(0xF100,0x1));
463 EXPECT_TRUE(its_configuration->is_local_service(0xF101,0x23));
464 EXPECT_TRUE(its_configuration->is_local_service(0xF109,0xFFFF));
465 EXPECT_FALSE(its_configuration->is_local_service(0xF10a,0x1));
466 // defined range, service and instance level
467 EXPECT_FALSE(its_configuration->is_local_service(0xF2FF,0xFFFF));
468 EXPECT_TRUE(its_configuration->is_local_service(0xF300,0x1));
469 EXPECT_TRUE(its_configuration->is_local_service(0xF300,0x5));
470 EXPECT_TRUE(its_configuration->is_local_service(0xF300,0x10));
471 EXPECT_FALSE(its_configuration->is_local_service(0xF300,0x11));
472 EXPECT_FALSE(its_configuration->is_local_service(0xF301,0x11));
473
474 // clients
475 std::map<bool, std::set<uint16_t>> used_ports;
476 used_ports[true].insert(0x11);
477 used_ports[false].insert(0x10);
478 std::uint16_t port_to_use(0x0);
479 EXPECT_TRUE(its_configuration->get_client_port(0x8888, 0x1, vsomeip::ILLEGAL_PORT, true, used_ports, port_to_use));
480 EXPECT_EQ(0x10, port_to_use);
481 EXPECT_TRUE(its_configuration->get_client_port(0x8888, 0x1, vsomeip::ILLEGAL_PORT, false, used_ports, port_to_use));
482 EXPECT_EQ(0x11, port_to_use);
483
484 used_ports[true].insert(0x10);
485 used_ports[false].insert(0x11);
486 EXPECT_FALSE(its_configuration->get_client_port(0x8888, 0x1, vsomeip::ILLEGAL_PORT, true, used_ports, port_to_use));
487 EXPECT_EQ(vsomeip::ILLEGAL_PORT, port_to_use);
488 EXPECT_FALSE(its_configuration->get_client_port(0x8888, 0x1, vsomeip::ILLEGAL_PORT, false, used_ports, port_to_use));
489 EXPECT_EQ(vsomeip::ILLEGAL_PORT, port_to_use);
490
491
492 //check for correct client port assignment if service / instance was not configured but a remote port range
493 used_ports.clear();
494 EXPECT_TRUE(its_configuration->get_client_port(0x8888, 0x12, 0x7725, true, used_ports, port_to_use));
495 EXPECT_EQ(0x771B, port_to_use);
496 used_ports[true].insert(0x771B);
497 EXPECT_TRUE(its_configuration->get_client_port(0x8888, 0x12, 0x7725, true, used_ports, port_to_use));
498 EXPECT_EQ(0x771C, port_to_use);
499 used_ports[true].insert(0x771C);
500 EXPECT_TRUE(its_configuration->get_client_port(0x8888, 0x12, 0x7B0D, true, used_ports, port_to_use));
501 EXPECT_EQ(0x7B03, port_to_use);
502 used_ports[true].insert(0x7B03);
503 EXPECT_TRUE(its_configuration->get_client_port(0x8888, 0x12, 0x7B0D, true, used_ports, port_to_use));
504 EXPECT_EQ(0x7B04, port_to_use);
505 used_ports[true].insert(0x7B04);
506 EXPECT_TRUE(its_configuration->get_client_port(0x8888, 0x12, 0x7EF4, true, used_ports, port_to_use));
507 EXPECT_EQ(0x7EEB, port_to_use);
508 used_ports[true].insert(0x7EEB);
509 EXPECT_TRUE(its_configuration->get_client_port(0x8888, 0x12, 0x7EF4, true, used_ports, port_to_use));
510 EXPECT_EQ(0x7EEC, port_to_use);
511 used_ports[true].insert(0x7EEC);
512 used_ports.clear();
513
514
515 // payload sizes
516 // use 17000 instead of 1500 as configured max-local-payload size will be
517 // increased to bigger max-reliable-payload-size
518 std::uint32_t max_local_message_size(
519 17000u + 16u + + VSOMEIP_SEND_COMMAND_SIZE);
520 EXPECT_EQ(max_local_message_size, its_configuration->get_max_message_size_local());
521 EXPECT_EQ(11u, its_configuration->get_buffer_shrink_threshold());
522 EXPECT_EQ(14999u + 16u, its_configuration->get_max_message_size_reliable("10.10.10.10", 7777));
523 EXPECT_EQ(17000u + 16, its_configuration->get_max_message_size_reliable("11.11.11.11", 4711));
524 EXPECT_EQ(15001u + 16, its_configuration->get_max_message_size_reliable("10.10.10.11", 7778));
525
526 // security
527 EXPECT_TRUE(its_configuration->check_routing_credentials(0x7788, 0x123, 0x456));
528
529 // GID does not match
530 EXPECT_FALSE(its_configuration->check_routing_credentials(0x7788, 0x123, 0x222));
531
532 // UID does not match
533 EXPECT_FALSE(its_configuration->check_routing_credentials(0x7788, 0x333, 0x456));
534
535 // client is not the routing manager
536 EXPECT_TRUE(its_configuration->check_routing_credentials(0x7777, 0x888, 0x999));
537
538 auto its_security = vsomeip::security_impl::get();
539 EXPECT_TRUE(its_security->is_enabled());
540 EXPECT_TRUE(its_security->is_offer_allowed(1000, 1000, 0x1277, 0x1234, 0x5678));
541 EXPECT_TRUE(its_security->is_offer_allowed(1000, 1000, 0x1277, 0x1235, 0x5678));
542 EXPECT_TRUE(its_security->is_offer_allowed(1000, 1000, 0x1277, 0x1236, 0x5678));
543 EXPECT_TRUE(its_security->is_offer_allowed(1000, 1000, 0x1277, 0x1236, 0x5676));
544
545 EXPECT_FALSE(its_security->is_offer_allowed(1000, 1000, 0x1277, 0x1236, 0x5679));
546 EXPECT_FALSE(its_security->is_offer_allowed(1000, 1000, 0x1277, 0x1234, 0x5679));
547 EXPECT_FALSE(its_security->is_offer_allowed(1000, 1000, 0x1277, 0x1233, 0x5679));
548 EXPECT_FALSE(its_security->is_offer_allowed(1001, 1001, 0x1266, 0x1233, 0x5679));
549 // explicitly denied offers
550 EXPECT_FALSE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1234, 0x5678));
551 EXPECT_FALSE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1235, 0x5678));
552 EXPECT_TRUE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1234, 0x5679));
553 EXPECT_TRUE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1300, 0x1));
554 EXPECT_TRUE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1300, 0x2));
555 EXPECT_FALSE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1236, 0x5678));
556 EXPECT_FALSE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1236, 0x5675));
557 EXPECT_FALSE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1236, 0x5676));
558 EXPECT_FALSE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1236, 0x5677));
559 EXPECT_TRUE(its_security->is_offer_allowed(4000, 4000, 0x1443, 0x1236, 0x5679));
560
561 // explicitly allowed requests of methods / events
562 EXPECT_TRUE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1234, 0x5678, 0x0001));
563 EXPECT_TRUE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1234, 0x5678, 0x8002));
564 EXPECT_TRUE(its_security->is_client_allowed(2000, 2000, 0x1346, 0x1234, 0x5688, 0x8002));
565 EXPECT_TRUE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1234, 0x5699, 0x8006));
566 EXPECT_TRUE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1234, 0x5699, 0x8001));
567
568 EXPECT_FALSE(its_security->is_client_allowed(2001, 2001, 0x1347, 0x1234, 0x5678, 0xFFFF));
569 EXPECT_FALSE(its_security->is_client_allowed(2001, 2001, 0x1342, 0x1234, 0x5678, 0xFFFF));
570 EXPECT_FALSE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1234, 0x5677, 0xFFFF));
571 EXPECT_FALSE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1234, 0x5700, 0x0001));
572 EXPECT_FALSE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1234, 0x5699, 0x8007));
573 EXPECT_FALSE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1234, 0x5700, 0xFFFF));
574 EXPECT_FALSE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1230, 0x5678, 0x0001));
575 EXPECT_FALSE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1230, 0x5678, 0xFFFF));
576 EXPECT_FALSE(its_security->is_client_allowed(4000, 4000, 0x1443, 0x1234, 0x5678, 0x0002));
577 EXPECT_FALSE(its_security->is_client_allowed(4000, 4000, 0x1446, 0x1234, 0x5678, 0xFFFF));
578 EXPECT_TRUE(its_security->is_client_allowed(4000, 4000, 0x1443, 0x1234, 0x5679, 0x0003));
579 EXPECT_FALSE(its_security->is_client_allowed(4000, 4000, 0x1443, 0x1234, 0x5679, 0xFFFF));
580 EXPECT_FALSE(its_security->is_client_allowed(4000, 4000, 0x1443, 0x1234, 0x5699, 0x9001));
581 EXPECT_FALSE(its_security->is_client_allowed(4000, 4000, 0x1443, 0x1234, 0x5699, 0x9006));
582 EXPECT_FALSE(its_security->is_client_allowed(4001, 4001, 0x1442, 0x1234, 0x5678, 0xFFFF));
583 EXPECT_FALSE(its_security->is_client_allowed(4001, 4001, 0x1447, 0x1234, 0x5678, 0xFFFF));
584
585 // check that any method ID is allowed
586 EXPECT_TRUE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1237, 0x5678, 0x0001));
587 EXPECT_TRUE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1237, 0x5678, 0xFFFF));
588
589 // check that any instance ID is allowed but only one method ID
590 EXPECT_TRUE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1238, 0x0004, 0x0001));
591 EXPECT_FALSE(its_security->is_client_allowed(2000, 2000, 0x1343, 0x1238, 0x0004, 0x0002));
592
593 // DENY NOTHING policy
594 // check that ANY_METHOD is allowed in a "deny nothing" policy
595 EXPECT_TRUE(its_security->is_client_allowed(5000, 5000, 0x1550, 0x1234, 0x5678, 0xFFFF));
596 // check that specific method ID is allowed in a "deny nothing" policy
597 EXPECT_TRUE(its_security->is_client_allowed(5000, 5000, 0x1550, 0x1234, 0x5678, 0x0001));
598
599 // ALLOW NOTHING policy
600 // check that ANY_METHOD is denied in a "allow nothing" policy
601 EXPECT_FALSE(its_security->is_client_allowed(6000, 6000, 0x1660, 0x1234, 0x5678, 0xFFFF));
602 // check that specific method ID is denied in a "allow nothing" policy
603 EXPECT_FALSE(its_security->is_client_allowed(6000, 6000, 0x1660, 0x1234, 0x5678, 0x0001));
604
605 // DENY only one service instance and ANY_METHOD (0x01 - 0xFFFF) policy
606 EXPECT_FALSE(its_security->is_client_allowed(7000, 7000, 0x1770, 0x1234, 0x5678, 0xFFFF));
607 EXPECT_FALSE(its_security->is_client_allowed(7000, 7000, 0x1770, 0x1234, 0x5678, 0x0001));
608
609 // allow only one service instance and ANY_METHOD policy
610 EXPECT_TRUE(its_security->is_client_allowed(8000, 8000, 0x1880, 0x1234, 0x5678, 0xFFFF));
611 EXPECT_TRUE(its_security->is_client_allowed(8000, 8000, 0x1880, 0x1234, 0x5678, 0x0001));
612
613 // check request service
614 EXPECT_TRUE(its_security->is_client_allowed(5000, 5000, 0x1550, 0x1234, 0x5678, 0x00, true));
615 EXPECT_FALSE(its_security->is_client_allowed(6000, 6000, 0x1660, 0x1234, 0x5678, 0x00, true));
616 EXPECT_FALSE(its_security->is_client_allowed(7000, 7000, 0x1770, 0x1234, 0x5678, 0x00, true));
617 EXPECT_TRUE(its_security->is_client_allowed(7000, 7000, 0x1770, 0x2222, 0x5678, 0x00, true));
618 EXPECT_TRUE(its_security->is_client_allowed(8000, 8000, 0x1880, 0x1234, 0x5678, 0x00, true));
619
620 EXPECT_TRUE(its_security->check_credentials(0x1277, 1000, 1000));
621 EXPECT_FALSE(its_security->check_credentials(0x1277, 1001, 1001));
622 EXPECT_TRUE(its_security->check_credentials(0x1278, 1000, 1000));
623 EXPECT_TRUE(its_security->check_credentials(0x1278, 9000, 9000));
624
625 // Security update / removal whitelist
626 EXPECT_TRUE(its_security->is_policy_removal_allowed(1000));
627 EXPECT_TRUE(its_security->is_policy_removal_allowed(1001));
628 EXPECT_TRUE(its_security->is_policy_removal_allowed(1008));
629 EXPECT_TRUE(its_security->is_policy_removal_allowed(2000));
630 EXPECT_TRUE(its_security->is_policy_removal_allowed(3000));
631
632 EXPECT_FALSE(its_security->is_policy_removal_allowed(2001));
633 EXPECT_FALSE(its_security->is_policy_removal_allowed(3001));
634
635 // create a valid policy object that is on whitelist and test is_policy_update_allowed method
636 std::shared_ptr<vsomeip::policy> _policy(std::make_shared<vsomeip::policy>());
637 uint32_t its_uid = 1000;
638 uint32_t its_gid = 1000;
639
640 // policy elements
641 boost::icl::discrete_interval<uid_t> its_uids(its_uid, its_uid);
642 boost::icl::interval_set<gid_t> its_gids;
643 its_gids.insert(boost::icl::interval<gid_t>::closed(its_gid, its_gid));
644
645 _policy->credentials_ += std::make_pair(its_uids, its_gids);
646 _policy->allow_who_ = true;
647 _policy->allow_what_ = true;
648
649 vsomeip::service_t its_service(0x1234);
650
651 boost::icl::discrete_interval<vsomeip::instance_t> its_instances(0x1, 0x2);
652 boost::icl::interval_set<vsomeip::method_t> its_methods;
653 its_methods.insert(boost::icl::interval<vsomeip::method_t>::closed(0x01, 0x2));
654 boost::icl::interval_map<vsomeip::instance_t,
655 boost::icl::interval_set<vsomeip::method_t> > its_instances_methods;
656 its_instances_methods += std::make_pair(its_instances, its_methods);
657
658 _policy->requests_ += std::make_pair(
659 boost::icl::discrete_interval<vsomeip::service_t>(
660 its_service, its_service,
661 boost::icl::interval_bounds::closed()),
662 its_instances_methods);
663 EXPECT_TRUE(its_security->is_policy_update_allowed(1000, _policy));
664
665 // test valid policy that holds a single service id which is whitelisted
666 vsomeip::service_t its_second_service(0x7800);
667 _policy->requests_ += std::make_pair(
668 boost::icl::discrete_interval<vsomeip::service_t>(
669 its_second_service, its_second_service,
670 boost::icl::interval_bounds::closed()),
671 its_instances_methods);
672 EXPECT_TRUE(its_security->is_policy_update_allowed(1000, _policy));
673
674 // test invalid UID which is not whitelisted
675 EXPECT_FALSE(its_security->is_policy_update_allowed(2002, _policy));
676
677 // test invalid policy that additionally holds a service id which is not whitelisted
678 vsomeip::service_t its_third_service(0x8888);
679 _policy->requests_ += std::make_pair(
680 boost::icl::discrete_interval<vsomeip::service_t>(
681 its_third_service, its_third_service,
682 boost::icl::interval_bounds::closed()),
683 its_instances_methods);
684 EXPECT_FALSE(its_security->is_policy_update_allowed(1000, _policy));
685
686 // TCP connection setting:
687 // max TCP connect time / max allowed number of aborted TCP endpoint restarts until forced restart
688 EXPECT_EQ(its_configuration->get_max_tcp_connect_time(), 10000u);
689 EXPECT_EQ(its_configuration->get_max_tcp_restart_aborts(), 15u);
690
691 // 6. Service discovery
692 bool enabled = its_configuration->is_sd_enabled();
693 std::string protocol = its_configuration->get_sd_protocol();
694 uint16_t port = its_configuration->get_sd_port();
695 std::string multicast = its_configuration->get_sd_multicast();
696
697 uint32_t initial_delay_min = its_configuration->get_sd_initial_delay_min();
698 uint32_t initial_delay_max = its_configuration->get_sd_initial_delay_max();
699 int32_t repetitions_base_delay = its_configuration->get_sd_repetitions_base_delay();
700 uint8_t repetitions_max = its_configuration->get_sd_repetitions_max();
701 vsomeip::ttl_t ttl = its_configuration->get_sd_ttl();
702 int32_t cyclic_offer_delay = its_configuration->get_sd_cyclic_offer_delay();
703 int32_t request_response_delay = its_configuration->get_sd_request_response_delay();
704
705 EXPECT_TRUE(check<bool>(enabled, _expected_enabled, "SD ENABLED"));
706 EXPECT_TRUE(check<std::string>(protocol, _expected_protocol, "SD PROTOCOL"));
707 EXPECT_TRUE(check<std::string>(multicast, _expected_multicast, "SD MULTICAST"));
708 EXPECT_TRUE(check<uint16_t>(port, _expected_port, "SD PORT"));
709
710 EXPECT_TRUE(check<uint32_t>(initial_delay_min, _expected_initial_delay_min, "SD INITIAL DELAY MIN"));
711 EXPECT_TRUE(check<uint32_t>(initial_delay_max, _expected_initial_delay_max, "SD INITIAL DELAY MAX"));
712 EXPECT_TRUE(check<int32_t>(repetitions_base_delay, _expected_repetitions_base_delay, "SD REPETITION BASE DELAY"));
713 EXPECT_TRUE(check<uint8_t>(repetitions_max,_expected_repetitions_max, "SD REPETITION MAX"));
714 EXPECT_TRUE(check<vsomeip::ttl_t>(ttl, _expected_ttl, "SD TTL"));
715 EXPECT_TRUE(check<int32_t>(cyclic_offer_delay, static_cast<int32_t>(_expected_cyclic_offer_delay), "SD CYCLIC OFFER DELAY"));
716 EXPECT_TRUE(check<int32_t>(request_response_delay, static_cast<int32_t>(_expected_request_response_delay), "SD RESPONSE REQUEST DELAY"));
717 EXPECT_EQ(1000u, its_configuration->get_sd_offer_debounce_time());
718
719 ASSERT_TRUE(vsomeip::plugin_manager_impl::get()->unload_plugin(vsomeip::plugin_type_e::CONFIGURATION_PLUGIN));
720 }
721
TEST(configuration_test,check_config_file)722 TEST(configuration_test, check_config_file) {
723 // Check current configuration file format
724 check_file(CONFIGURATION_FILE,
725 EXPECTED_UNICAST_ADDRESS,
726 EXPECTED_HAS_CONSOLE,
727 EXPECTED_HAS_FILE,
728 EXPECTED_HAS_DLT,
729 EXPECTED_VERSION_LOGGING_ENABLED,
730 EXPECTED_VERSION_LOGGING_INTERVAL,
731 EXPECTED_APPLICATION_MAX_DISPATCHERS,
732 EXPECTED_APPLICATION_MAX_DISPATCH_TIME,
733 EXPECTED_APPLICATION_THREADS,
734 EXPECTED_APPLICATION_REQUEST_DEBOUNCE_TIME,
735 EXPECTED_LOGFILE,
736 EXPECTED_LOGLEVEL,
737 EXPECTED_UNICAST_ADDRESS_1234_0022,
738 EXPECTED_RELIABLE_PORT_1234_0022,
739 EXPECTED_UNRELIABLE_PORT_1234_0022,
740 EXPECTED_UNICAST_ADDRESS_1234_0023,
741 EXPECTED_RELIABLE_PORT_1234_0023,
742 EXPECTED_UNRELIABLE_PORT_1234_0023,
743 EXPECTED_UNICAST_ADDRESS_2277_0022,
744 EXPECTED_RELIABLE_PORT_2277_0022,
745 EXPECTED_UNRELIABLE_PORT_2277_0022,
746 EXPECTED_UNICAST_ADDRESS_2266_0022,
747 EXPECTED_RELIABLE_PORT_2266_0022,
748 EXPECTED_UNRELIABLE_PORT_2266_0022,
749 EXPECTED_UNICAST_ADDRESS_4466_0321,
750 EXPECTED_RELIABLE_PORT_4466_0321,
751 EXPECTED_UNRELIABLE_PORT_4466_0321,
752 EXPECTED_SD_ENABLED,
753 EXPECTED_SD_PROTOCOL,
754 EXPECTED_SD_MULTICAST,
755 EXPECTED_SD_PORT,
756 EXPECTED_INITIAL_DELAY_MIN,
757 EXPECTED_INITIAL_DELAY_MAX,
758 EXPECTED_REPETITIONS_BASE_DELAY,
759 EXPECTED_REPETITIONS_MAX,
760 EXPECTED_TTL,
761 EXPECTED_CYCLIC_OFFER_DELAY,
762 EXPECTED_REQUEST_RESPONSE_DELAY);
763 }
764
TEST(configuration_test,check_deprecated_config_file)765 TEST(configuration_test, check_deprecated_config_file) {
766 // Check deprecated configuration file format
767 check_file(DEPRECATED_CONFIGURATION_FILE,
768 EXPECTED_UNICAST_ADDRESS,
769 EXPECTED_HAS_CONSOLE,
770 EXPECTED_HAS_FILE,
771 EXPECTED_HAS_DLT,
772 EXPECTED_VERSION_LOGGING_ENABLED,
773 EXPECTED_VERSION_LOGGING_INTERVAL,
774 EXPECTED_APPLICATION_MAX_DISPATCHERS,
775 EXPECTED_APPLICATION_MAX_DISPATCH_TIME,
776 EXPECTED_APPLICATION_THREADS,
777 EXPECTED_APPLICATION_REQUEST_DEBOUNCE_TIME,
778 EXPECTED_LOGFILE,
779 EXPECTED_LOGLEVEL,
780 EXPECTED_UNICAST_ADDRESS_1234_0022,
781 EXPECTED_RELIABLE_PORT_1234_0022,
782 EXPECTED_UNRELIABLE_PORT_1234_0022,
783 EXPECTED_UNICAST_ADDRESS_1234_0023,
784 EXPECTED_RELIABLE_PORT_1234_0023,
785 EXPECTED_UNRELIABLE_PORT_1234_0023,
786 EXPECTED_UNICAST_ADDRESS_2277_0022,
787 EXPECTED_RELIABLE_PORT_2277_0022,
788 EXPECTED_UNRELIABLE_PORT_2277_0022,
789 EXPECTED_UNICAST_ADDRESS_2266_0022,
790 EXPECTED_RELIABLE_PORT_2266_0022,
791 EXPECTED_UNRELIABLE_PORT_2266_0022,
792 EXPECTED_UNICAST_ADDRESS_4466_0321,
793 EXPECTED_RELIABLE_PORT_4466_0321,
794 EXPECTED_UNRELIABLE_PORT_4466_0321,
795 EXPECTED_SD_ENABLED,
796 EXPECTED_SD_PROTOCOL,
797 EXPECTED_SD_MULTICAST,
798 EXPECTED_SD_PORT,
799 EXPECTED_DEPRECATED_INITIAL_DELAY_MIN,
800 EXPECTED_DEPRECATED_INITIAL_DELAY_MAX,
801 EXPECTED_DEPRECATED_REPETITIONS_BASE_DELAY,
802 EXPECTED_DEPRECATED_REPETITIONS_MAX,
803 EXPECTED_DEPRECATED_TTL,
804 EXPECTED_CYCLIC_OFFER_DELAY,
805 EXPECTED_DEPRECATED_REQUEST_RESPONSE_DELAY);
806 }
807
main(int argc,char ** argv)808 int main(int argc, char** argv) {
809 ::testing::InitGoogleTest(&argc, argv);
810 return RUN_ALL_TESTS();
811 }
812