blob: fba95fe58884d63e3cea25157f27c2e1ffbc4b86 [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 Pesaventoa9b09b62022-06-04 14:07:25 -040032#include <boost/lexical_cast.hpp>
33
Davide Pesaventoe422f9e2022-06-03 01:30:23 -040034namespace nfd::tests {
35
36using face::TcpChannel;
37using face::TcpFactory;
Junxiao Shicde37ad2015-12-24 01:02:05 -070038
Davide Pesavento4b89a6e2017-10-07 15:29:50 -040039class TcpFactoryFixture : public FaceSystemFactoryFixture<TcpFactory>
40{
41protected:
42 shared_ptr<TcpChannel>
43 createChannel(const std::string& localIp, const std::string& localPort)
44 {
Davide Pesavento9c33b902018-05-20 01:30:29 -040045 tcp::Endpoint endpoint(boost::asio::ip::address::from_string(localIp),
Davide Pesavento4b89a6e2017-10-07 15:29:50 -040046 boost::lexical_cast<uint16_t>(localPort));
47 return factory.createChannel(endpoint);
48 }
Alexander Afanasyevded17422018-04-03 19:00:23 -040049
50protected:
51 LimitedIo limitedIo;
Davide Pesavento4b89a6e2017-10-07 15:29:50 -040052};
Junxiao Shi0ba6d642017-07-17 00:53:22 +000053
Junxiao Shicde37ad2015-12-24 01:02:05 -070054BOOST_AUTO_TEST_SUITE(Face)
Junxiao Shi0ba6d642017-07-17 00:53:22 +000055BOOST_FIXTURE_TEST_SUITE(TestTcpFactory, TcpFactoryFixture)
Junxiao Shicde37ad2015-12-24 01:02:05 -070056
Junxiao Shi0ba6d642017-07-17 00:53:22 +000057BOOST_AUTO_TEST_SUITE(ProcessConfig)
Junxiao Shi38b24c72017-01-05 02:59:31 +000058
Davide Pesavento494a9552018-02-04 22:16:05 -050059BOOST_AUTO_TEST_CASE(Defaults)
60{
61 const std::string CONFIG = R"CONFIG(
62 face_system
63 {
64 tcp
65 }
66 )CONFIG";
67
68 parseConfig(CONFIG, true);
69 parseConfig(CONFIG, false);
70
71 checkChannelListEqual(factory, {"tcp4://0.0.0.0:6363", "tcp6://[::]:6363"});
72 auto channels = factory.getChannels();
73 BOOST_CHECK(std::all_of(channels.begin(), channels.end(),
Davide Pesaventod27841b2018-11-13 00:22:24 -050074 [] (const auto& ch) { return ch->isListening(); }));
Alexander Afanasyevded17422018-04-03 19:00:23 -040075
76 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.size(), 2);
77 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.count("127.0.0.0/8"), 1);
78 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.count("::1/128"), 1);
79 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.size(), 0);
Davide Pesavento494a9552018-02-04 22:16:05 -050080}
81
82BOOST_AUTO_TEST_CASE(DisableListen)
Junxiao Shi38b24c72017-01-05 02:59:31 +000083{
84 const std::string CONFIG = R"CONFIG(
85 face_system
86 {
87 tcp
88 {
Davide Pesavento494a9552018-02-04 22:16:05 -050089 listen no
90 port 7001
91 }
92 }
93 )CONFIG";
94
95 parseConfig(CONFIG, true);
96 parseConfig(CONFIG, false);
97
98 checkChannelListEqual(factory, {"tcp4://0.0.0.0:7001", "tcp6://[::]:7001"});
99 auto channels = factory.getChannels();
100 BOOST_CHECK(std::none_of(channels.begin(), channels.end(),
Davide Pesaventod27841b2018-11-13 00:22:24 -0500101 [] (const auto& ch) { return ch->isListening(); }));
Davide Pesavento494a9552018-02-04 22:16:05 -0500102}
103
104BOOST_AUTO_TEST_CASE(DisableV4)
105{
106 const std::string CONFIG = R"CONFIG(
107 face_system
108 {
109 tcp
110 {
111 port 7001
112 enable_v4 no
Junxiao Shi38b24c72017-01-05 02:59:31 +0000113 enable_v6 yes
114 }
115 }
116 )CONFIG";
117
Junxiao Shi1b65ca12017-01-21 23:04:41 +0000118 parseConfig(CONFIG, true);
119 parseConfig(CONFIG, false);
Junxiao Shi38b24c72017-01-05 02:59:31 +0000120
Davide Pesavento494a9552018-02-04 22:16:05 -0500121 checkChannelListEqual(factory, {"tcp6://[::]:7001"});
122}
123
124BOOST_AUTO_TEST_CASE(DisableV6)
125{
126 const std::string CONFIG = R"CONFIG(
127 face_system
128 {
129 tcp
130 {
131 port 7001
132 enable_v4 yes
133 enable_v6 no
134 }
135 }
136 )CONFIG";
137
138 parseConfig(CONFIG, true);
139 parseConfig(CONFIG, false);
140
141 checkChannelListEqual(factory, {"tcp4://0.0.0.0:7001"});
Junxiao Shi38b24c72017-01-05 02:59:31 +0000142}
143
Alexander Afanasyevded17422018-04-03 19:00:23 -0400144BOOST_AUTO_TEST_CASE(ConfigureLocal)
145{
146 const std::string CONFIG = R"CONFIG(
147 face_system
148 {
149 tcp
150 {
151 local {
152 whitelist {
153 subnet 127.0.0.0/8
154 }
155
156 blacklist {
157 subnet ::1/128
158 }
159 }
160 }
161 }
162 )CONFIG";
163
164 parseConfig(CONFIG, true);
165 parseConfig(CONFIG, false);
166
167 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.size(), 1);
168 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.count("127.0.0.0/8"), 1);
169 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.size(), 1);
170 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.count("::1/128"), 1);
171
172 createFace(factory,
173 FaceUri("tcp4://127.0.0.1:6363"),
174 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700175 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Alexander Afanasyevded17422018-04-03 19:00:23 -0400176 {CreateFaceExpectedResult::SUCCESS, 0, ""},
177 [] (const nfd::Face& face) {
178 BOOST_CHECK_EQUAL(face.getScope(), ndn::nfd::FACE_SCOPE_LOCAL);
179 });
180
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400181 limitedIo.defer(100_ms);
Alexander Afanasyevded17422018-04-03 19:00:23 -0400182}
183
184BOOST_AUTO_TEST_CASE(ConfigureNonLocal)
185{
186 const std::string CONFIG = R"CONFIG(
187 face_system
188 {
189 tcp
190 {
191 local {
192 whitelist {
193 *
194 }
195
196 blacklist {
197 subnet 127.0.0.0/8
198 subnet ::1/128
199 }
200 }
201 }
202 }
203 )CONFIG";
204
205 parseConfig(CONFIG, true);
206 parseConfig(CONFIG, false);
207
208 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.size(), 1);
209 BOOST_CHECK_EQUAL(factory.m_local.m_whitelist.count("*"), 1);
210 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.size(), 2);
211 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.count("127.0.0.0/8"), 1);
212 BOOST_CHECK_EQUAL(factory.m_local.m_blacklist.count("::1/128"), 1);
213
214 createFace(factory,
215 FaceUri("tcp4://127.0.0.1:6363"),
216 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700217 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Alexander Afanasyevded17422018-04-03 19:00:23 -0400218 {CreateFaceExpectedResult::SUCCESS, 0, ""},
219 [] (const nfd::Face& face) {
220 BOOST_CHECK_EQUAL(face.getScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
221 });
222
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400223 limitedIo.defer(100_ms);
Alexander Afanasyevded17422018-04-03 19:00:23 -0400224}
225
Junxiao Shi38b24c72017-01-05 02:59:31 +0000226BOOST_AUTO_TEST_CASE(Omitted)
227{
228 const std::string CONFIG = R"CONFIG(
229 face_system
230 {
231 }
232 )CONFIG";
233
Junxiao Shi1b65ca12017-01-21 23:04:41 +0000234 parseConfig(CONFIG, true);
235 parseConfig(CONFIG, false);
Junxiao Shi38b24c72017-01-05 02:59:31 +0000236
Junxiao Shi38b24c72017-01-05 02:59:31 +0000237 BOOST_CHECK_EQUAL(factory.getChannels().size(), 0);
238}
239
Davide Pesavento494a9552018-02-04 22:16:05 -0500240BOOST_AUTO_TEST_CASE(AllDisabled)
241{
242 const std::string CONFIG = R"CONFIG(
243 face_system
244 {
245 tcp
246 {
247 enable_v4 no
248 enable_v6 no
249 }
250 }
251 )CONFIG";
252
253 BOOST_CHECK_THROW(parseConfig(CONFIG, true), ConfigFile::Error);
254 BOOST_CHECK_THROW(parseConfig(CONFIG, false), ConfigFile::Error);
255}
256
Junxiao Shi38b24c72017-01-05 02:59:31 +0000257BOOST_AUTO_TEST_CASE(BadListen)
258{
259 const std::string CONFIG = R"CONFIG(
260 face_system
261 {
262 tcp
263 {
264 listen hello
265 }
266 }
267 )CONFIG";
268
269 BOOST_CHECK_THROW(parseConfig(CONFIG, true), ConfigFile::Error);
270 BOOST_CHECK_THROW(parseConfig(CONFIG, false), ConfigFile::Error);
271}
272
Davide Pesavento494a9552018-02-04 22:16:05 -0500273BOOST_AUTO_TEST_CASE(BadPort)
Junxiao Shi38b24c72017-01-05 02:59:31 +0000274{
Davide Pesavento494a9552018-02-04 22:16:05 -0500275 // not a number
276 const std::string CONFIG1 = R"CONFIG(
Junxiao Shi38b24c72017-01-05 02:59:31 +0000277 face_system
278 {
279 tcp
280 {
Davide Pesavento494a9552018-02-04 22:16:05 -0500281 port hello
Junxiao Shi38b24c72017-01-05 02:59:31 +0000282 }
283 }
284 )CONFIG";
285
Davide Pesavento494a9552018-02-04 22:16:05 -0500286 BOOST_CHECK_THROW(parseConfig(CONFIG1, true), ConfigFile::Error);
287 BOOST_CHECK_THROW(parseConfig(CONFIG1, false), ConfigFile::Error);
288
289 // negative number
290 const std::string CONFIG2 = R"CONFIG(
291 face_system
292 {
293 tcp
294 {
295 port -1
296 }
297 }
298 )CONFIG";
299
300 BOOST_CHECK_THROW(parseConfig(CONFIG2, true), ConfigFile::Error);
301 BOOST_CHECK_THROW(parseConfig(CONFIG2, false), ConfigFile::Error);
302
303 // out of range
304 const std::string CONFIG3 = R"CONFIG(
305 face_system
306 {
307 tcp
308 {
309 port 65536
310 }
311 }
312 )CONFIG";
313
314 BOOST_CHECK_THROW(parseConfig(CONFIG3, true), ConfigFile::Error);
315 BOOST_CHECK_THROW(parseConfig(CONFIG3, false), ConfigFile::Error);
Junxiao Shi38b24c72017-01-05 02:59:31 +0000316}
317
318BOOST_AUTO_TEST_CASE(UnknownOption)
319{
320 const std::string CONFIG = R"CONFIG(
321 face_system
322 {
323 tcp
324 {
325 hello
326 }
327 }
328 )CONFIG";
329
330 BOOST_CHECK_THROW(parseConfig(CONFIG, true), ConfigFile::Error);
331 BOOST_CHECK_THROW(parseConfig(CONFIG, false), ConfigFile::Error);
332}
333
334BOOST_AUTO_TEST_SUITE_END() // ProcessConfig
335
Davide Pesaventob15276f2017-07-15 16:27:13 -0400336BOOST_AUTO_TEST_CASE(GetChannels)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700337{
Davide Pesaventob15276f2017-07-15 16:27:13 -0400338 BOOST_CHECK_EQUAL(factory.getChannels().empty(), true);
339
340 std::set<std::string> expected;
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400341 expected.insert(createChannel("127.0.0.1", "20070")->getUri().toString());
342 expected.insert(createChannel("127.0.0.1", "20071")->getUri().toString());
343 expected.insert(createChannel("::1", "20071")->getUri().toString());
Davide Pesaventob15276f2017-07-15 16:27:13 -0400344 checkChannelListEqual(factory, expected);
345}
346
347BOOST_AUTO_TEST_CASE(CreateChannel)
348{
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400349 auto channel1 = createChannel("127.0.0.1", "20070");
350 auto channel1a = createChannel("127.0.0.1", "20070");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700351 BOOST_CHECK_EQUAL(channel1, channel1a);
352 BOOST_CHECK_EQUAL(channel1->getUri().toString(), "tcp4://127.0.0.1:20070");
353
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400354 auto channel2 = createChannel("127.0.0.1", "20071");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700355 BOOST_CHECK_NE(channel1, channel2);
356
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400357 auto channel3 = createChannel("::1", "20071");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700358 BOOST_CHECK_NE(channel2, channel3);
359 BOOST_CHECK_EQUAL(channel3->getUri().toString(), "tcp6://[::1]:20071");
360}
361
Davide Pesaventob15276f2017-07-15 16:27:13 -0400362BOOST_AUTO_TEST_CASE(CreateFace)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700363{
Eric Newberry42602412016-08-27 09:33:18 -0700364 createFace(factory,
365 FaceUri("tcp4://127.0.0.1:6363"),
Eric Newberry78e32b02017-04-01 14:34:44 +0000366 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700367 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Eric Newberry42602412016-08-27 09:33:18 -0700368 {CreateFaceExpectedResult::FAILURE, 504, "No channels available to connect"});
Junxiao Shicde37ad2015-12-24 01:02:05 -0700369
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400370 createChannel("127.0.0.1", "20071");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700371
Eric Newberry42602412016-08-27 09:33:18 -0700372 createFace(factory,
Eric Newberry78e32b02017-04-01 14:34:44 +0000373 FaceUri("tcp4://127.0.0.1:6363"),
374 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700375 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Eric Newberry42602412016-08-27 09:33:18 -0700376 {CreateFaceExpectedResult::SUCCESS, 0, ""});
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400377
378 createFace(factory,
379 FaceUri("tcp4://127.0.0.1:6363"),
380 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700381 {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, {}, false, false, false},
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400382 {CreateFaceExpectedResult::SUCCESS, 0, ""});
383
384 createFace(factory,
385 FaceUri("tcp4://127.0.0.1:20072"),
386 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700387 {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, {}, false, false, false},
Eric Newberry2642cd22017-07-13 21:34:53 -0400388 {CreateFaceExpectedResult::SUCCESS, 0, ""});
389
390 createFace(factory,
391 FaceUri("tcp4://127.0.0.1:20073"),
392 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700393 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, true, false},
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700394 {CreateFaceExpectedResult::SUCCESS, 0, ""});
395
396 createFace(factory,
397 FaceUri("tcp4://127.0.0.1:20073"),
398 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700399 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, true},
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400400 {CreateFaceExpectedResult::SUCCESS, 0, ""});
Junxiao Shicde37ad2015-12-24 01:02:05 -0700401}
402
Davide Pesaventob15276f2017-07-15 16:27:13 -0400403BOOST_AUTO_TEST_CASE(UnsupportedCreateFace)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700404{
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400405 createChannel("127.0.0.1", "20071");
Junxiao Shicde37ad2015-12-24 01:02:05 -0700406
Eric Newberry42602412016-08-27 09:33:18 -0700407 createFace(factory,
Davide Pesavento46afec42017-05-28 14:28:47 -0400408 FaceUri("tcp4://127.0.0.1:20072"),
Eric Newberry42602412016-08-27 09:33:18 -0700409 FaceUri("tcp4://127.0.0.1:20071"),
Eric Newberry812d6152018-06-06 15:06:01 -0700410 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, false, false, false},
Davide Pesavento46afec42017-05-28 14:28:47 -0400411 {CreateFaceExpectedResult::FAILURE, 406,
412 "Unicast TCP faces cannot be created with a LocalUri"});
413
414 createFace(factory,
415 FaceUri("tcp4://127.0.0.1:20072"),
Eric Newberry78e32b02017-04-01 14:34:44 +0000416 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700417 {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, {}, {}, {}, false, false, false},
Eric Newberry42602412016-08-27 09:33:18 -0700418 {CreateFaceExpectedResult::FAILURE, 406,
Davide Pesavento46afec42017-05-28 14:28:47 -0400419 "Outgoing TCP faces do not support on-demand persistency"});
Eric Newberry78e32b02017-04-01 14:34:44 +0000420
421 createFace(factory,
Davide Pesavento46afec42017-05-28 14:28:47 -0400422 FaceUri("tcp4://198.51.100.100:6363"),
423 {},
Eric Newberry812d6152018-06-06 15:06:01 -0700424 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, {}, true, false, false},
Davide Pesavento46afec42017-05-28 14:28:47 -0400425 {CreateFaceExpectedResult::FAILURE, 406,
426 "Local fields can only be enabled on faces with local scope"});
Eric Newberry812d6152018-06-06 15:06:01 -0700427
428 createFace(factory,
429 FaceUri("tcp4://127.0.0.1:20072"),
430 {},
431 {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, 1000, false, false, false},
432 {CreateFaceExpectedResult::FAILURE, 406,
433 "TCP faces do not support MTU overrides"});
Junxiao Shicde37ad2015-12-24 01:02:05 -0700434}
435
Davide Pesaventob15276f2017-07-15 16:27:13 -0400436class CreateFaceTimeoutFixture : public TcpFactoryFixture
Junxiao Shicde37ad2015-12-24 01:02:05 -0700437{
438public:
439 void
Davide Pesavento494a9552018-02-04 22:16:05 -0500440 onFaceCreated(const shared_ptr<nfd::Face>& newFace)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700441 {
442 BOOST_CHECK_MESSAGE(false, "Timeout expected");
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400443 face = newFace;
Junxiao Shicde37ad2015-12-24 01:02:05 -0700444
445 limitedIo.afterOp();
446 }
447
448 void
449 onConnectFailed(const std::string& reason)
450 {
451 BOOST_CHECK_MESSAGE(true, reason);
452
453 limitedIo.afterOp();
454 }
455
456public:
Davide Pesavento494a9552018-02-04 22:16:05 -0500457 shared_ptr<nfd::Face> face;
Junxiao Shicde37ad2015-12-24 01:02:05 -0700458};
459
Davide Pesaventob15276f2017-07-15 16:27:13 -0400460BOOST_FIXTURE_TEST_CASE(CreateFaceTimeout, CreateFaceTimeoutFixture)
Junxiao Shicde37ad2015-12-24 01:02:05 -0700461{
Davide Pesavento4b89a6e2017-10-07 15:29:50 -0400462 createChannel("0.0.0.0", "20070");
Davide Pesavento15b55052018-01-27 19:09:28 -0500463 factory.createFace({FaceUri("tcp4://192.0.2.1:20070"), {}, {}},
Davide Pesavento412c9822021-07-02 00:21:05 -0400464 std::bind(&CreateFaceTimeoutFixture::onFaceCreated, this, _1),
465 std::bind(&CreateFaceTimeoutFixture::onConnectFailed, this, _2));
Junxiao Shicde37ad2015-12-24 01:02:05 -0700466
Davide Pesavento412c9822021-07-02 00:21:05 -0400467 BOOST_CHECK_EQUAL(limitedIo.run(1, 10_s), LimitedIo::EXCEED_OPS);
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400468 BOOST_CHECK(face == nullptr);
Junxiao Shicde37ad2015-12-24 01:02:05 -0700469}
470
Junxiao Shicde37ad2015-12-24 01:02:05 -0700471BOOST_AUTO_TEST_SUITE_END() // TestTcpFactory
472BOOST_AUTO_TEST_SUITE_END() // Face
473
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400474} // namespace nfd::tests