Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 3 | * Copyright (c) 2014-2017, Regents of the University of California, |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 4 | * 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 Shi | 331ade7 | 2016-08-19 14:07:19 +0000 | [diff] [blame] | 26 | #include "nfdc/face-module.hpp" |
Junxiao Shi | 1d7fef5 | 2017-02-02 05:33:14 +0000 | [diff] [blame] | 27 | #include <ndn-cxx/mgmt/nfd/face-query-filter.hpp> |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 28 | |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 29 | #include "execute-command-fixture.hpp" |
| 30 | #include "status-fixture.hpp" |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 31 | |
| 32 | namespace nfd { |
| 33 | namespace tools { |
Junxiao Shi | 331ade7 | 2016-08-19 14:07:19 +0000 | [diff] [blame] | 34 | namespace nfdc { |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 35 | namespace tests { |
| 36 | |
Junxiao Shi | 1d7fef5 | 2017-02-02 05:33:14 +0000 | [diff] [blame] | 37 | using ndn::nfd::FaceQueryFilter; |
| 38 | |
Junxiao Shi | 331ade7 | 2016-08-19 14:07:19 +0000 | [diff] [blame] | 39 | BOOST_AUTO_TEST_SUITE(Nfdc) |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 40 | BOOST_AUTO_TEST_SUITE(TestFaceModule) |
| 41 | |
| 42 | BOOST_FIXTURE_TEST_SUITE(ShowCommand, ExecuteCommandFixture) |
| 43 | |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 44 | const 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 |
| 48 | counters={in={28975i 28232d 212n 13307258B} out={19525i 30993d 1038n 6231946B}} |
| 49 | flags={non-local on-demand point-to-point} |
| 50 | )TEXT").substr(1); |
| 51 | |
| 52 | BOOST_AUTO_TEST_CASE(Normal) |
| 53 | { |
| 54 | this->processInterest = [this] (const Interest& interest) { |
Junxiao Shi | 8f803f2 | 2017-02-10 03:04:28 +0000 | [diff] [blame^] | 55 | BOOST_CHECK_EQUAL(interest.getName().size(), 5); |
| 56 | FaceQueryFilter filter(interest.getName().at(4).blockFromValue()); |
| 57 | BOOST_CHECK_EQUAL(filter, FaceQueryFilter().setFaceId(256)); |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 58 | |
| 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 Shi | 8f803f2 | 2017-02-10 03:04:28 +0000 | [diff] [blame^] | 75 | this->sendDataset(interest.getName(), payload); |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 76 | }; |
| 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 | |
| 84 | BOOST_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 Shi | 8f803f2 | 2017-02-10 03:04:28 +0000 | [diff] [blame^] | 93 | BOOST_CHECK(err.is_equal("Face not found\n")); |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | BOOST_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 Shi | 8f803f2 | 2017-02-10 03:04:28 +0000 | [diff] [blame^] | 103 | BOOST_CHECK(err.is_equal("Error 10060 when querying face: Timeout\n")); |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | BOOST_AUTO_TEST_SUITE_END() // ShowCommand |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 107 | |
Junxiao Shi | 1d7fef5 | 2017-02-02 05:33:14 +0000 | [diff] [blame] | 108 | BOOST_FIXTURE_TEST_SUITE(CreateCommand, ExecuteCommandFixture) |
| 109 | |
| 110 | BOOST_AUTO_TEST_CASE(Normal) |
| 111 | { |
| 112 | this->processInterest = [this] (const Interest& interest) { |
| 113 | ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/create"); |
| 114 | BOOST_REQUIRE(req.hasUri()); |
| 115 | BOOST_CHECK_EQUAL(req.getUri(), "udp4://159.242.33.78:6363"); |
| 116 | BOOST_REQUIRE(req.hasFacePersistency()); |
| 117 | BOOST_CHECK_EQUAL(req.getFacePersistency(), FacePersistency::FACE_PERSISTENCY_PERSISTENT); |
| 118 | |
| 119 | ControlParameters resp; |
| 120 | resp.setFaceId(2130) |
| 121 | .setUri("udp4://159.242.33.78:6363") |
| 122 | .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT); |
| 123 | this->succeedCommand(resp); |
| 124 | }; |
| 125 | |
| 126 | this->execute("face create udp://159.242.33.78"); |
| 127 | BOOST_CHECK_EQUAL(exitCode, 0); |
| 128 | BOOST_CHECK(out.is_equal("face-created id=2130 remote=udp4://159.242.33.78:6363 persistency=persistent\n")); |
| 129 | BOOST_CHECK(err.is_empty()); |
| 130 | } |
| 131 | |
| 132 | BOOST_AUTO_TEST_CASE(Error) |
| 133 | { |
| 134 | this->processInterest = nullptr; // no response |
| 135 | |
| 136 | this->execute("face create udp://159.242.33.78"); |
| 137 | BOOST_CHECK_EQUAL(exitCode, 1); |
| 138 | BOOST_CHECK(out.is_empty()); |
| 139 | BOOST_CHECK(err.is_equal("Error 10060 when creating face: request timed out\n")); |
| 140 | } |
| 141 | |
| 142 | BOOST_AUTO_TEST_SUITE_END() // CreateCommand |
| 143 | |
Junxiao Shi | 05dd444 | 2017-02-06 22:50:07 +0000 | [diff] [blame] | 144 | BOOST_FIXTURE_TEST_SUITE(DestroyCommand, ExecuteCommandFixture) |
| 145 | |
| 146 | BOOST_AUTO_TEST_CASE(NormalByFaceId) |
| 147 | { |
| 148 | this->processInterest = [this] (const Interest& interest) { |
| 149 | if (Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName())) { |
| 150 | BOOST_CHECK_EQUAL(interest.getName().size(), 5); |
| 151 | FaceQueryFilter filter(interest.getName().at(4).blockFromValue()); |
Junxiao Shi | 8f803f2 | 2017-02-10 03:04:28 +0000 | [diff] [blame^] | 152 | BOOST_CHECK_EQUAL(filter, FaceQueryFilter().setFaceId(10156)); |
Junxiao Shi | 05dd444 | 2017-02-06 22:50:07 +0000 | [diff] [blame] | 153 | |
| 154 | FaceStatus faceStatus; |
| 155 | faceStatus.setFaceId(10156) |
| 156 | .setLocalUri("tcp4://151.26.163.27:22967") |
| 157 | .setRemoteUri("tcp4://198.57.27.40:6363") |
| 158 | .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT); |
| 159 | this->sendDataset(interest.getName(), faceStatus); |
| 160 | return; |
| 161 | } |
| 162 | |
| 163 | ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy"); |
| 164 | BOOST_REQUIRE(req.hasFaceId()); |
| 165 | BOOST_CHECK_EQUAL(req.getFaceId(), 10156); |
| 166 | |
| 167 | ControlParameters resp; |
| 168 | resp.setFaceId(10156); |
| 169 | this->succeedCommand(resp); |
| 170 | }; |
| 171 | |
| 172 | this->execute("face destroy 10156"); |
| 173 | BOOST_CHECK_EQUAL(exitCode, 0); |
| 174 | BOOST_CHECK(out.is_equal("face-destroyed id=10156 local=tcp4://151.26.163.27:22967 " |
| 175 | "remote=tcp4://198.57.27.40:6363 persistency=persistent\n")); |
| 176 | BOOST_CHECK(err.is_empty()); |
| 177 | } |
| 178 | |
| 179 | BOOST_AUTO_TEST_CASE(NormalByFaceUri) |
| 180 | { |
| 181 | this->processInterest = [this] (const Interest& interest) { |
| 182 | if (Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName())) { |
| 183 | BOOST_CHECK_EQUAL(interest.getName().size(), 5); |
| 184 | FaceQueryFilter filter(interest.getName().at(4).blockFromValue()); |
Junxiao Shi | 8f803f2 | 2017-02-10 03:04:28 +0000 | [diff] [blame^] | 185 | BOOST_CHECK_EQUAL(filter, FaceQueryFilter().setRemoteUri("tcp4://32.121.182.82:6363")); |
Junxiao Shi | 05dd444 | 2017-02-06 22:50:07 +0000 | [diff] [blame] | 186 | |
| 187 | FaceStatus faceStatus; |
| 188 | faceStatus.setFaceId(2249) |
| 189 | .setLocalUri("tcp4://30.99.87.98:31414") |
| 190 | .setRemoteUri("tcp4://32.121.182.82:6363") |
| 191 | .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT); |
| 192 | this->sendDataset(interest.getName(), faceStatus); |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy"); |
| 197 | BOOST_REQUIRE(req.hasFaceId()); |
| 198 | BOOST_CHECK_EQUAL(req.getFaceId(), 2249); |
| 199 | |
| 200 | ControlParameters resp; |
| 201 | resp.setFaceId(2249); |
| 202 | this->succeedCommand(resp); |
| 203 | }; |
| 204 | |
| 205 | this->execute("face destroy tcp://32.121.182.82"); |
| 206 | BOOST_CHECK_EQUAL(exitCode, 0); |
| 207 | BOOST_CHECK(out.is_equal("face-destroyed id=2249 local=tcp4://30.99.87.98:31414 " |
| 208 | "remote=tcp4://32.121.182.82:6363 persistency=persistent\n")); |
| 209 | BOOST_CHECK(err.is_empty()); |
| 210 | } |
| 211 | |
| 212 | BOOST_AUTO_TEST_CASE(FaceNotExist) |
| 213 | { |
| 214 | this->processInterest = [this] (const Interest& interest) { |
| 215 | BOOST_CHECK(Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName())); |
| 216 | this->sendEmptyDataset(interest.getName()); |
| 217 | }; |
| 218 | |
| 219 | this->execute("face destroy 23728"); |
| 220 | BOOST_CHECK_EQUAL(exitCode, 3); |
| 221 | BOOST_CHECK(out.is_empty()); |
| 222 | BOOST_CHECK(err.is_equal("Face not found\n")); |
| 223 | } |
| 224 | |
| 225 | BOOST_AUTO_TEST_CASE(Ambiguous) |
| 226 | { |
| 227 | this->processInterest = [this] (const Interest& interest) { |
| 228 | BOOST_CHECK(Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName())); |
| 229 | |
| 230 | FaceStatus faceStatus1, faceStatus2; |
| 231 | faceStatus1.setFaceId(6720) |
| 232 | .setLocalUri("udp4://202.83.168.28:56363") |
| 233 | .setRemoteUri("udp4://225.131.75.231:56363") |
| 234 | .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERMANENT); |
| 235 | faceStatus2.setFaceId(31066) |
| 236 | .setLocalUri("udp4://25.90.26.32:56363") |
| 237 | .setRemoteUri("udp4://225.131.75.231:56363") |
| 238 | .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERMANENT); |
| 239 | this->sendDataset(interest.getName(), faceStatus1, faceStatus2); |
| 240 | }; |
| 241 | |
| 242 | this->execute("face destroy udp4://225.131.75.231:56363"); |
| 243 | BOOST_CHECK_EQUAL(exitCode, 5); |
| 244 | BOOST_CHECK(out.is_empty()); |
| 245 | BOOST_CHECK(err.is_equal("Multiple faces match specified remote FaceUri. " |
| 246 | "Re-run the command with a FaceId: " |
| 247 | "6720 (local=udp4://202.83.168.28:56363), " |
| 248 | "31066 (local=udp4://25.90.26.32:56363)\n")); |
| 249 | } |
| 250 | |
| 251 | BOOST_AUTO_TEST_CASE(ErrorCanonization) |
| 252 | { |
| 253 | this->execute("face destroy udp6://32.38.164.64:10445"); |
| 254 | BOOST_CHECK_EQUAL(exitCode, 4); |
| 255 | BOOST_CHECK(out.is_empty()); |
| 256 | BOOST_CHECK(err.is_equal("Error during remote FaceUri canonization: " |
| 257 | "No endpoints match the specified address selector\n")); |
| 258 | } |
| 259 | |
| 260 | BOOST_AUTO_TEST_CASE(ErrorDataset) |
| 261 | { |
| 262 | this->processInterest = nullptr; // no response to dataset or command |
| 263 | |
| 264 | this->execute("face destroy udp://159.242.33.78"); |
| 265 | BOOST_CHECK_EQUAL(exitCode, 1); |
| 266 | BOOST_CHECK(out.is_empty()); |
| 267 | BOOST_CHECK(err.is_equal("Error 10060 when querying face: Timeout\n")); |
| 268 | } |
| 269 | |
| 270 | BOOST_AUTO_TEST_CASE(ErrorCommand) |
| 271 | { |
| 272 | this->processInterest = [this] (const Interest& interest) { |
| 273 | if (Name("/localhost/nfd/faces/query").isPrefixOf(interest.getName())) { |
| 274 | FaceStatus faceStatus; |
| 275 | faceStatus.setFaceId(17757) |
| 276 | .setLocalUri("tcp4://27.65.24.30:19187") |
| 277 | .setRemoteUri("tcp4://70.47.27.77:6363") |
| 278 | .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT); |
| 279 | this->sendDataset(interest.getName(), faceStatus); |
| 280 | return; |
| 281 | } |
| 282 | |
| 283 | MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy"); |
| 284 | // no response to command |
| 285 | }; |
| 286 | |
| 287 | this->execute("face destroy 17757"); |
| 288 | BOOST_CHECK_EQUAL(exitCode, 1); |
| 289 | BOOST_CHECK(out.is_empty()); |
| 290 | BOOST_CHECK(err.is_equal("Error 10060 when destroying face: request timed out\n")); |
| 291 | } |
| 292 | |
| 293 | BOOST_AUTO_TEST_SUITE_END() // DestroyCommand |
| 294 | |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 295 | const std::string STATUS_XML = stripXmlSpaces(R"XML( |
| 296 | <faces> |
| 297 | <face> |
| 298 | <faceId>134</faceId> |
| 299 | <remoteUri>udp4://233.252.0.4:6363</remoteUri> |
| 300 | <localUri>udp4://192.0.2.1:6363</localUri> |
| 301 | <faceScope>non-local</faceScope> |
| 302 | <facePersistency>permanent</facePersistency> |
| 303 | <linkType>multi-access</linkType> |
Eric Newberry | 6d932e8 | 2016-11-24 05:05:43 +0000 | [diff] [blame] | 304 | <flags/> |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 305 | <packetCounters> |
| 306 | <incomingPackets> |
| 307 | <nInterests>22562</nInterests> |
| 308 | <nDatas>22031</nDatas> |
| 309 | <nNacks>63</nNacks> |
| 310 | </incomingPackets> |
| 311 | <outgoingPackets> |
| 312 | <nInterests>30121</nInterests> |
| 313 | <nDatas>20940</nDatas> |
| 314 | <nNacks>1218</nNacks> |
| 315 | </outgoingPackets> |
| 316 | </packetCounters> |
| 317 | <byteCounters> |
| 318 | <incomingBytes>2522915</incomingBytes> |
| 319 | <outgoingBytes>1353592</outgoingBytes> |
| 320 | </byteCounters> |
| 321 | </face> |
| 322 | <face> |
| 323 | <faceId>745</faceId> |
| 324 | <remoteUri>fd://75</remoteUri> |
| 325 | <localUri>unix:///var/run/nfd.sock</localUri> |
| 326 | <faceScope>local</faceScope> |
| 327 | <facePersistency>on-demand</facePersistency> |
| 328 | <linkType>point-to-point</linkType> |
Eric Newberry | 6d932e8 | 2016-11-24 05:05:43 +0000 | [diff] [blame] | 329 | <flags> |
| 330 | <localFieldsEnabled/> |
| 331 | </flags> |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 332 | <packetCounters> |
| 333 | <incomingPackets> |
| 334 | <nInterests>18998</nInterests> |
| 335 | <nDatas>26701</nDatas> |
| 336 | <nNacks>147</nNacks> |
| 337 | </incomingPackets> |
| 338 | <outgoingPackets> |
| 339 | <nInterests>34779</nInterests> |
| 340 | <nDatas>17028</nDatas> |
| 341 | <nNacks>1176</nNacks> |
| 342 | </outgoingPackets> |
| 343 | </packetCounters> |
| 344 | <byteCounters> |
| 345 | <incomingBytes>4672308</incomingBytes> |
| 346 | <outgoingBytes>8957187</outgoingBytes> |
| 347 | </byteCounters> |
| 348 | </face> |
| 349 | </faces> |
| 350 | )XML"); |
| 351 | |
| 352 | const std::string STATUS_TEXT = |
| 353 | "Faces:\n" |
| 354 | " faceid=134 remote=udp4://233.252.0.4:6363 local=udp4://192.0.2.1:6363" |
| 355 | " counters={in={22562i 22031d 63n 2522915B} out={30121i 20940d 1218n 1353592B}}" |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 356 | " flags={non-local permanent multi-access}\n" |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 357 | " faceid=745 remote=fd://75 local=unix:///var/run/nfd.sock" |
| 358 | " counters={in={18998i 26701d 147n 4672308B} out={34779i 17028d 1176n 8957187B}}" |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 359 | " flags={local on-demand point-to-point local-fields}\n"; |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 360 | |
Junxiao Shi | 1f481fa | 2017-01-26 15:14:43 +0000 | [diff] [blame] | 361 | BOOST_FIXTURE_TEST_CASE(Status, StatusFixture<FaceModule>) |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 362 | { |
| 363 | this->fetchStatus(); |
| 364 | FaceStatus payload1; |
| 365 | payload1.setFaceId(134) |
| 366 | .setRemoteUri("udp4://233.252.0.4:6363") |
| 367 | .setLocalUri("udp4://192.0.2.1:6363") |
| 368 | .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL) |
| 369 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERMANENT) |
| 370 | .setLinkType(ndn::nfd::LINK_TYPE_MULTI_ACCESS) |
| 371 | .setNInInterests(22562) |
| 372 | .setNInDatas(22031) |
| 373 | .setNInNacks(63) |
| 374 | .setNOutInterests(30121) |
| 375 | .setNOutDatas(20940) |
| 376 | .setNOutNacks(1218) |
| 377 | .setNInBytes(2522915) |
| 378 | .setNOutBytes(1353592); |
| 379 | FaceStatus payload2; |
| 380 | payload2.setFaceId(745) |
| 381 | .setRemoteUri("fd://75") |
| 382 | .setLocalUri("unix:///var/run/nfd.sock") |
| 383 | .setFaceScope(ndn::nfd::FACE_SCOPE_LOCAL) |
| 384 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND) |
| 385 | .setLinkType(ndn::nfd::LINK_TYPE_POINT_TO_POINT) |
Eric Newberry | 6d932e8 | 2016-11-24 05:05:43 +0000 | [diff] [blame] | 386 | .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, true) |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 387 | .setNInInterests(18998) |
| 388 | .setNInDatas(26701) |
| 389 | .setNInNacks(147) |
| 390 | .setNOutInterests(34779) |
| 391 | .setNOutDatas(17028) |
| 392 | .setNOutNacks(1176) |
| 393 | .setNInBytes(4672308) |
| 394 | .setNOutBytes(8957187); |
| 395 | this->sendDataset("/localhost/nfd/faces/list", payload1, payload2); |
| 396 | this->prepareStatusOutput(); |
| 397 | |
| 398 | BOOST_CHECK(statusXml.is_equal(STATUS_XML)); |
| 399 | BOOST_CHECK(statusText.is_equal(STATUS_TEXT)); |
| 400 | } |
| 401 | |
| 402 | BOOST_AUTO_TEST_SUITE_END() // TestFaceModule |
Junxiao Shi | 331ade7 | 2016-08-19 14:07:19 +0000 | [diff] [blame] | 403 | BOOST_AUTO_TEST_SUITE_END() // Nfdc |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 404 | |
| 405 | } // namespace tests |
Junxiao Shi | 331ade7 | 2016-08-19 14:07:19 +0000 | [diff] [blame] | 406 | } // namespace nfdc |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 407 | } // namespace tools |
| 408 | } // namespace nfd |