blob: 8f789c6bb012f6d688763de76a1aec6a832620a3 [file] [log] [blame]
Yanbiao Li73860e32015-08-19 16:30:16 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Junxiao Shi60286192017-07-26 01:07:48 +00002/*
Davide Pesaventof56cf632024-01-27 22:22:06 -05003 * Copyright (c) 2014-2024, Regents of the University of California,
Yanbiao Li73860e32015-08-19 16:30:16 -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
Yanbiao Li58ba3f92017-02-15 14:27:18 +000026#include "mgmt/face-manager.hpp"
Eric Newberry0c3e57b2018-01-25 20:54:46 -070027#include "face/generic-link-service.hpp"
Davide Pesaventof56cf632024-01-27 22:22:06 -050028
Eric Newberry42602412016-08-27 09:33:18 -070029#include "face-manager-command-fixture.hpp"
Junxiao Shib84e6742016-07-19 13:16:22 +000030
Davide Pesaventof56cf632024-01-27 22:22:06 -050031#include <boost/mp11/list.hpp>
32
Davide Pesaventoe422f9e2022-06-03 01:30:23 -040033namespace nfd::tests {
Yanbiao Li73860e32015-08-19 16:30:16 -070034
Yanbiao Li73860e32015-08-19 16:30:16 -070035BOOST_AUTO_TEST_SUITE(Mgmt)
36BOOST_AUTO_TEST_SUITE(TestFaceManager)
37
Davide Pesaventocf7db2f2019-03-24 23:17:28 -040038BOOST_FIXTURE_TEST_SUITE(CreateFace, GlobalIoFixture)
Yanbiao Li73860e32015-08-19 16:30:16 -070039
Yanbiao Li73860e32015-08-19 16:30:16 -070040class TcpFaceOnDemand
41{
42public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -040043 static ControlParameters
Yanbiao Li73860e32015-08-19 16:30:16 -070044 getParameters()
45 {
46 return ControlParameters()
47 .setUri("tcp4://127.0.0.1:26363")
48 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
49 }
50};
51
52class TcpFacePersistent
53{
54public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -040055 static ControlParameters
Yanbiao Li73860e32015-08-19 16:30:16 -070056 getParameters()
57 {
58 return ControlParameters()
59 .setUri("tcp4://127.0.0.1:26363")
60 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
61 }
62};
63
64class TcpFacePermanent
65{
66public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -040067 static ControlParameters
Yanbiao Li73860e32015-08-19 16:30:16 -070068 getParameters()
69 {
70 return ControlParameters()
71 .setUri("tcp4://127.0.0.1:26363")
72 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERMANENT);
73 }
74};
75
76class UdpFaceOnDemand
77{
78public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -040079 static ControlParameters
Yanbiao Li73860e32015-08-19 16:30:16 -070080 getParameters()
81 {
82 return ControlParameters()
83 .setUri("udp4://127.0.0.1:26363")
84 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
85 }
86};
87
Yanbiao Li73860e32015-08-19 16:30:16 -070088class UdpFacePersistent
89{
90public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -040091 static ControlParameters
Yanbiao Li73860e32015-08-19 16:30:16 -070092 getParameters()
93 {
94 return ControlParameters()
95 .setUri("udp4://127.0.0.1:26363")
96 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
97 }
98};
99
100class UdpFacePermanent
101{
102public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400103 static ControlParameters
Yanbiao Li73860e32015-08-19 16:30:16 -0700104 getParameters()
105 {
106 return ControlParameters()
107 .setUri("udp4://127.0.0.1:26363")
108 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERMANENT);
109 }
110};
111
Eric Newberryf40551a2016-09-05 15:41:16 -0700112class LocalTcpFaceLocalFieldsEnabled
113{
114public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400115 static ControlParameters
Eric Newberryf40551a2016-09-05 15:41:16 -0700116 getParameters()
117 {
118 return ControlParameters()
119 .setUri("tcp4://127.0.0.1:26363")
120 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
121 .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, true);
122 }
123};
124
125class LocalTcpFaceLocalFieldsDisabled
126{
127public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400128 static ControlParameters
Eric Newberryf40551a2016-09-05 15:41:16 -0700129 getParameters()
130 {
131 return ControlParameters()
132 .setUri("tcp4://127.0.0.1:26363")
133 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
134 .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, false);
135 }
136};
137
138class NonLocalUdpFaceLocalFieldsEnabled // won't work because non-local scope
139{
140public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400141 static ControlParameters
Eric Newberryf40551a2016-09-05 15:41:16 -0700142 getParameters()
143 {
144 return ControlParameters()
145 .setUri("udp4://127.0.0.1:26363")
146 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
147 .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, true);
148 }
149};
150
151class NonLocalUdpFaceLocalFieldsDisabled
152{
153public:
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400154 static ControlParameters
Eric Newberryf40551a2016-09-05 15:41:16 -0700155 getParameters()
156 {
157 return ControlParameters()
158 .setUri("udp4://127.0.0.1:26363")
159 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
160 .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, false);
161 }
162};
163
Eric Newberry2642cd22017-07-13 21:34:53 -0400164class TcpFaceLpReliabilityEnabled
165{
166public:
167 static ControlParameters
168 getParameters()
169 {
170 return ControlParameters()
171 .setUri("tcp4://127.0.0.1:26363")
172 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
173 .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, true);
174 }
175};
176
177class TcpFaceLpReliabilityDisabled
178{
179public:
180 static ControlParameters
181 getParameters()
182 {
183 return ControlParameters()
184 .setUri("tcp4://127.0.0.1:26363")
185 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
186 .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, false);
187 }
188};
189
190class UdpFaceLpReliabilityEnabled
191{
192public:
193 static ControlParameters
194 getParameters()
195 {
196 return ControlParameters()
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700197 .setUri("udp4://127.0.0.1:26363")
Eric Newberry2642cd22017-07-13 21:34:53 -0400198 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
199 .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, true);
200 }
201};
202
203class UdpFaceLpReliabilityDisabled
204{
205public:
206 static ControlParameters
207 getParameters()
208 {
209 return ControlParameters()
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700210 .setUri("udp4://127.0.0.1:26363")
Eric Newberry2642cd22017-07-13 21:34:53 -0400211 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
212 .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, false);
213 }
214};
215
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700216class TcpFaceCongestionMarkingEnabled
217{
218public:
219 static ControlParameters
220 getParameters()
221 {
222 return ControlParameters()
223 .setUri("tcp4://127.0.0.1:26363")
224 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
225 .setBaseCongestionMarkingInterval(50_ms)
226 .setDefaultCongestionThreshold(1000)
227 .setFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED, true);
228 }
229};
230
231class TcpFaceCongestionMarkingDisabled
232{
233public:
234 static ControlParameters
235 getParameters()
236 {
237 return ControlParameters()
238 .setUri("tcp4://127.0.0.1:26363")
239 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
240 .setBaseCongestionMarkingInterval(50_ms)
241 .setDefaultCongestionThreshold(1000)
242 .setFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED, false);
243 }
244};
245
Eric Newberry812d6152018-06-06 15:06:01 -0700246class TcpFaceMtuOverride
247{
248public:
249 static ControlParameters
250 getParameters()
251 {
252 return ControlParameters()
253 .setUri("tcp4://127.0.0.1:26363")
254 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
255 .setMtu(1000);
256 }
257};
258
259class UdpFaceMtuOverride
260{
261public:
262 static ControlParameters
263 getParameters()
264 {
265 return ControlParameters()
266 .setUri("udp4://127.0.0.1:26363")
267 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
268 .setMtu(1000);
269 }
270};
271
Junxiao Shi38c7d9e2017-04-13 14:22:50 +0000272class FaceUriMalformed
273{
274public:
275 static ControlParameters
276 getParameters()
277 {
278 return ControlParameters()
279 .setUri("tcp4://127.0.0.1:not-a-port");
280 }
281};
282
283class FaceUriNonCanonical
284{
285public:
286 static ControlParameters
287 getParameters()
288 {
289 return ControlParameters()
290 .setUri("udp://localhost");
291 }
292};
293
294class FaceUriUnsupportedScheme
295{
296public:
297 static ControlParameters
298 getParameters()
299 {
300 return ControlParameters()
301 .setUri("dev://eth0");
302 }
303};
304
Davide Pesaventof56cf632024-01-27 22:22:06 -0500305// Pairs of CreateCommand and success/failure status
306using TestCases = boost::mp11::mp_list<
307 boost::mp11::mp_list<TcpFaceOnDemand, CommandFailure<406>>,
308 boost::mp11::mp_list<TcpFacePersistent, CommandSuccess>,
309 boost::mp11::mp_list<TcpFacePermanent, CommandSuccess>,
310 boost::mp11::mp_list<UdpFaceOnDemand, CommandFailure<406>>,
311 boost::mp11::mp_list<UdpFacePersistent, CommandSuccess>,
312 boost::mp11::mp_list<UdpFacePermanent, CommandSuccess>,
313 boost::mp11::mp_list<LocalTcpFaceLocalFieldsEnabled, CommandSuccess>,
314 boost::mp11::mp_list<LocalTcpFaceLocalFieldsDisabled, CommandSuccess>,
315 boost::mp11::mp_list<NonLocalUdpFaceLocalFieldsEnabled, CommandFailure<406>>,
316 boost::mp11::mp_list<NonLocalUdpFaceLocalFieldsDisabled, CommandSuccess>,
317 boost::mp11::mp_list<TcpFaceLpReliabilityEnabled, CommandSuccess>,
318 boost::mp11::mp_list<TcpFaceLpReliabilityDisabled, CommandSuccess>,
319 boost::mp11::mp_list<UdpFaceLpReliabilityEnabled, CommandSuccess>,
320 boost::mp11::mp_list<UdpFaceLpReliabilityDisabled, CommandSuccess>,
321 boost::mp11::mp_list<TcpFaceCongestionMarkingEnabled, CommandSuccess>,
322 boost::mp11::mp_list<TcpFaceCongestionMarkingDisabled, CommandSuccess>,
323 boost::mp11::mp_list<TcpFaceMtuOverride, CommandFailure<406>>,
324 boost::mp11::mp_list<UdpFaceMtuOverride, CommandSuccess>,
325 boost::mp11::mp_list<FaceUriMalformed, CommandFailure<400>>,
326 boost::mp11::mp_list<FaceUriNonCanonical, CommandFailure<400>>,
327 boost::mp11::mp_list<FaceUriUnsupportedScheme, CommandFailure<406>>
328>;
Yanbiao Li73860e32015-08-19 16:30:16 -0700329
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400330BOOST_FIXTURE_TEST_CASE_TEMPLATE(NewFace, T, TestCases, FaceManagerCommandFixture)
Yanbiao Li73860e32015-08-19 16:30:16 -0700331{
Davide Pesaventof56cf632024-01-27 22:22:06 -0500332 using FaceType = boost::mp11::mp_first<T>;
333 using CreateResult = boost::mp11::mp_second<T>;
Yanbiao Li73860e32015-08-19 16:30:16 -0700334
Junxiao Shi8a1f1702017-07-03 00:05:08 +0000335 Interest req = makeControlCommandRequest("/localhost/nfd/faces/create", FaceType::getParameters());
Yanbiao Li73860e32015-08-19 16:30:16 -0700336
337 bool hasCallbackFired = false;
Junxiao Shi8a1f1702017-07-03 00:05:08 +0000338 this->node1.face.onSendData.connect([this, req, &hasCallbackFired] (const Data& response) {
339 if (!req.getName().isPrefixOf(response.getName())) {
Eric Newberry42602412016-08-27 09:33:18 -0700340 return;
341 }
Yanbiao Li73860e32015-08-19 16:30:16 -0700342
Eric Newberry42602412016-08-27 09:33:18 -0700343 ControlResponse actual(response.getContent().blockFromValue());
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400344 ControlResponse expected(CreateResult::getExpected());
Eric Newberry42602412016-08-27 09:33:18 -0700345 BOOST_TEST_MESSAGE(actual.getText());
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000346 BOOST_CHECK_EQUAL(expected.getCode(), actual.getCode());
Yanbiao Li73860e32015-08-19 16:30:16 -0700347
Eric Newberry42602412016-08-27 09:33:18 -0700348 if (actual.getBody().hasWire()) {
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400349 ControlParameters expectedParams(FaceType::getParameters());
Eric Newberry42602412016-08-27 09:33:18 -0700350 ControlParameters actualParams(actual.getBody());
Yanbiao Li73860e32015-08-19 16:30:16 -0700351
Eric Newberry42602412016-08-27 09:33:18 -0700352 BOOST_CHECK(actualParams.hasFaceId());
353 BOOST_CHECK_EQUAL(expectedParams.getFacePersistency(), actualParams.getFacePersistency());
354
Eric Newberryb5aa7f52016-09-03 20:36:12 -0700355 if (actual.getCode() == 200) {
356 if (expectedParams.hasFlags()) {
Eric Newberryf40551a2016-09-05 15:41:16 -0700357 BOOST_CHECK_EQUAL(expectedParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED),
358 actualParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED));
Eric Newberry2642cd22017-07-13 21:34:53 -0400359 BOOST_CHECK_EQUAL(expectedParams.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED),
360 actualParams.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED));
Eric Newberry17d18492018-02-10 22:50:06 -0700361 if (expectedParams.hasFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED)) {
362 BOOST_CHECK_EQUAL(expectedParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED),
363 actualParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED));
364 }
365 else {
366 BOOST_CHECK(actualParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED));
367 }
Eric Newberryb5aa7f52016-09-03 20:36:12 -0700368 }
369 else {
Eric Newberry17d18492018-02-10 22:50:06 -0700370 // local fields and LpReliability are disabled by default, congestion marking is enabled
371 // by default on TCP, UDP, and Unix stream
372 BOOST_CHECK(!actualParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED));
373 BOOST_CHECK(!actualParams.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED));
374 BOOST_CHECK(actualParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED));
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700375 }
376
377 if (expectedParams.hasBaseCongestionMarkingInterval()) {
378 BOOST_CHECK_EQUAL(expectedParams.getBaseCongestionMarkingInterval(),
379 actualParams.getBaseCongestionMarkingInterval());
380 }
381 else {
382 BOOST_CHECK_EQUAL(actualParams.getBaseCongestionMarkingInterval(), 100_ms);
383 }
384
385 if (expectedParams.hasDefaultCongestionThreshold()) {
386 BOOST_CHECK_EQUAL(expectedParams.getDefaultCongestionThreshold(),
387 actualParams.getDefaultCongestionThreshold());
388 }
389 else {
390 BOOST_CHECK_EQUAL(actualParams.getDefaultCongestionThreshold(), 65536);
Eric Newberryb5aa7f52016-09-03 20:36:12 -0700391 }
Eric Newberry812d6152018-06-06 15:06:01 -0700392
393 if (expectedParams.hasMtu()) {
394 BOOST_CHECK_EQUAL(expectedParams.getMtu(), actualParams.getMtu());
395 }
Eric Newberryb5aa7f52016-09-03 20:36:12 -0700396 }
397 else {
Yanbiao Li73860e32015-08-19 16:30:16 -0700398 BOOST_CHECK_EQUAL(expectedParams.getUri(), actualParams.getUri());
Yanbiao Li73860e32015-08-19 16:30:16 -0700399 }
Eric Newberry42602412016-08-27 09:33:18 -0700400 }
Eric Newberryb5aa7f52016-09-03 20:36:12 -0700401
402 if (actual.getCode() != 200) {
Junxiao Shi38c7d9e2017-04-13 14:22:50 +0000403 FaceUri uri;
404 if (uri.parse(FaceType::getParameters().getUri())) {
405 // ensure face not created
Davide Pesaventob5eee202017-09-21 23:59:22 -0400406 const auto& faceTable = this->node1.faceTable;
Junxiao Shi38c7d9e2017-04-13 14:22:50 +0000407 BOOST_CHECK(std::none_of(faceTable.begin(), faceTable.end(), [uri] (Face& face) {
408 return face.getRemoteUri() == uri;
409 }));
410 }
411 else {
412 // do not check malformed FaceUri
413 }
Eric Newberryb5aa7f52016-09-03 20:36:12 -0700414 }
415
Eric Newberry42602412016-08-27 09:33:18 -0700416 hasCallbackFired = true;
417 });
Yanbiao Li73860e32015-08-19 16:30:16 -0700418
Junxiao Shi8a1f1702017-07-03 00:05:08 +0000419 this->node1.face.receive(req);
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700420 this->advanceClocks(1_ms, 5);
Yanbiao Li73860e32015-08-19 16:30:16 -0700421
422 BOOST_CHECK(hasCallbackFired);
423}
424
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000425BOOST_FIXTURE_TEST_CASE(ExistingFace, FaceManagerCommandFixture)
Yanbiao Li73860e32015-08-19 16:30:16 -0700426{
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000427 using FaceType = UdpFacePersistent;
Yanbiao Li73860e32015-08-19 16:30:16 -0700428
429 {
430 // create face
Junxiao Shi8a1f1702017-07-03 00:05:08 +0000431 Interest req = makeControlCommandRequest("/localhost/nfd/faces/create", FaceType::getParameters());
432 this->node1.face.receive(req);
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700433 this->advanceClocks(1_ms, 5);
Yanbiao Li73860e32015-08-19 16:30:16 -0700434 }
435
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000436 // find the created face
Davide Pesaventoa3c9ddb2017-04-10 22:15:24 -0400437 auto foundFace = this->node1.findFaceByUri(FaceType::getParameters().getUri());
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000438 BOOST_REQUIRE(foundFace != nullptr);
Yanbiao Li73860e32015-08-19 16:30:16 -0700439
440 {
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000441 // re-create face
Junxiao Shi8a1f1702017-07-03 00:05:08 +0000442 Interest req = makeControlCommandRequest("/localhost/nfd/faces/create", FaceType::getParameters());
Yanbiao Li73860e32015-08-19 16:30:16 -0700443
444 bool hasCallbackFired = false;
Junxiao Shib84e6742016-07-19 13:16:22 +0000445 this->node1.face.onSendData.connect(
Davide Pesaventoac238f22017-09-12 15:19:40 -0400446 [req, foundFace, &hasCallbackFired] (const Data& response) {
Junxiao Shi8a1f1702017-07-03 00:05:08 +0000447 if (!req.getName().isPrefixOf(response.getName())) {
Yanbiao Li73860e32015-08-19 16:30:16 -0700448 return;
449 }
450
451 ControlResponse actual(response.getContent().blockFromValue());
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000452 BOOST_REQUIRE_EQUAL(actual.getCode(), 409);
Yanbiao Li73860e32015-08-19 16:30:16 -0700453
Yanbiao Li73860e32015-08-19 16:30:16 -0700454 ControlParameters actualParams(actual.getBody());
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000455 BOOST_CHECK_EQUAL(foundFace->getId(), actualParams.getFaceId());
456 BOOST_CHECK_EQUAL(foundFace->getRemoteUri().toString(), actualParams.getUri());
457 BOOST_CHECK_EQUAL(foundFace->getPersistency(), actualParams.getFacePersistency());
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700458 auto linkService = dynamic_cast<face::GenericLinkService*>(foundFace->getLinkService());
459 BOOST_CHECK_EQUAL(linkService->getOptions().baseCongestionMarkingInterval,
460 actualParams.getBaseCongestionMarkingInterval());
461 BOOST_CHECK_EQUAL(linkService->getOptions().defaultCongestionThreshold,
462 actualParams.getDefaultCongestionThreshold());
Yanbiao Li73860e32015-08-19 16:30:16 -0700463
464 hasCallbackFired = true;
465 });
466
Junxiao Shi8a1f1702017-07-03 00:05:08 +0000467 this->node1.face.receive(req);
Eric Newberry0c3e57b2018-01-25 20:54:46 -0700468 this->advanceClocks(1_ms, 5);
Yanbiao Li73860e32015-08-19 16:30:16 -0700469
470 BOOST_CHECK(hasCallbackFired);
471 }
472}
473
474BOOST_AUTO_TEST_SUITE_END() // CreateFace
475BOOST_AUTO_TEST_SUITE_END() // TestFaceManager
476BOOST_AUTO_TEST_SUITE_END() // Mgmt
477
Davide Pesaventoe422f9e2022-06-03 01:30:23 -0400478} // namespace nfd::tests