blob: 73e29c6bc39d567f77e158134510fa4d6ff1431b [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 Pesaventocf7db2f2019-03-24 23:17:28 -04003 * Copyright (c) 2014-2019, 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
37namespace nfd {
Davide Pesavento2cae8ca2019-04-18 20:48:05 -040038namespace face {
susmit91e1d7c2016-10-03 16:16:57 -060039namespace tests {
40
Davide Pesavento2cae8ca2019-04-18 20:48:05 -040041BOOST_AUTO_TEST_SUITE(Face)
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -040042BOOST_AUTO_TEST_SUITE(TestNetworkPredicate)
43
44template<class T>
Davide Pesaventocf7db2f2019-03-24 23:17:28 -040045class NetworkPredicateBaseFixture
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -040046{
47public:
48 void
49 parseConfig(const std::string& config)
50 {
51 std::istringstream input(config);
52 boost::property_tree::ptree ptree;
53 boost::property_tree::read_info(input, ptree);
54
55 for (const auto& i : ptree) {
56 if (i.first == "whitelist") {
57 predicate.parseWhitelist(i.second);
58 }
59 else if (i.first == "blacklist") {
60 predicate.parseBlacklist(i.second);
61 }
62 }
63 }
64
65protected:
66 T predicate;
67};
68
69class NetworkInterfacePredicateFixture : public NetworkPredicateBaseFixture<NetworkInterfacePredicate>
susmit91e1d7c2016-10-03 16:16:57 -060070{
71protected:
72 NetworkInterfacePredicateFixture()
73 {
74 using namespace boost::asio::ip;
Junxiao Shi2760adc2017-07-06 05:44:52 +000075 using namespace ndn::net;
Junxiao Shia5765d62017-08-09 04:07:46 +000076 namespace ethernet = ndn::ethernet;
Junxiao Shi2760adc2017-07-06 05:44:52 +000077
78 netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
79 netifs.back()->setIndex(0);
80 netifs.back()->setName("eth0");
81 netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:00"));
82 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
83 address_v4::from_string("129.82.100.1"), address_v4::from_string("129.82.255.255"),
84 16, AddressScope::GLOBAL, 0));
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -040085 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -040086 address_v6::from_string("2001:db8:1::1"), address_v6::from_string("2001:db8:1::ffff:ffff:ffff:ffff"),
87 64, AddressScope::GLOBAL, 0));
Junxiao Shi2760adc2017-07-06 05:44:52 +000088 netifs.back()->setFlags(IFF_UP);
89
90 netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
91 netifs.back()->setIndex(1);
92 netifs.back()->setName("eth1");
93 netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:01"));
94 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
95 address_v4::from_string("192.168.2.1"), address_v4::from_string("192.168.2.255"),
96 24, AddressScope::GLOBAL, 0));
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -040097 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -040098 address_v6::from_string("2001:db8:2::1"), address_v6::from_string("2001:db8:2::ffff:ffff:ffff:ffff"),
99 64, AddressScope::GLOBAL, 0));
Junxiao Shi2760adc2017-07-06 05:44:52 +0000100 netifs.back()->setFlags(IFF_UP);
101
102 netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
103 netifs.back()->setIndex(2);
104 netifs.back()->setName("eth2");
105 netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:02"));
106 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
107 address_v4::from_string("198.51.100.1"), address_v4::from_string("198.51.100.255"),
108 24, AddressScope::GLOBAL, 0));
109 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
110 address_v6::from_string("2001:db8::1"), address_v6::from_string("2001:db8::ffff"),
111 112, AddressScope::GLOBAL, 0));
112 netifs.back()->setFlags(IFF_MULTICAST | IFF_BROADCAST | IFF_UP);
113
114 netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
115 netifs.back()->setIndex(3);
116 netifs.back()->setName("enp68s0f1");
117 netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:03"));
118 netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
119 address_v4::from_string("192.168.2.3"), address_v4::from_string("192.168.2.255"),
120 24, AddressScope::GLOBAL, 0));
121 netifs.back()->setFlags(IFF_UP);
susmit91e1d7c2016-10-03 16:16:57 -0600122 }
123
susmit91e1d7c2016-10-03 16:16:57 -0600124protected:
Junxiao Shi2760adc2017-07-06 05:44:52 +0000125 std::vector<shared_ptr<ndn::net::NetworkInterface>> netifs;
susmit91e1d7c2016-10-03 16:16:57 -0600126};
127
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -0400128BOOST_FIXTURE_TEST_SUITE(NetworkInterface, NetworkInterfacePredicateFixture)
susmit91e1d7c2016-10-03 16:16:57 -0600129
130BOOST_AUTO_TEST_CASE(Default)
131{
132 parseConfig("");
133
Junxiao Shi2760adc2017-07-06 05:44:52 +0000134 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
135 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
136 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
137 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit91e1d7c2016-10-03 16:16:57 -0600138}
139
140BOOST_AUTO_TEST_CASE(EmptyWhitelist)
141{
142 parseConfig("whitelist\n"
143 "{\n"
144 "}");
145
Junxiao Shi2760adc2017-07-06 05:44:52 +0000146 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
147 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
148 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
149 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600150}
151
152BOOST_AUTO_TEST_CASE(WildcardBlacklist)
153{
154 parseConfig("blacklist\n"
155 "{\n"
156 " *\n"
157 "}");
158
Junxiao Shi2760adc2017-07-06 05:44:52 +0000159 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
160 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
161 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
162 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600163}
164
165BOOST_AUTO_TEST_CASE(IfnameWhitelist)
166{
167 parseConfig("whitelist\n"
168 "{\n"
169 " ifname eth0\n"
170 " ifname eth1\n"
171 "}");
172
Junxiao Shi2760adc2017-07-06 05:44:52 +0000173 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
174 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
175 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
176 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600177}
178
179BOOST_AUTO_TEST_CASE(IfnameBlacklist)
180{
181 parseConfig("blacklist\n"
182 "{\n"
183 " ifname eth0\n"
184 " ifname eth1\n"
185 "}");
186
Junxiao Shi2760adc2017-07-06 05:44:52 +0000187 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
188 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
189 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
190 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit21f22e62017-03-25 15:44:45 -0500191}
192
193BOOST_AUTO_TEST_CASE(IfnameWildcardStart)
194{
195 parseConfig("whitelist\n"
196 "{\n"
197 " ifname enp*\n"
198 "}");
199
Junxiao Shi2760adc2017-07-06 05:44:52 +0000200 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
201 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
202 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
203 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit21f22e62017-03-25 15:44:45 -0500204}
205
206BOOST_AUTO_TEST_CASE(IfnameWildcardMiddle)
207{
208 parseConfig("whitelist\n"
209 "{\n"
210 " ifname *th*\n"
211 "}");
212
Junxiao Shi2760adc2017-07-06 05:44:52 +0000213 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
214 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
215 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
216 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit21f22e62017-03-25 15:44:45 -0500217}
218
219BOOST_AUTO_TEST_CASE(IfnameWildcardDouble)
220{
221 parseConfig("whitelist\n"
222 "{\n"
223 " ifname eth**\n"
224 "}");
225
Junxiao Shi2760adc2017-07-06 05:44:52 +0000226 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
227 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
228 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
229 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit21f22e62017-03-25 15:44:45 -0500230}
231
232BOOST_AUTO_TEST_CASE(IfnameWildcardOnly)
233{
234 parseConfig("whitelist\n"
235 "{\n"
236 " ifname *\n"
237 "}");
238
Junxiao Shi2760adc2017-07-06 05:44:52 +0000239 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
240 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
241 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
242 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit21f22e62017-03-25 15:44:45 -0500243}
244
245BOOST_AUTO_TEST_CASE(IfnameQuestionMark)
246{
247 parseConfig("whitelist\n"
248 "{\n"
249 " ifname eth?\n"
250 "}");
251
Junxiao Shi2760adc2017-07-06 05:44:52 +0000252 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
253 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
254 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
255 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600256}
257
258BOOST_AUTO_TEST_CASE(IfnameMalformed)
259{
260 BOOST_CHECK_THROW(
261 parseConfig("whitelist\n"
262 "{\n"
263 " ifname\n"
264 "}"),
265 ConfigFile::Error);
266}
267
268BOOST_AUTO_TEST_CASE(EtherWhitelist)
269{
270 parseConfig("whitelist\n"
271 "{\n"
272 " ether 3e:15:c2:8b:65:00\n"
273 " ether 3e:15:c2:8b:65:01\n"
274 "}");
275
Junxiao Shi2760adc2017-07-06 05:44:52 +0000276 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
277 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
278 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
279 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600280}
281
282BOOST_AUTO_TEST_CASE(EtherBlacklist)
283{
284 parseConfig("blacklist\n"
285 "{\n"
286 " ether 3e:15:c2:8b:65:00\n"
287 " ether 3e:15:c2:8b:65:01\n"
288 "}");
289
Junxiao Shi2760adc2017-07-06 05:44:52 +0000290 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
291 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
292 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
293 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit91e1d7c2016-10-03 16:16:57 -0600294}
295
296BOOST_AUTO_TEST_CASE(EtherMalformed)
297{
298 BOOST_CHECK_THROW(
299 parseConfig("blacklist\n"
300 "{\n"
301 " ether foo\n"
302 "}"),
303 ConfigFile::Error);
304}
305
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -0400306BOOST_AUTO_TEST_CASE(Subnet4Whitelist)
susmit91e1d7c2016-10-03 16:16:57 -0600307{
308 parseConfig("whitelist\n"
309 "{\n"
310 " subnet 192.168.0.0/16\n"
311 "}");
312
Junxiao Shi2760adc2017-07-06 05:44:52 +0000313 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
314 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
315 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
316 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
susmit91e1d7c2016-10-03 16:16:57 -0600317}
318
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -0400319BOOST_AUTO_TEST_CASE(Subnet4Blacklist)
susmit91e1d7c2016-10-03 16:16:57 -0600320{
321 parseConfig("blacklist\n"
322 "{\n"
323 " subnet 192.168.0.0/16\n"
324 "}");
325
Junxiao Shi2760adc2017-07-06 05:44:52 +0000326 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
327 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
328 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
329 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
susmit91e1d7c2016-10-03 16:16:57 -0600330}
331
Alexander Afanasyev3bdc1de2018-04-03 17:33:31 -0400332BOOST_AUTO_TEST_CASE(Subnet6Whitelist)
333{
334 parseConfig("whitelist\n"
335 "{\n"
336 " subnet 2001:db8:2::1/120\n"
337 "}");
338
339 BOOST_CHECK_EQUAL(predicate(*netifs[0]), false);
340 BOOST_CHECK_EQUAL(predicate(*netifs[1]), true);
341 BOOST_CHECK_EQUAL(predicate(*netifs[2]), false);
342 BOOST_CHECK_EQUAL(predicate(*netifs[3]), false);
343}
344
345BOOST_AUTO_TEST_CASE(Subnet6Blacklist)
346{
347 parseConfig("blacklist\n"
348 "{\n"
349 " subnet 2001:db8:2::1/120\n"
350 "}");
351
352 BOOST_CHECK_EQUAL(predicate(*netifs[0]), true);
353 BOOST_CHECK_EQUAL(predicate(*netifs[1]), false);
354 BOOST_CHECK_EQUAL(predicate(*netifs[2]), true);
355 BOOST_CHECK_EQUAL(predicate(*netifs[3]), true);
356}
357
susmit91e1d7c2016-10-03 16:16:57 -0600358BOOST_AUTO_TEST_CASE(SubnetMalformed)
359{
360 BOOST_CHECK_THROW(
361 parseConfig("blacklist\n"
362 "{\n"
363 " subnet 266.0.0.91/\n"
364 "}"),
365 ConfigFile::Error);
366}
367
Alexander Afanasyeve4d745d2018-04-08 17:55:56 -0400368BOOST_AUTO_TEST_CASE(UnrecognizedKey)
369{
370 BOOST_CHECK_THROW(
371 parseConfig("blacklist\n"
372 "{\n"
373 " key unrecognized\n"
374 "}"),
375 ConfigFile::Error);
376}
377
378BOOST_AUTO_TEST_SUITE_END() // NetworkInterface
379
380class IpAddressPredicateFixture : public NetworkPredicateBaseFixture<IpAddressPredicate>
381{
382protected:
383 IpAddressPredicateFixture()
384 {
385 using namespace boost::asio::ip;
386
387 addrs.push_back(address_v4::from_string("129.82.100.1"));
388 addrs.push_back(address_v6::from_string("2001:db8:1::1"));
389 addrs.push_back(address_v4::from_string("192.168.2.1"));
390 addrs.push_back(address_v6::from_string("2001:db8:2::1"));
391 }
392
393protected:
394 std::vector<boost::asio::ip::address> addrs;
395};
396
397BOOST_FIXTURE_TEST_SUITE(IpAddress, IpAddressPredicateFixture)
398
399BOOST_AUTO_TEST_CASE(Default)
400{
401 parseConfig("");
402
403 BOOST_CHECK_EQUAL(predicate(addrs[0]), true);
404 BOOST_CHECK_EQUAL(predicate(addrs[1]), true);
405 BOOST_CHECK_EQUAL(predicate(addrs[2]), true);
406 BOOST_CHECK_EQUAL(predicate(addrs[3]), true);
407}
408
409BOOST_AUTO_TEST_CASE(EmptyWhitelist)
410{
411 parseConfig("whitelist\n"
412 "{\n"
413 "}");
414
415 BOOST_CHECK_EQUAL(predicate(addrs[0]), false);
416 BOOST_CHECK_EQUAL(predicate(addrs[1]), false);
417 BOOST_CHECK_EQUAL(predicate(addrs[2]), false);
418 BOOST_CHECK_EQUAL(predicate(addrs[3]), false);
419}
420
421BOOST_AUTO_TEST_CASE(WildcardBlacklist)
422{
423 parseConfig("blacklist\n"
424 "{\n"
425 " *\n"
426 "}");
427
428 BOOST_CHECK_EQUAL(predicate(addrs[0]), false);
429 BOOST_CHECK_EQUAL(predicate(addrs[1]), false);
430 BOOST_CHECK_EQUAL(predicate(addrs[2]), false);
431 BOOST_CHECK_EQUAL(predicate(addrs[3]), false);
432}
433
434BOOST_AUTO_TEST_CASE(Subnet4Whitelist)
435{
436 parseConfig("whitelist\n"
437 "{\n"
438 " subnet 192.168.0.0/16\n"
439 "}");
440
441 BOOST_CHECK_EQUAL(predicate(addrs[0]), false);
442 BOOST_CHECK_EQUAL(predicate(addrs[1]), false);
443 BOOST_CHECK_EQUAL(predicate(addrs[2]), true);
444 BOOST_CHECK_EQUAL(predicate(addrs[3]), false);
445}
446
447BOOST_AUTO_TEST_CASE(Subnet4Blacklist)
448{
449 parseConfig("blacklist\n"
450 "{\n"
451 " subnet 192.168.0.0/16\n"
452 "}");
453
454 BOOST_CHECK_EQUAL(predicate(addrs[0]), true);
455 BOOST_CHECK_EQUAL(predicate(addrs[1]), true);
456 BOOST_CHECK_EQUAL(predicate(addrs[2]), false);
457 BOOST_CHECK_EQUAL(predicate(addrs[3]), true);
458}
459
460BOOST_AUTO_TEST_CASE(Subnet6Whitelist)
461{
462 parseConfig("whitelist\n"
463 "{\n"
464 " subnet 2001:db8:2::1/120\n"
465 "}");
466
467 BOOST_CHECK_EQUAL(predicate(addrs[0]), false);
468 BOOST_CHECK_EQUAL(predicate(addrs[1]), false);
469 BOOST_CHECK_EQUAL(predicate(addrs[2]), false);
470 BOOST_CHECK_EQUAL(predicate(addrs[3]), true);
471}
472
473BOOST_AUTO_TEST_CASE(Subnet6Blacklist)
474{
475 parseConfig("blacklist\n"
476 "{\n"
477 " subnet 2001:db8:2::1/120\n"
478 "}");
479
480 BOOST_CHECK_EQUAL(predicate(addrs[0]), true);
481 BOOST_CHECK_EQUAL(predicate(addrs[1]), true);
482 BOOST_CHECK_EQUAL(predicate(addrs[2]), true);
483 BOOST_CHECK_EQUAL(predicate(addrs[3]), false);
484}
485
486BOOST_AUTO_TEST_CASE(UnrecognizedKey)
487{
488 BOOST_CHECK_THROW(
489 parseConfig("blacklist\n"
490 "{\n"
491 " ether 3e:15:c2:8b:65:00\n"
492 "}"),
493 ConfigFile::Error);
494
495 BOOST_CHECK_THROW(
496 parseConfig("blacklist\n"
497 "{\n"
498 " ifname eth**\n"
499 "}"),
500 ConfigFile::Error);
501
502 BOOST_CHECK_THROW(
503 parseConfig("blacklist\n"
504 "{\n"
505 " key unrecognized\n"
506 "}"),
507 ConfigFile::Error);
508}
509
510BOOST_AUTO_TEST_SUITE_END() // IpAddress
511
512BOOST_AUTO_TEST_SUITE_END() // TestNetworkPredicate
Davide Pesavento2cae8ca2019-04-18 20:48:05 -0400513BOOST_AUTO_TEST_SUITE_END() // Face
susmit91e1d7c2016-10-03 16:16:57 -0600514
515} // namespace tests
Davide Pesavento2cae8ca2019-04-18 20:48:05 -0400516} // namespace face
susmit91e1d7c2016-10-03 16:16:57 -0600517} // namespace nfd