blob: 05094fc3538242f8f1aa0cc3fcca75df79f73ec2 [file] [log] [blame]
susmit91e1d7c2016-10-03 16:16:57 -06001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Junxiao Shi2760adc2017-07-06 05:44:52 +00002/*
Davide Pesaventoe422f9e2022-06-03 01:30:23 -04003 * Copyright (c) 2014-2022, Regents of the University of California,
susmit91e1d7c2016-10-03 16:16:57 -06004 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology,
9 * The University of Memphis.
10 *
11 * This file is part of NFD (Named Data Networking Forwarding Daemon).
12 * See AUTHORS.md for complete list of NFD authors and contributors.
13 *
14 * NFD is free software: you can redistribute it and/or modify it under the terms
15 * of the GNU General Public License as published by the Free Software Foundation,
16 * either version 3 of the License, or (at your option) any later version.
17 *
18 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20 * PURPOSE. See the GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along with
23 * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24 */
25
Davide Pesavento2cae8ca2019-04-18 20:48:05 -040026#include "face/network-predicate.hpp"
27#include "common/config-file.hpp"
susmit91e1d7c2016-10-03 16:16:57 -060028
29#include "tests/test-common.hpp"
30
Junxiao Shia5765d62017-08-09 04:07:46 +000031#include <ndn-cxx/net/ethernet.hpp>
Junxiao Shi2760adc2017-07-06 05:44:52 +000032#include <ndn-cxx/net/network-monitor-stub.hpp>
Davide Pesaventocf7db2f2019-03-24 23:17:28 -040033
susmit91e1d7c2016-10-03 16:16:57 -060034#include <boost/property_tree/info_parser.hpp>
35#include <sstream>
36
Davide Pesaventoe422f9e2022-06-03 01:30:23 -040037namespace nfd::tests {
susmit91e1d7c2016-10-03 16:16:57 -060038
Davide Pesavento2cae8ca2019-04-18 20:48:05 -040039BOOST_AUTO_TEST_SUITE(Face)
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -040040BOOST_AUTO_TEST_SUITE(TestNetworkPredicate)
41
42template<class T>
Davide Pesaventocf7db2f2019-03-24 23:17:28 -040043class NetworkPredicateBaseFixture
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -040044{
45public:
46 void
47 parseConfig(const std::string& config)
48 {
49 std::istringstream input(config);
50 boost::property_tree::ptree ptree;
51 boost::property_tree::read_info(input, ptree);
52
53 for (const auto& i : ptree) {
54 if (i.first == "whitelist") {
55 predicate.parseWhitelist(i.second);
56 }
57 else if (i.first == "blacklist") {
58 predicate.parseBlacklist(i.second);
59 }
60 }
61 }
62
63protected:
64 T predicate;
65};
66
Davide Pesaventoe422f9e2022-06-03 01:30:23 -040067class NetworkInterfacePredicateFixture : public NetworkPredicateBaseFixture<face::NetworkInterfacePredicate>
susmit91e1d7c2016-10-03 16:16:57 -060068{
69protected:
70 NetworkInterfacePredicateFixture()
71 {
72 using namespace boost::asio::ip;
Junxiao Shi2760adc2017-07-06 05:44:52 +000073 using namespace ndn::net;
Junxiao Shia5765d62017-08-09 04:07:46 +000074 namespace ethernet = ndn::ethernet;
Junxiao Shi2760adc2017-07-06 05:44:52 +000075
76 netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
77 netifs.back()->setIndex(0);
78 netifs.back()->setName("eth0");
79 netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:00"));
80 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
81 address_v4::from_string("129.82.100.1"), address_v4::from_string("129.82.255.255"),
82 16, AddressScope::GLOBAL, 0));
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -040083 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -040084 address_v6::from_string("2001:db8:1::1"), address_v6::from_string("2001:db8:1::ffff:ffff:ffff:ffff"),
85 64, AddressScope::GLOBAL, 0));
Junxiao Shi2760adc2017-07-06 05:44:52 +000086 netifs.back()->setFlags(IFF_UP);
87
88 netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
89 netifs.back()->setIndex(1);
90 netifs.back()->setName("eth1");
91 netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:01"));
92 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
93 address_v4::from_string("192.168.2.1"), address_v4::from_string("192.168.2.255"),
94 24, AddressScope::GLOBAL, 0));
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -040095 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -040096 address_v6::from_string("2001:db8:2::1"), address_v6::from_string("2001:db8:2::ffff:ffff:ffff:ffff"),
97 64, AddressScope::GLOBAL, 0));
Junxiao Shi2760adc2017-07-06 05:44:52 +000098 netifs.back()->setFlags(IFF_UP);
99
100 netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
101 netifs.back()->setIndex(2);
102 netifs.back()->setName("eth2");
103 netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:02"));
104 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
105 address_v4::from_string("198.51.100.1"), address_v4::from_string("198.51.100.255"),
106 24, AddressScope::GLOBAL, 0));
107 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
108 address_v6::from_string("2001:db8::1"), address_v6::from_string("2001:db8::ffff"),
109 112, AddressScope::GLOBAL, 0));
110 netifs.back()->setFlags(IFF_MULTICAST | IFF_BROADCAST | IFF_UP);
111
112 netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
113 netifs.back()->setIndex(3);
114 netifs.back()->setName("enp68s0f1");
115 netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:03"));
116 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
117 address_v4::from_string("192.168.2.3"), address_v4::from_string("192.168.2.255"),
118 24, AddressScope::GLOBAL, 0));
119 netifs.back()->setFlags(IFF_UP);
susmit91e1d7c2016-10-03 16:16:57 -0600120 }
121
susmit91e1d7c2016-10-03 16:16:57 -0600122protected:
Junxiao Shi2760adc2017-07-06 05:44:52 +0000123 std::vector<shared_ptr<ndn::net::NetworkInterface>> netifs;
susmit91e1d7c2016-10-03 16:16:57 -0600124};
125
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -0400126BOOST_FIXTURE_TEST_SUITE(NetworkInterface, NetworkInterfacePredicateFixture)
susmit91e1d7c2016-10-03 16:16:57 -0600127
128BOOST_AUTO_TEST_CASE(Default)
129{
130 parseConfig("");
131
Junxiao Shi2760adc2017-07-06 05:44:52 +0000132 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
133 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
134 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
135 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit91e1d7c2016-10-03 16:16:57 -0600136}
137
138BOOST_AUTO_TEST_CASE(EmptyWhitelist)
139{
140 parseConfig("whitelist\n"
141 "{\n"
142 "}");
143
Junxiao Shi2760adc2017-07-06 05:44:52 +0000144 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
145 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
146 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
147 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600148}
149
150BOOST_AUTO_TEST_CASE(WildcardBlacklist)
151{
152 parseConfig("blacklist\n"
153 "{\n"
154 " *\n"
155 "}");
156
Junxiao Shi2760adc2017-07-06 05:44:52 +0000157 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
158 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
159 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
160 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600161}
162
163BOOST_AUTO_TEST_CASE(IfnameWhitelist)
164{
165 parseConfig("whitelist\n"
166 "{\n"
167 " ifname eth0\n"
168 " ifname eth1\n"
169 "}");
170
Junxiao Shi2760adc2017-07-06 05:44:52 +0000171 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
172 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
173 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
174 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600175}
176
177BOOST_AUTO_TEST_CASE(IfnameBlacklist)
178{
179 parseConfig("blacklist\n"
180 "{\n"
181 " ifname eth0\n"
182 " ifname eth1\n"
183 "}");
184
Junxiao Shi2760adc2017-07-06 05:44:52 +0000185 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
186 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
187 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
188 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit21f22e62017-03-25 15:44:45 -0500189}
190
191BOOST_AUTO_TEST_CASE(IfnameWildcardStart)
192{
193 parseConfig("whitelist\n"
194 "{\n"
195 " ifname enp*\n"
196 "}");
197
Junxiao Shi2760adc2017-07-06 05:44:52 +0000198 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
199 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
200 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
201 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit21f22e62017-03-25 15:44:45 -0500202}
203
204BOOST_AUTO_TEST_CASE(IfnameWildcardMiddle)
205{
206 parseConfig("whitelist\n"
207 "{\n"
208 " ifname *th*\n"
209 "}");
210
Junxiao Shi2760adc2017-07-06 05:44:52 +0000211 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
212 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
213 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
214 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit21f22e62017-03-25 15:44:45 -0500215}
216
217BOOST_AUTO_TEST_CASE(IfnameWildcardDouble)
218{
219 parseConfig("whitelist\n"
220 "{\n"
221 " ifname eth**\n"
222 "}");
223
Junxiao Shi2760adc2017-07-06 05:44:52 +0000224 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
225 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
226 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
227 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit21f22e62017-03-25 15:44:45 -0500228}
229
230BOOST_AUTO_TEST_CASE(IfnameWildcardOnly)
231{
232 parseConfig("whitelist\n"
233 "{\n"
234 " ifname *\n"
235 "}");
236
Junxiao Shi2760adc2017-07-06 05:44:52 +0000237 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
238 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
239 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
240 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit21f22e62017-03-25 15:44:45 -0500241}
242
243BOOST_AUTO_TEST_CASE(IfnameQuestionMark)
244{
245 parseConfig("whitelist\n"
246 "{\n"
247 " ifname eth?\n"
248 "}");
249
Junxiao Shi2760adc2017-07-06 05:44:52 +0000250 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
251 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
252 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
253 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600254}
255
256BOOST_AUTO_TEST_CASE(IfnameMalformed)
257{
258 BOOST_CHECK_THROW(
259 parseConfig("whitelist\n"
260 "{\n"
261 " ifname\n"
262 "}"),
263 ConfigFile::Error);
264}
265
266BOOST_AUTO_TEST_CASE(EtherWhitelist)
267{
268 parseConfig("whitelist\n"
269 "{\n"
270 " ether 3e:15:c2:8b:65:00\n"
271 " ether 3e:15:c2:8b:65:01\n"
272 "}");
273
Junxiao Shi2760adc2017-07-06 05:44:52 +0000274 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
275 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
276 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
277 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600278}
279
280BOOST_AUTO_TEST_CASE(EtherBlacklist)
281{
282 parseConfig("blacklist\n"
283 "{\n"
284 " ether 3e:15:c2:8b:65:00\n"
285 " ether 3e:15:c2:8b:65:01\n"
286 "}");
287
Junxiao Shi2760adc2017-07-06 05:44:52 +0000288 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
289 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
290 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
291 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit91e1d7c2016-10-03 16:16:57 -0600292}
293
294BOOST_AUTO_TEST_CASE(EtherMalformed)
295{
296 BOOST_CHECK_THROW(
297 parseConfig("blacklist\n"
298 "{\n"
299 " ether foo\n"
300 "}"),
301 ConfigFile::Error);
302}
303
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -0400304BOOST_AUTO_TEST_CASE(Subnet4Whitelist)
susmit91e1d7c2016-10-03 16:16:57 -0600305{
306 parseConfig("whitelist\n"
307 "{\n"
308 " subnet 192.168.0.0/16\n"
309 "}");
310
Junxiao Shi2760adc2017-07-06 05:44:52 +0000311 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
312 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
313 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
314 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit91e1d7c2016-10-03 16:16:57 -0600315}
316
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -0400317BOOST_AUTO_TEST_CASE(Subnet4Blacklist)
susmit91e1d7c2016-10-03 16:16:57 -0600318{
319 parseConfig("blacklist\n"
320 "{\n"
321 " subnet 192.168.0.0/16\n"
322 "}");
323
Junxiao Shi2760adc2017-07-06 05:44:52 +0000324 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
325 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
326 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
327 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600328}
329
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -0400330BOOST_AUTO_TEST_CASE(Subnet6Whitelist)
331{
332 parseConfig("whitelist\n"
333 "{\n"
334 " subnet 2001:db8:2::1/120\n"
335 "}");
336
337 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
338 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
339 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
340 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
341}
342
343BOOST_AUTO_TEST_CASE(Subnet6Blacklist)
344{
345 parseConfig("blacklist\n"
346 "{\n"
347 " subnet 2001:db8:2::1/120\n"
348 "}");
349
350 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
351 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
352 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
353 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
354}
355
susmit91e1d7c2016-10-03 16:16:57 -0600356BOOST_AUTO_TEST_CASE(SubnetMalformed)
357{
358 BOOST_CHECK_THROW(
359 parseConfig("blacklist\n"
360 "{\n"
361 " subnet 266.0.0.91/\n"
362 "}"),
363 ConfigFile::Error);
364}
365
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -0400366BOOST_AUTO_TEST_CASE(UnrecognizedKey)
367{
368 BOOST_CHECK_THROW(
369 parseConfig("blacklist\n"
370 "{\n"
371 " key unrecognized\n"
372 "}"),
373 ConfigFile::Error);
374}
375
376BOOST_AUTO_TEST_SUITE_END() // NetworkInterface
377
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400378class IpAddressPredicateFixture : public NetworkPredicateBaseFixture<face::IpAddressPredicate>
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -0400379{
380protected:
381 IpAddressPredicateFixture()
382 {
383 using namespace boost::asio::ip;
384
385 addrs.push_back(address_v4::from_string("129.82.100.1"));
386 addrs.push_back(address_v6::from_string("2001:db8:1::1"));
387 addrs.push_back(address_v4::from_string("192.168.2.1"));
388 addrs.push_back(address_v6::from_string("2001:db8:2::1"));
389 }
390
391protected:
392 std::vector<boost::asio::ip::address> addrs;
393};
394
395BOOST_FIXTURE_TEST_SUITE(IpAddress, IpAddressPredicateFixture)
396
397BOOST_AUTO_TEST_CASE(Default)
398{
399 parseConfig("");
400
401 BOOST_CHECK_EQUAL(predicate(addrs[0]), true);
402 BOOST_CHECK_EQUAL(predicate(addrs[1]), true);
403 BOOST_CHECK_EQUAL(predicate(addrs[2]), true);
404 BOOST_CHECK_EQUAL(predicate(addrs[3]), true);
405}
406
407BOOST_AUTO_TEST_CASE(EmptyWhitelist)
408{
409 parseConfig("whitelist\n"
410 "{\n"
411 "}");
412
413 BOOST_CHECK_EQUAL(predicate(addrs[0]), false);
414 BOOST_CHECK_EQUAL(predicate(addrs[1]), false);
415 BOOST_CHECK_EQUAL(predicate(addrs[2]), false);
416 BOOST_CHECK_EQUAL(predicate(addrs[3]), false);
417}
418
419BOOST_AUTO_TEST_CASE(WildcardBlacklist)
420{
421 parseConfig("blacklist\n"
422 "{\n"
423 " *\n"
424 "}");
425
426 BOOST_CHECK_EQUAL(predicate(addrs[0]), false);
427 BOOST_CHECK_EQUAL(predicate(addrs[1]), false);
428 BOOST_CHECK_EQUAL(predicate(addrs[2]), false);
429 BOOST_CHECK_EQUAL(predicate(addrs[3]), false);
430}
431
432BOOST_AUTO_TEST_CASE(Subnet4Whitelist)
433{
434 parseConfig("whitelist\n"
435 "{\n"
436 " subnet 192.168.0.0/16\n"
437 "}");
438
439 BOOST_CHECK_EQUAL(predicate(addrs[0]), false);
440 BOOST_CHECK_EQUAL(predicate(addrs[1]), false);
441 BOOST_CHECK_EQUAL(predicate(addrs[2]), true);
442 BOOST_CHECK_EQUAL(predicate(addrs[3]), false);
443}
444
445BOOST_AUTO_TEST_CASE(Subnet4Blacklist)
446{
447 parseConfig("blacklist\n"
448 "{\n"
449 " subnet 192.168.0.0/16\n"
450 "}");
451
452 BOOST_CHECK_EQUAL(predicate(addrs[0]), true);
453 BOOST_CHECK_EQUAL(predicate(addrs[1]), true);
454 BOOST_CHECK_EQUAL(predicate(addrs[2]), false);
455 BOOST_CHECK_EQUAL(predicate(addrs[3]), true);
456}
457
458BOOST_AUTO_TEST_CASE(Subnet6Whitelist)
459{
460 parseConfig("whitelist\n"
461 "{\n"
462 " subnet 2001:db8:2::1/120\n"
463 "}");
464
465 BOOST_CHECK_EQUAL(predicate(addrs[0]), false);
466 BOOST_CHECK_EQUAL(predicate(addrs[1]), false);
467 BOOST_CHECK_EQUAL(predicate(addrs[2]), false);
468 BOOST_CHECK_EQUAL(predicate(addrs[3]), true);
469}
470
471BOOST_AUTO_TEST_CASE(Subnet6Blacklist)
472{
473 parseConfig("blacklist\n"
474 "{\n"
475 " subnet 2001:db8:2::1/120\n"
476 "}");
477
478 BOOST_CHECK_EQUAL(predicate(addrs[0]), true);
479 BOOST_CHECK_EQUAL(predicate(addrs[1]), true);
480 BOOST_CHECK_EQUAL(predicate(addrs[2]), true);
481 BOOST_CHECK_EQUAL(predicate(addrs[3]), false);
482}
483
484BOOST_AUTO_TEST_CASE(UnrecognizedKey)
485{
486 BOOST_CHECK_THROW(
487 parseConfig("blacklist\n"
488 "{\n"
489 " ether 3e:15:c2:8b:65:00\n"
490 "}"),
491 ConfigFile::Error);
492
493 BOOST_CHECK_THROW(
494 parseConfig("blacklist\n"
495 "{\n"
496 " ifname eth**\n"
497 "}"),
498 ConfigFile::Error);
499
500 BOOST_CHECK_THROW(
501 parseConfig("blacklist\n"
502 "{\n"
503 " key unrecognized\n"
504 "}"),
505 ConfigFile::Error);
506}
507
508BOOST_AUTO_TEST_SUITE_END() // IpAddress
509
510BOOST_AUTO_TEST_SUITE_END() // TestNetworkPredicate
Davide Pesavento2cae8ca2019-04-18 20:48:05 -0400511BOOST_AUTO_TEST_SUITE_END() // Face
susmit91e1d7c2016-10-03 16:16:57 -0600512
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400513} // namespace nfd::tests