blob: 5b44a5b252a39e366faf9a89852e780091426527 [file] [log] [blame]
Junxiao Shi38f4ce92016-08-04 10:01:52 +00001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Junxiao Shi1f481fa2017-01-26 15:14:43 +00003 * Copyright (c) 2014-2017, Regents of the University of California,
Junxiao Shi38f4ce92016-08-04 10:01:52 +00004 * 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
Junxiao Shi331ade72016-08-19 14:07:19 +000026#include "nfdc/face-module.hpp"
Junxiao Shi1d7fef52017-02-02 05:33:14 +000027#include <ndn-cxx/mgmt/nfd/face-query-filter.hpp>
Junxiao Shi38f4ce92016-08-04 10:01:52 +000028
Junxiao Shi1f481fa2017-01-26 15:14:43 +000029#include "execute-command-fixture.hpp"
30#include "status-fixture.hpp"
Junxiao Shi38f4ce92016-08-04 10:01:52 +000031
32namespace nfd {
33namespace tools {
Junxiao Shi331ade72016-08-19 14:07:19 +000034namespace nfdc {
Junxiao Shi38f4ce92016-08-04 10:01:52 +000035namespace tests {
36
Junxiao Shi1d7fef52017-02-02 05:33:14 +000037using ndn::nfd::FaceQueryFilter;
38
Junxiao Shi331ade72016-08-19 14:07:19 +000039BOOST_AUTO_TEST_SUITE(Nfdc)
Junxiao Shi1f481fa2017-01-26 15:14:43 +000040BOOST_AUTO_TEST_SUITE(TestFaceModule)
41
42BOOST_FIXTURE_TEST_SUITE(ShowCommand, ExecuteCommandFixture)
43
Junxiao Shi1f481fa2017-01-26 15:14:43 +000044const std::string NORMAL_OUTPUT = std::string(R"TEXT(
45 faceid=256
46 remote=udp4://84.67.35.111:6363
47 local=udp4://79.91.49.215:6363
48counters={in={28975i 28232d 212n 13307258B} out={19525i 30993d 1038n 6231946B}}
49 flags={non-local on-demand point-to-point}
50)TEXT").substr(1);
51
52BOOST_AUTO_TEST_CASE(Normal)
53{
54 this->processInterest = [this] (const Interest& interest) {
Junxiao Shi8f803f22017-02-10 03:04:28 +000055 BOOST_CHECK_EQUAL(interest.getName().size(), 5);
56 FaceQueryFilter filter(interest.getName().at(4).blockFromValue());
57 BOOST_CHECK_EQUAL(filter, FaceQueryFilter().setFaceId(256));
Junxiao Shi1f481fa2017-01-26 15:14:43 +000058
59 FaceStatus payload;
60 payload.setFaceId(256)
61 .setRemoteUri("udp4://84.67.35.111:6363")
62 .setLocalUri("udp4://79.91.49.215:6363")
63 .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
64 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND)
65 .setLinkType(ndn::nfd::LINK_TYPE_POINT_TO_POINT)
66 .setNInInterests(28975)
67 .setNInDatas(28232)
68 .setNInNacks(212)
69 .setNOutInterests(19525)
70 .setNOutDatas(30993)
71 .setNOutNacks(1038)
72 .setNInBytes(13307258)
73 .setNOutBytes(6231946);
74
Junxiao Shi8f803f22017-02-10 03:04:28 +000075 this->sendDataset(interest.getName(), payload);
Junxiao Shi1f481fa2017-01-26 15:14:43 +000076 };
77
78 this->execute("face show 256");
79 BOOST_CHECK_EQUAL(exitCode, 0);
80 BOOST_CHECK(out.is_equal(NORMAL_OUTPUT));
81 BOOST_CHECK(err.is_empty());
82}
83
84BOOST_AUTO_TEST_CASE(NotFound)
85{
86 this->processInterest = [this] (const Interest& interest) {
87 this->sendEmptyDataset(interest.getName());
88 };
89
90 this->execute("face show 256");
91 BOOST_CHECK_EQUAL(exitCode, 3);
92 BOOST_CHECK(out.is_empty());
Junxiao Shi8f803f22017-02-10 03:04:28 +000093 BOOST_CHECK(err.is_equal("Face not found\n"));
Junxiao Shi1f481fa2017-01-26 15:14:43 +000094}
95
96BOOST_AUTO_TEST_CASE(Error)
97{
98 this->processInterest = nullptr; // no response
99
100 this->execute("face show 256");
101 BOOST_CHECK_EQUAL(exitCode, 1);
102 BOOST_CHECK(out.is_empty());
Junxiao Shi8f803f22017-02-10 03:04:28 +0000103 BOOST_CHECK(err.is_equal("Error 10060 when querying face: Timeout\n"));
Junxiao Shi1f481fa2017-01-26 15:14:43 +0000104}
105
106BOOST_AUTO_TEST_SUITE_END() // ShowCommand
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000107
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000108class ExecuteFaceCreateCommandFixture : public ExecuteCommandFixture
109{
110protected:
111 void
112 respond409(FacePersistency persistency)
113 {
114 MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/create");
115 ControlParameters body;
116 body.setFaceId(1172)
117 .setUri("udp4://100.77.30.65:6363")
118 .setFacePersistency(persistency)
119 .setFlags(0);
120 this->failCommand(409, "conflict-409", body);
121 }
122};
Junxiao Shi1d7fef52017-02-02 05:33:14 +0000123
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000124BOOST_FIXTURE_TEST_SUITE(CreateCommand, ExecuteFaceCreateCommandFixture)
125
126BOOST_AUTO_TEST_CASE(Creating)
Junxiao Shi1d7fef52017-02-02 05:33:14 +0000127{
128 this->processInterest = [this] (const Interest& interest) {
129 ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/create");
130 BOOST_REQUIRE(req.hasUri());
131 BOOST_CHECK_EQUAL(req.getUri(), "udp4://159.242.33.78:6363");
132 BOOST_REQUIRE(req.hasFacePersistency());
133 BOOST_CHECK_EQUAL(req.getFacePersistency(), FacePersistency::FACE_PERSISTENCY_PERSISTENT);
134
135 ControlParameters resp;
136 resp.setFaceId(2130)
Junxiao Shi1d7fef52017-02-02 05:33:14 +0000137 .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
138 this->succeedCommand(resp);
139 };
140
141 this->execute("face create udp://159.242.33.78");
142 BOOST_CHECK_EQUAL(exitCode, 0);
143 BOOST_CHECK(out.is_equal("face-created id=2130 remote=udp4://159.242.33.78:6363 persistency=persistent\n"));
144 BOOST_CHECK(err.is_empty());
145}
146
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000147BOOST_AUTO_TEST_CASE(UpgradingPersistency)
148{
149 bool hasUpdateCommand = false;
150 this->processInterest = [this, &hasUpdateCommand] (const Interest& interest) {
151 if (this->getCommand("/localhost/nfd/faces/create")) {
152 this->respond409(FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
153 return;
154 }
155
156 ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/update");
157 hasUpdateCommand = true;
158 BOOST_REQUIRE(req.hasFaceId());
159 BOOST_CHECK_EQUAL(req.getFaceId(), 1172);
160 BOOST_REQUIRE(req.hasFacePersistency());
161 BOOST_CHECK_EQUAL(req.getFacePersistency(), FacePersistency::FACE_PERSISTENCY_PERSISTENT);
162 BOOST_CHECK(!req.hasFlags());
163
164 ControlParameters resp;
165 resp.setFaceId(1172)
166 .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT)
167 .setFlags(0);
168 this->succeedCommand(resp);
169 };
170
171 this->execute("face create udp://100.77.30.65");
172 BOOST_CHECK(hasUpdateCommand);
173 BOOST_CHECK_EQUAL(exitCode, 0);
174 BOOST_CHECK(out.is_equal("face-updated id=1172 remote=udp4://100.77.30.65:6363 persistency=persistent\n"));
175 BOOST_CHECK(err.is_empty());
176}
177
178BOOST_AUTO_TEST_CASE(NotDowngradingPersistency)
179{
180 this->processInterest = [this] (const Interest& interest) {
181 this->respond409(FacePersistency::FACE_PERSISTENCY_PERMANENT);
182 // no command other than faces/create is expected
183 };
184
185 this->execute("face create udp://100.77.30.65");
186 BOOST_CHECK_EQUAL(exitCode, 0);
187 BOOST_CHECK(out.is_equal("face-exists id=1172 remote=udp4://100.77.30.65:6363 persistency=permanent\n"));
188 BOOST_CHECK(err.is_empty());
189}
190
191BOOST_AUTO_TEST_CASE(SamePersistency)
192{
193 this->processInterest = [this] (const Interest& interest) {
194 this->respond409(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
195 // no command other than faces/create is expected
196 };
197
198 this->execute("face create udp://100.77.30.65");
199 BOOST_CHECK_EQUAL(exitCode, 0);
200 BOOST_CHECK(out.is_equal("face-exists id=1172 remote=udp4://100.77.30.65:6363 persistency=persistent\n"));
201 BOOST_CHECK(err.is_empty());
202}
203
204BOOST_AUTO_TEST_CASE(ErrorCreate)
Junxiao Shi1d7fef52017-02-02 05:33:14 +0000205{
206 this->processInterest = nullptr; // no response
207
208 this->execute("face create udp://159.242.33.78");
209 BOOST_CHECK_EQUAL(exitCode, 1);
210 BOOST_CHECK(out.is_empty());
211 BOOST_CHECK(err.is_equal("Error 10060 when creating face: request timed out\n"));
212}
213
Yanbiao Li58ba3f92017-02-15 14:27:18 +0000214BOOST_AUTO_TEST_CASE(ErrorConflict)
215{
216 // Current NFD will not report a 409-conflict with a different remote FaceUri, but this is
217 // allowed by FaceMgmt protocol and nfdc should not attempt to upgrade persistency in this case.
218
219 this->processInterest = [this] (const Interest& interest) {
220 // conflict with udp4://100.77.30.65:6363
221 this->respond409(FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
222 };
223
224 this->execute("face create udp://20.53.73.45");
225 BOOST_CHECK_EQUAL(exitCode, 1);
226 BOOST_CHECK(out.is_empty());
227 BOOST_CHECK(err.is_equal("Error 409 when creating face: conflict-409\n"));
228}
229
230BOOST_AUTO_TEST_CASE(ErrorUpdate)
231{
232 this->processInterest = [this] (const Interest& interest) {
233 if (this->getCommand("/localhost/nfd/faces/create")) {
234 this->respond409(FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
235 return;
236 }
237
238 MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/update");
239 // no response to faces/update
240 };
241
242 this->execute("face create udp://100.77.30.65");
243 BOOST_CHECK_EQUAL(exitCode, 1);
244 BOOST_CHECK(out.is_empty());
245 BOOST_CHECK(err.is_equal("Error 10060 when upgrading face persistency: request timed out\n"));
246}
247
Junxiao Shi1d7fef52017-02-02 05:33:14 +0000248BOOST_AUTO_TEST_SUITE_END() // CreateCommand
249
Junxiao Shi05dd4442017-02-06 22:50:07 +0000250BOOST_FIXTURE_TEST_SUITE(DestroyCommand, ExecuteCommandFixture)
251
252BOOST_AUTO_TEST_CASE(NormalByFaceId)
253{
254 this->processInterest = [this] (const Interest& interest) {
255 if (Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName())) {
256 BOOST_CHECK_EQUAL(interest.getName().size(), 5);
257 FaceQueryFilter filter(interest.getName().at(4).blockFromValue());
Junxiao Shi8f803f22017-02-10 03:04:28 +0000258 BOOST_CHECK_EQUAL(filter, FaceQueryFilter().setFaceId(10156));
Junxiao Shi05dd4442017-02-06 22:50:07 +0000259
260 FaceStatus faceStatus;
261 faceStatus.setFaceId(10156)
262 .setLocalUri("tcp4://151.26.163.27:22967")
263 .setRemoteUri("tcp4://198.57.27.40:6363")
264 .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
265 this->sendDataset(interest.getName(), faceStatus);
266 return;
267 }
268
269 ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy");
270 BOOST_REQUIRE(req.hasFaceId());
271 BOOST_CHECK_EQUAL(req.getFaceId(), 10156);
272
273 ControlParameters resp;
274 resp.setFaceId(10156);
275 this->succeedCommand(resp);
276 };
277
278 this->execute("face destroy 10156");
279 BOOST_CHECK_EQUAL(exitCode, 0);
280 BOOST_CHECK(out.is_equal("face-destroyed id=10156 local=tcp4://151.26.163.27:22967 "
281 "remote=tcp4://198.57.27.40:6363 persistency=persistent\n"));
282 BOOST_CHECK(err.is_empty());
283}
284
285BOOST_AUTO_TEST_CASE(NormalByFaceUri)
286{
287 this->processInterest = [this] (const Interest& interest) {
288 if (Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName())) {
289 BOOST_CHECK_EQUAL(interest.getName().size(), 5);
290 FaceQueryFilter filter(interest.getName().at(4).blockFromValue());
Junxiao Shi8f803f22017-02-10 03:04:28 +0000291 BOOST_CHECK_EQUAL(filter, FaceQueryFilter().setRemoteUri("tcp4://32.121.182.82:6363"));
Junxiao Shi05dd4442017-02-06 22:50:07 +0000292
293 FaceStatus faceStatus;
294 faceStatus.setFaceId(2249)
295 .setLocalUri("tcp4://30.99.87.98:31414")
296 .setRemoteUri("tcp4://32.121.182.82:6363")
297 .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
298 this->sendDataset(interest.getName(), faceStatus);
299 return;
300 }
301
302 ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy");
303 BOOST_REQUIRE(req.hasFaceId());
304 BOOST_CHECK_EQUAL(req.getFaceId(), 2249);
305
306 ControlParameters resp;
307 resp.setFaceId(2249);
308 this->succeedCommand(resp);
309 };
310
311 this->execute("face destroy tcp://32.121.182.82");
312 BOOST_CHECK_EQUAL(exitCode, 0);
313 BOOST_CHECK(out.is_equal("face-destroyed id=2249 local=tcp4://30.99.87.98:31414 "
314 "remote=tcp4://32.121.182.82:6363 persistency=persistent\n"));
315 BOOST_CHECK(err.is_empty());
316}
317
318BOOST_AUTO_TEST_CASE(FaceNotExist)
319{
320 this->processInterest = [this] (const Interest& interest) {
321 BOOST_CHECK(Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName()));
322 this->sendEmptyDataset(interest.getName());
323 };
324
325 this->execute("face destroy 23728");
326 BOOST_CHECK_EQUAL(exitCode, 3);
327 BOOST_CHECK(out.is_empty());
328 BOOST_CHECK(err.is_equal("Face not found\n"));
329}
330
331BOOST_AUTO_TEST_CASE(Ambiguous)
332{
333 this->processInterest = [this] (const Interest& interest) {
334 BOOST_CHECK(Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName()));
335
336 FaceStatus faceStatus1, faceStatus2;
337 faceStatus1.setFaceId(6720)
338 .setLocalUri("udp4://202.83.168.28:56363")
339 .setRemoteUri("udp4://225.131.75.231:56363")
340 .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERMANENT);
341 faceStatus2.setFaceId(31066)
342 .setLocalUri("udp4://25.90.26.32:56363")
343 .setRemoteUri("udp4://225.131.75.231:56363")
344 .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERMANENT);
345 this->sendDataset(interest.getName(), faceStatus1, faceStatus2);
346 };
347
348 this->execute("face destroy udp4://225.131.75.231:56363");
349 BOOST_CHECK_EQUAL(exitCode, 5);
350 BOOST_CHECK(out.is_empty());
351 BOOST_CHECK(err.is_equal("Multiple faces match specified remote FaceUri. "
352 "Re-run the command with a FaceId: "
353 "6720 (local=udp4://202.83.168.28:56363), "
354 "31066 (local=udp4://25.90.26.32:56363)\n"));
355}
356
357BOOST_AUTO_TEST_CASE(ErrorCanonization)
358{
359 this->execute("face destroy udp6://32.38.164.64:10445");
360 BOOST_CHECK_EQUAL(exitCode, 4);
361 BOOST_CHECK(out.is_empty());
362 BOOST_CHECK(err.is_equal("Error during remote FaceUri canonization: "
363 "No endpoints match the specified address selector\n"));
364}
365
366BOOST_AUTO_TEST_CASE(ErrorDataset)
367{
368 this->processInterest = nullptr; // no response to dataset or command
369
370 this->execute("face destroy udp://159.242.33.78");
371 BOOST_CHECK_EQUAL(exitCode, 1);
372 BOOST_CHECK(out.is_empty());
373 BOOST_CHECK(err.is_equal("Error 10060 when querying face: Timeout\n"));
374}
375
376BOOST_AUTO_TEST_CASE(ErrorCommand)
377{
378 this->processInterest = [this] (const Interest& interest) {
379 if (Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName())) {
380 FaceStatus faceStatus;
381 faceStatus.setFaceId(17757)
382 .setLocalUri("tcp4://27.65.24.30:19187")
383 .setRemoteUri("tcp4://70.47.27.77:6363")
384 .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
385 this->sendDataset(interest.getName(), faceStatus);
386 return;
387 }
388
389 MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy");
390 // no response to command
391 };
392
393 this->execute("face destroy 17757");
394 BOOST_CHECK_EQUAL(exitCode, 1);
395 BOOST_CHECK(out.is_empty());
396 BOOST_CHECK(err.is_equal("Error 10060 when destroying face: request timed out\n"));
397}
398
399BOOST_AUTO_TEST_SUITE_END() // DestroyCommand
400
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000401const std::string STATUS_XML = stripXmlSpaces(R"XML(
402 <faces>
403 <face>
404 <faceId>134</faceId>
405 <remoteUri>udp4://233.252.0.4:6363</remoteUri>
406 <localUri>udp4://192.0.2.1:6363</localUri>
407 <faceScope>non-local</faceScope>
408 <facePersistency>permanent</facePersistency>
409 <linkType>multi-access</linkType>
Eric Newberry6d932e82016-11-24 05:05:43 +0000410 <flags/>
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000411 <packetCounters>
412 <incomingPackets>
413 <nInterests>22562</nInterests>
414 <nDatas>22031</nDatas>
415 <nNacks>63</nNacks>
416 </incomingPackets>
417 <outgoingPackets>
418 <nInterests>30121</nInterests>
419 <nDatas>20940</nDatas>
420 <nNacks>1218</nNacks>
421 </outgoingPackets>
422 </packetCounters>
423 <byteCounters>
424 <incomingBytes>2522915</incomingBytes>
425 <outgoingBytes>1353592</outgoingBytes>
426 </byteCounters>
427 </face>
428 <face>
429 <faceId>745</faceId>
430 <remoteUri>fd://75</remoteUri>
431 <localUri>unix:///var/run/nfd.sock</localUri>
432 <faceScope>local</faceScope>
433 <facePersistency>on-demand</facePersistency>
434 <linkType>point-to-point</linkType>
Eric Newberry6d932e82016-11-24 05:05:43 +0000435 <flags>
436 <localFieldsEnabled/>
437 </flags>
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000438 <packetCounters>
439 <incomingPackets>
440 <nInterests>18998</nInterests>
441 <nDatas>26701</nDatas>
442 <nNacks>147</nNacks>
443 </incomingPackets>
444 <outgoingPackets>
445 <nInterests>34779</nInterests>
446 <nDatas>17028</nDatas>
447 <nNacks>1176</nNacks>
448 </outgoingPackets>
449 </packetCounters>
450 <byteCounters>
451 <incomingBytes>4672308</incomingBytes>
452 <outgoingBytes>8957187</outgoingBytes>
453 </byteCounters>
454 </face>
455 </faces>
456)XML");
457
458const std::string STATUS_TEXT =
459 "Faces:\n"
460 " faceid=134 remote=udp4://233.252.0.4:6363 local=udp4://192.0.2.1:6363"
461 " counters={in={22562i 22031d 63n 2522915B} out={30121i 20940d 1218n 1353592B}}"
Junxiao Shi1f481fa2017-01-26 15:14:43 +0000462 " flags={non-local permanent multi-access}\n"
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000463 " faceid=745 remote=fd://75 local=unix:///var/run/nfd.sock"
464 " counters={in={18998i 26701d 147n 4672308B} out={34779i 17028d 1176n 8957187B}}"
Junxiao Shi1f481fa2017-01-26 15:14:43 +0000465 " flags={local on-demand point-to-point local-fields}\n";
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000466
Junxiao Shi1f481fa2017-01-26 15:14:43 +0000467BOOST_FIXTURE_TEST_CASE(Status, StatusFixture<FaceModule>)
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000468{
469 this->fetchStatus();
470 FaceStatus payload1;
471 payload1.setFaceId(134)
472 .setRemoteUri("udp4://233.252.0.4:6363")
473 .setLocalUri("udp4://192.0.2.1:6363")
474 .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
475 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERMANENT)
476 .setLinkType(ndn::nfd::LINK_TYPE_MULTI_ACCESS)
477 .setNInInterests(22562)
478 .setNInDatas(22031)
479 .setNInNacks(63)
480 .setNOutInterests(30121)
481 .setNOutDatas(20940)
482 .setNOutNacks(1218)
483 .setNInBytes(2522915)
484 .setNOutBytes(1353592);
485 FaceStatus payload2;
486 payload2.setFaceId(745)
487 .setRemoteUri("fd://75")
488 .setLocalUri("unix:///var/run/nfd.sock")
489 .setFaceScope(ndn::nfd::FACE_SCOPE_LOCAL)
490 .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND)
491 .setLinkType(ndn::nfd::LINK_TYPE_POINT_TO_POINT)
Eric Newberry6d932e82016-11-24 05:05:43 +0000492 .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, true)
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000493 .setNInInterests(18998)
494 .setNInDatas(26701)
495 .setNInNacks(147)
496 .setNOutInterests(34779)
497 .setNOutDatas(17028)
498 .setNOutNacks(1176)
499 .setNInBytes(4672308)
500 .setNOutBytes(8957187);
501 this->sendDataset("/localhost/nfd/faces/list", payload1, payload2);
502 this->prepareStatusOutput();
503
504 BOOST_CHECK(statusXml.is_equal(STATUS_XML));
505 BOOST_CHECK(statusText.is_equal(STATUS_TEXT));
506}
507
508BOOST_AUTO_TEST_SUITE_END() // TestFaceModule
Junxiao Shi331ade72016-08-19 14:07:19 +0000509BOOST_AUTO_TEST_SUITE_END() // Nfdc
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000510
511} // namespace tests
Junxiao Shi331ade72016-08-19 14:07:19 +0000512} // namespace nfdc
Junxiao Shi38f4ce92016-08-04 10:01:52 +0000513} // namespace tools
514} // namespace nfd