blob: 2547e300dfcc21266dc63eb3bb32c4c6f0627a68 [file] [log] [blame]
Junxiao Shicde37ad2015-12-24 01:02:05 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Junxiao Shi0ba6d642017-07-17 00:53:22 +00002/*
Davide Pesaventoe422f9e2022-06-03 01:30:23 -04003 * Copyright (c) 2014-2022, Regents of the University of California,
Junxiao Shicde37ad2015-12-24 01:02:05 -07004 * 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
26#include "face/tcp-factory.hpp"
27
Junxiao Shi38b24c72017-01-05 02:59:31 +000028#include "face-system-fixture.hpp"
Davide Pesaventob15276f2017-07-15 16:27:13 -040029#include "factory-test-common.hpp"
Davide Pesavento3dade002019-03-19 11:29:56 -060030#include "tests/daemon/limited-io.hpp"
Junxiao Shicde37ad2015-12-24 01:02:05 -070031
Davide Pesaventoe422f9e2022-06-03 01:30:23 -040032namespace nfd::tests {
33
34using face::TcpChannel;
35using face::TcpFactory;
Junxiao Shicde37ad2015-12-24 01:02:05 -070036
Davide Pesavento4b89a6e2017-10-07 15:29:50 -040037class TcpFactoryFixture : public FaceSystemFactoryFixture<TcpFactory>
38{
39protected:
40 shared_ptr<TcpChannel>
41 createChannel(const std::string& localIp, const std::string& localPort)
42 {
Davide Pesavento9c33b902018-05-20 01:30:29 -040043 tcp::Endpoint endpoint(boost::asio::ip::address::from_string(localIp),
Davide Pesavento4b89a6e2017-10-07 15:29:50 -040044 boost::lexical_cast<uint16_t>(localPort));
45 return factory.createChannel(endpoint);
46 }
Alexander Afanasyevded17422018-04-03 19:00:23 -040047
48protected:
49 LimitedIo limitedIo;
Davide Pesavento4b89a6e2017-10-07 15:29:50 -040050};
Junxiao Shi0ba6d642017-07-17 00:53:22 +000051
Junxiao Shicde37ad2015-12-24 01:02:05 -070052BOOST_AUTO_TEST_SUITE(Face)
Junxiao Shi0ba6d642017-07-17 00:53:22 +000053BOOST_FIXTURE_TEST_SUITE(TestTcpFactory, TcpFactoryFixture)
Junxiao Shicde37ad2015-12-24 01:02:05 -070054
Junxiao Shi0ba6d642017-07-17 00:53:22 +000055BOOST_AUTO_TEST_SUITE(ProcessConfig)
Junxiao Shi38b24c72017-01-05 02:59:31 +000056
Davide Pesavento494a9552018-02-04 22:16:05 -050057BOOST_AUTO_TEST_CASE(Defaults)
58{
59 const std::string CONFIG = R"CONFIG(
60 face_system
61 {
62 tcp
63 }
64 )CONFIG";
65
66 parseConfig(CONFIG, true);
67 parseConfig(CONFIG, false);
68
69 checkChannelListEqual(factory, {"tcp4://0.0.0.0:6363", "tcp6://[::]:6363"});
70 auto channels = factory.getChannels();
71 BOOST_CHECK(std::all_of(channels.begin(), channels.end(),
Davide Pesaventod27841b2018-11-13 00:22:24 -050072 [] (const auto& ch) { return ch->isListening(); }));
Alexander Afanasyevded17422018-04-03 19:00:23 -040073
74 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.size(), 2);
75 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.count("127.0.0.0/8"), 1);
76 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.count("::1/128"), 1);
77 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.size(), 0);
Davide Pesavento494a9552018-02-04 22:16:05 -050078}
79
80BOOST_AUTO_TEST_CASE(DisableListen)
Junxiao Shi38b24c72017-01-05 02:59:31 +000081{
82 const std::string CONFIG = R"CONFIG(
83 face_system
84 {
85 tcp
86 {
Davide Pesavento494a9552018-02-04 22:16:05 -050087 listen no
88 port 7001
89 }
90 }
91 )CONFIG";
92
93 parseConfig(CONFIG, true);
94 parseConfig(CONFIG, false);
95
96 checkChannelListEqual(factory, {"tcp4://0.0.0.0:7001", "tcp6://[::]:7001"});
97 auto channels = factory.getChannels();
98 BOOST_CHECK(std::none_of(channels.begin(), channels.end(),
Davide Pesaventod27841b2018-11-13 00:22:24 -050099 [] (const auto& ch) { return ch->isListening(); }));
Davide Pesavento494a9552018-02-04 22:16:05 -0500100}
101
102BOOST_AUTO_TEST_CASE(DisableV4)
103{
104 const std::string CONFIG = R"CONFIG(
105 face_system
106 {
107 tcp
108 {
109 port 7001
110 enable_v4 no
Junxiao Shi38b24c72017-01-05 02:59:31 +0000111 enable_v6 yes
112 }
113 }
114 )CONFIG";
115
Junxiao Shi1b65ca12017-01-21 23:04:41 +0000116 parseConfig(CONFIG, true);
117 parseConfig(CONFIG, false);
Junxiao Shi38b24c72017-01-05 02:59:31 +0000118
Davide Pesavento494a9552018-02-04 22:16:05 -0500119 checkChannelListEqual(factory, {"tcp6://[::]:7001"});
120}
121
122BOOST_AUTO_TEST_CASE(DisableV6)
123{
124 const std::string CONFIG = R"CONFIG(
125 face_system
126 {
127 tcp
128 {
129 port 7001
130 enable_v4 yes
131 enable_v6 no
132 }
133 }
134 )CONFIG";
135
136 parseConfig(CONFIG, true);
137 parseConfig(CONFIG, false);
138
139 checkChannelListEqual(factory, {"tcp4://0.0.0.0:7001"});
Junxiao Shi38b24c72017-01-05 02:59:31 +0000140}
141
Alexander Afanasyevded17422018-04-03 19:00:23 -0400142BOOST_AUTO_TEST_CASE(ConfigureLocal)
143{
144 const std::string CONFIG = R"CONFIG(
145 face_system
146 {
147 tcp
148 {
149 local {
150 whitelist {
151 subnet 127.0.0.0/8
152 }
153
154 blacklist {
155 subnet ::1/128
156 }
157 }
158 }
159 }
160 )CONFIG";
161
162 parseConfig(CONFIG, true);
163 parseConfig(CONFIG, false);
164
165 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.size(), 1);
166 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.count("127.0.0.0/8"), 1);
167 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.size(), 1);
168 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.count("::1/128"), 1);
169
170 createFace(factory,
171 FaceUri("tcp4://127.0.0.1:6363"),
172 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700173 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Alexander Afanasyevded17422018-04-03 19:00:23 -0400174 {CreateFaceExpectedResult::SUCCESS, 0, ""},
175 [] (const nfd::Face& face) {
176 BOOST_CHECK_EQUAL(face.getScope(), ndn::nfd::FACE_SCOPE_LOCAL);
177 });
178
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400179 limitedIo.defer(100_ms);
Alexander Afanasyevded17422018-04-03 19:00:23 -0400180}
181
182BOOST_AUTO_TEST_CASE(ConfigureNonLocal)
183{
184 const std::string CONFIG = R"CONFIG(
185 face_system
186 {
187 tcp
188 {
189 local {
190 whitelist {
191 *
192 }
193
194 blacklist {
195 subnet 127.0.0.0/8
196 subnet ::1/128
197 }
198 }
199 }
200 }
201 )CONFIG";
202
203 parseConfig(CONFIG, true);
204 parseConfig(CONFIG, false);
205
206 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.size(), 1);
207 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.count("*"), 1);
208 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.size(), 2);
209 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.count("127.0.0.0/8"), 1);
210 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.count("::1/128"), 1);
211
212 createFace(factory,
213 FaceUri("tcp4://127.0.0.1:6363"),
214 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700215 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Alexander Afanasyevded17422018-04-03 19:00:23 -0400216 {CreateFaceExpectedResult::SUCCESS, 0, ""},
217 [] (const nfd::Face& face) {
218 BOOST_CHECK_EQUAL(face.getScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
219 });
220
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400221 limitedIo.defer(100_ms);
Alexander Afanasyevded17422018-04-03 19:00:23 -0400222}
223
Junxiao Shi38b24c72017-01-05 02:59:31 +0000224BOOST_AUTO_TEST_CASE(Omitted)
225{
226 const std::string CONFIG = R"CONFIG(
227 face_system
228 {
229 }
230 )CONFIG";
231
Junxiao Shi1b65ca12017-01-21 23:04:41 +0000232 parseConfig(CONFIG, true);
233 parseConfig(CONFIG, false);
Junxiao Shi38b24c72017-01-05 02:59:31 +0000234
Junxiao Shi38b24c72017-01-05 02:59:31 +0000235 BOOST_CHECK_EQUAL(factory.getChannels().size(), 0);
236}
237
Davide Pesavento494a9552018-02-04 22:16:05 -0500238BOOST_AUTO_TEST_CASE(AllDisabled)
239{
240 const std::string CONFIG = R"CONFIG(
241 face_system
242 {
243 tcp
244 {
245 enable_v4 no
246 enable_v6 no
247 }
248 }
249 )CONFIG";
250
251 BOOST_CHECK_THROW(parseConfig(CONFIG, true), ConfigFile::Error);
252 BOOST_CHECK_THROW(parseConfig(CONFIG, false), ConfigFile::Error);
253}
254
Junxiao Shi38b24c72017-01-05 02:59:31 +0000255BOOST_AUTO_TEST_CASE(BadListen)
256{
257 const std::string CONFIG = R"CONFIG(
258 face_system
259 {
260 tcp
261 {
262 listen hello
263 }
264 }
265 )CONFIG";
266
267 BOOST_CHECK_THROW(parseConfig(CONFIG, true), ConfigFile::Error);
268 BOOST_CHECK_THROW(parseConfig(CONFIG, false), ConfigFile::Error);
269}
270
Davide Pesavento494a9552018-02-04 22:16:05 -0500271BOOST_AUTO_TEST_CASE(BadPort)
Junxiao Shi38b24c72017-01-05 02:59:31 +0000272{
Davide Pesavento494a9552018-02-04 22:16:05 -0500273 // not a number
274 const std::string CONFIG1 = R"CONFIG(
Junxiao Shi38b24c72017-01-05 02:59:31 +0000275 face_system
276 {
277 tcp
278 {
Davide Pesavento494a9552018-02-04 22:16:05 -0500279 port hello
Junxiao Shi38b24c72017-01-05 02:59:31 +0000280 }
281 }
282 )CONFIG";
283
Davide Pesavento494a9552018-02-04 22:16:05 -0500284 BOOST_CHECK_THROW(parseConfig(CONFIG1, true), ConfigFile::Error);
285 BOOST_CHECK_THROW(parseConfig(CONFIG1, false), ConfigFile::Error);
286
287 // negative number
288 const std::string CONFIG2 = R"CONFIG(
289 face_system
290 {
291 tcp
292 {
293 port -1
294 }
295 }
296 )CONFIG";
297
298 BOOST_CHECK_THROW(parseConfig(CONFIG2, true), ConfigFile::Error);
299 BOOST_CHECK_THROW(parseConfig(CONFIG2, false), ConfigFile::Error);
300
301 // out of range
302 const std::string CONFIG3 = R"CONFIG(
303 face_system
304 {
305 tcp
306 {
307 port 65536
308 }
309 }
310 )CONFIG";
311
312 BOOST_CHECK_THROW(parseConfig(CONFIG3, true), ConfigFile::Error);
313 BOOST_CHECK_THROW(parseConfig(CONFIG3, false), ConfigFile::Error);
Junxiao Shi38b24c72017-01-05 02:59:31 +0000314}
315
316BOOST_AUTO_TEST_CASE(UnknownOption)
317{
318 const std::string CONFIG = R"CONFIG(
319 face_system
320 {
321 tcp
322 {
323 hello
324 }
325 }
326 )CONFIG";
327
328 BOOST_CHECK_THROW(parseConfig(CONFIG, true), ConfigFile::Error);
329 BOOST_CHECK_THROW(parseConfig(CONFIG, false), ConfigFile::Error);
330}
331
332BOOST_AUTO_TEST_SUITE_END() // ProcessConfig
333
Davide Pesaventob15276f2017-07-15 16:27:13 -0400334BOOST_AUTO_TEST_CASE(GetChannels)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700335{
Davide Pesaventob15276f2017-07-15 16:27:13 -0400336 BOOST_CHECK_EQUAL(factory.getChannels().empty(), true);
337
338 std::set<std::string> expected;
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400339 expected.insert(createChannel("127.0.0.1", "20070")->getUri().toString());
340 expected.insert(createChannel("127.0.0.1", "20071")->getUri().toString());
341 expected.insert(createChannel("::1", "20071")->getUri().toString());
Davide Pesaventob15276f2017-07-15 16:27:13 -0400342 checkChannelListEqual(factory, expected);
343}
344
345BOOST_AUTO_TEST_CASE(CreateChannel)
346{
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400347 auto channel1 = createChannel("127.0.0.1", "20070");
348 auto channel1a = createChannel("127.0.0.1", "20070");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700349 BOOST_CHECK_EQUAL(channel1, channel1a);
350 BOOST_CHECK_EQUAL(channel1->getUri().toString(), "tcp4://127.0.0.1:20070");
351
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400352 auto channel2 = createChannel("127.0.0.1", "20071");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700353 BOOST_CHECK_NE(channel1, channel2);
354
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400355 auto channel3 = createChannel("::1", "20071");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700356 BOOST_CHECK_NE(channel2, channel3);
357 BOOST_CHECK_EQUAL(channel3->getUri().toString(), "tcp6://[::1]:20071");
358}
359
Davide Pesaventob15276f2017-07-15 16:27:13 -0400360BOOST_AUTO_TEST_CASE(CreateFace)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700361{
Eric Newberry42602412016-08-27 09:33:18 -0700362 createFace(factory,
363 FaceUri("tcp4://127.0.0.1:6363"),
Eric Newberry78e32b02017-04-01 14:34:44 +0000364 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700365 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Eric Newberry42602412016-08-27 09:33:18 -0700366 {CreateFaceExpectedResult::FAILURE, 504, "No channels available to connect"});
Junxiao Shicde37ad2015-12-24 01:02:05 -0700367
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400368 createChannel("127.0.0.1", "20071");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700369
Eric Newberry42602412016-08-27 09:33:18 -0700370 createFace(factory,
Eric Newberry78e32b02017-04-01 14:34:44 +0000371 FaceUri("tcp4://127.0.0.1:6363"),
372 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700373 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Eric Newberry42602412016-08-27 09:33:18 -0700374 {CreateFaceExpectedResult::SUCCESS, 0, ""});
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400375
376 createFace(factory,
377 FaceUri("tcp4://127.0.0.1:6363"),
378 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700379 {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, {}, false, false, false},
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400380 {CreateFaceExpectedResult::SUCCESS, 0, ""});
381
382 createFace(factory,
383 FaceUri("tcp4://127.0.0.1:20072"),
384 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700385 {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, {}, false, false, false},
Eric Newberry2642cd22017-07-13 21:34:53 -0400386 {CreateFaceExpectedResult::SUCCESS, 0, ""});
387
388 createFace(factory,
389 FaceUri("tcp4://127.0.0.1:20073"),
390 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700391 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, true, false},
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700392 {CreateFaceExpectedResult::SUCCESS, 0, ""});
393
394 createFace(factory,
395 FaceUri("tcp4://127.0.0.1:20073"),
396 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700397 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, true},
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400398 {CreateFaceExpectedResult::SUCCESS, 0, ""});
Junxiao Shicde37ad2015-12-24 01:02:05 -0700399}
400
Davide Pesaventob15276f2017-07-15 16:27:13 -0400401BOOST_AUTO_TEST_CASE(UnsupportedCreateFace)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700402{
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400403 createChannel("127.0.0.1", "20071");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700404
Eric Newberry42602412016-08-27 09:33:18 -0700405 createFace(factory,
Davide Pesavento46afec42017-05-28 14:28:47 -0400406 FaceUri("tcp4://127.0.0.1:20072"),
Eric Newberry42602412016-08-27 09:33:18 -0700407 FaceUri("tcp4://127.0.0.1:20071"),
Eric Newberry812d6152018-06-06 15:06:01 -0700408 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Davide Pesavento46afec42017-05-28 14:28:47 -0400409 {CreateFaceExpectedResult::FAILURE, 406,
410 "Unicast TCP faces cannot be created with a LocalUri"});
411
412 createFace(factory,
413 FaceUri("tcp4://127.0.0.1:20072"),
Eric Newberry78e32b02017-04-01 14:34:44 +0000414 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700415 {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, {}, {}, {}, false, false, false},
Eric Newberry42602412016-08-27 09:33:18 -0700416 {CreateFaceExpectedResult::FAILURE, 406,
Davide Pesavento46afec42017-05-28 14:28:47 -0400417 "Outgoing TCP faces do not support on-demand persistency"});
Eric Newberry78e32b02017-04-01 14:34:44 +0000418
419 createFace(factory,
Davide Pesavento46afec42017-05-28 14:28:47 -0400420 FaceUri("tcp4://198.51.100.100:6363"),
421 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700422 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, true, false, false},
Davide Pesavento46afec42017-05-28 14:28:47 -0400423 {CreateFaceExpectedResult::FAILURE, 406,
424 "Local fields can only be enabled on faces with local scope"});
Eric Newberry812d6152018-06-06 15:06:01 -0700425
426 createFace(factory,
427 FaceUri("tcp4://127.0.0.1:20072"),
428 {},
429 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, 1000, false, false, false},
430 {CreateFaceExpectedResult::FAILURE, 406,
431 "TCP faces do not support MTU overrides"});
Junxiao Shicde37ad2015-12-24 01:02:05 -0700432}
433
Davide Pesaventob15276f2017-07-15 16:27:13 -0400434class CreateFaceTimeoutFixture : public TcpFactoryFixture
Junxiao Shicde37ad2015-12-24 01:02:05 -0700435{
436public:
437 void
Davide Pesavento494a9552018-02-04 22:16:05 -0500438 onFaceCreated(const shared_ptr<nfd::Face>& newFace)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700439 {
440 BOOST_CHECK_MESSAGE(false, "Timeout expected");
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400441 face = newFace;
Junxiao Shicde37ad2015-12-24 01:02:05 -0700442
443 limitedIo.afterOp();
444 }
445
446 void
447 onConnectFailed(const std::string& reason)
448 {
449 BOOST_CHECK_MESSAGE(true, reason);
450
451 limitedIo.afterOp();
452 }
453
454public:
Davide Pesavento494a9552018-02-04 22:16:05 -0500455 shared_ptr<nfd::Face> face;
Junxiao Shicde37ad2015-12-24 01:02:05 -0700456};
457
Davide Pesaventob15276f2017-07-15 16:27:13 -0400458BOOST_FIXTURE_TEST_CASE(CreateFaceTimeout, CreateFaceTimeoutFixture)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700459{
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400460 createChannel("0.0.0.0", "20070");
Davide Pesavento15b55052018-01-27 19:09:28 -0500461 factory.createFace({FaceUri("tcp4://192.0.2.1:20070"), {}, {}},
Davide Pesavento412c9822021-07-02 00:21:05 -0400462 std::bind(&CreateFaceTimeoutFixture::onFaceCreated, this, _1),
463 std::bind(&CreateFaceTimeoutFixture::onConnectFailed, this, _2));
Junxiao Shicde37ad2015-12-24 01:02:05 -0700464
Davide Pesavento412c9822021-07-02 00:21:05 -0400465 BOOST_CHECK_EQUAL(limitedIo.run(1, 10_s), LimitedIo::EXCEED_OPS);
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400466 BOOST_CHECK(face == nullptr);
Junxiao Shicde37ad2015-12-24 01:02:05 -0700467}
468
Junxiao Shicde37ad2015-12-24 01:02:05 -0700469BOOST_AUTO_TEST_SUITE_END() // TestTcpFactory
470BOOST_AUTO_TEST_SUITE_END() // Face
471
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400472} // namespace nfd::tests