Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 3 | * Copyright (c) 2014-2017, Regents of the University of California, |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [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 | |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 26 | #include "mgmt/face-manager.hpp" |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 27 | #include "face-manager-command-fixture.hpp" |
| 28 | #include "nfd-manager-common-fixture.hpp" |
Junxiao Shi | b84e674 | 2016-07-19 13:16:22 +0000 | [diff] [blame] | 29 | |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 30 | namespace nfd { |
| 31 | namespace tests { |
| 32 | |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 33 | BOOST_AUTO_TEST_SUITE(Mgmt) |
| 34 | BOOST_AUTO_TEST_SUITE(TestFaceManager) |
| 35 | |
| 36 | BOOST_FIXTURE_TEST_SUITE(CreateFace, BaseFixture) |
| 37 | |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 38 | class TcpFaceOnDemand |
| 39 | { |
| 40 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 41 | static ControlParameters |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 42 | getParameters() |
| 43 | { |
| 44 | return ControlParameters() |
| 45 | .setUri("tcp4://127.0.0.1:26363") |
| 46 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND); |
| 47 | } |
| 48 | }; |
| 49 | |
| 50 | class TcpFacePersistent |
| 51 | { |
| 52 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 53 | static ControlParameters |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 54 | getParameters() |
| 55 | { |
| 56 | return ControlParameters() |
| 57 | .setUri("tcp4://127.0.0.1:26363") |
| 58 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT); |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | class TcpFacePermanent |
| 63 | { |
| 64 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 65 | static ControlParameters |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 66 | getParameters() |
| 67 | { |
| 68 | return ControlParameters() |
| 69 | .setUri("tcp4://127.0.0.1:26363") |
| 70 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERMANENT); |
| 71 | } |
| 72 | }; |
| 73 | |
| 74 | class UdpFaceOnDemand |
| 75 | { |
| 76 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 77 | static ControlParameters |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 78 | getParameters() |
| 79 | { |
| 80 | return ControlParameters() |
| 81 | .setUri("udp4://127.0.0.1:26363") |
| 82 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND); |
| 83 | } |
| 84 | }; |
| 85 | |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 86 | class UdpFacePersistent |
| 87 | { |
| 88 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 89 | static ControlParameters |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 90 | getParameters() |
| 91 | { |
| 92 | return ControlParameters() |
| 93 | .setUri("udp4://127.0.0.1:26363") |
| 94 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT); |
| 95 | } |
| 96 | }; |
| 97 | |
| 98 | class UdpFacePermanent |
| 99 | { |
| 100 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 101 | static ControlParameters |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 102 | getParameters() |
| 103 | { |
| 104 | return ControlParameters() |
| 105 | .setUri("udp4://127.0.0.1:26363") |
| 106 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERMANENT); |
| 107 | } |
| 108 | }; |
| 109 | |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 110 | class UdpFaceConnectToSelf // face that will cause afterCreateFaceFailure to be invoked |
| 111 | // fails because remote endpoint is prohibited |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 112 | { |
| 113 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 114 | static ControlParameters |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 115 | getParameters() |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 116 | { |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 117 | return ControlParameters() |
| 118 | .setUri("udp4://0.0.0.0:16363"); // cannot connect to self |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 119 | } |
| 120 | }; |
| 121 | |
Eric Newberry | f40551a | 2016-09-05 15:41:16 -0700 | [diff] [blame] | 122 | class LocalTcpFaceLocalFieldsEnabled |
| 123 | { |
| 124 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 125 | static ControlParameters |
Eric Newberry | f40551a | 2016-09-05 15:41:16 -0700 | [diff] [blame] | 126 | getParameters() |
| 127 | { |
| 128 | return ControlParameters() |
| 129 | .setUri("tcp4://127.0.0.1:26363") |
| 130 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT) |
| 131 | .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, true); |
| 132 | } |
| 133 | }; |
| 134 | |
| 135 | class LocalTcpFaceLocalFieldsDisabled |
| 136 | { |
| 137 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 138 | static ControlParameters |
Eric Newberry | f40551a | 2016-09-05 15:41:16 -0700 | [diff] [blame] | 139 | getParameters() |
| 140 | { |
| 141 | return ControlParameters() |
| 142 | .setUri("tcp4://127.0.0.1:26363") |
| 143 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT) |
| 144 | .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, false); |
| 145 | } |
| 146 | }; |
| 147 | |
| 148 | class NonLocalUdpFaceLocalFieldsEnabled // won't work because non-local scope |
| 149 | { |
| 150 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 151 | static ControlParameters |
Eric Newberry | f40551a | 2016-09-05 15:41:16 -0700 | [diff] [blame] | 152 | getParameters() |
| 153 | { |
| 154 | return ControlParameters() |
| 155 | .setUri("udp4://127.0.0.1:26363") |
| 156 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT) |
| 157 | .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, true); |
| 158 | } |
| 159 | }; |
| 160 | |
| 161 | class NonLocalUdpFaceLocalFieldsDisabled |
| 162 | { |
| 163 | public: |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 164 | static ControlParameters |
Eric Newberry | f40551a | 2016-09-05 15:41:16 -0700 | [diff] [blame] | 165 | getParameters() |
| 166 | { |
| 167 | return ControlParameters() |
| 168 | .setUri("udp4://127.0.0.1:26363") |
| 169 | .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT) |
| 170 | .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, false); |
| 171 | } |
| 172 | }; |
| 173 | |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 174 | namespace mpl = boost::mpl; |
| 175 | |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 176 | // pairs of CreateCommand and Success/Failure status |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 177 | using TestCases = mpl::vector< |
| 178 | mpl::pair<TcpFaceOnDemand, CommandFailure<406>>, |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 179 | mpl::pair<TcpFacePersistent, CommandSuccess>, |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 180 | mpl::pair<TcpFacePermanent, CommandSuccess>, |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 181 | mpl::pair<UdpFaceOnDemand, CommandFailure<406>>, |
| 182 | mpl::pair<UdpFacePersistent, CommandSuccess>, |
| 183 | mpl::pair<UdpFacePermanent, CommandSuccess>, |
Eric Newberry | f40551a | 2016-09-05 15:41:16 -0700 | [diff] [blame] | 184 | mpl::pair<UdpFaceConnectToSelf, CommandFailure<406>>, |
| 185 | mpl::pair<LocalTcpFaceLocalFieldsEnabled, CommandSuccess>, |
| 186 | mpl::pair<LocalTcpFaceLocalFieldsDisabled, CommandSuccess>, |
| 187 | mpl::pair<NonLocalUdpFaceLocalFieldsEnabled, CommandFailure<406>>, |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 188 | mpl::pair<NonLocalUdpFaceLocalFieldsDisabled, CommandSuccess>>; |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 189 | |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 190 | BOOST_FIXTURE_TEST_CASE_TEMPLATE(NewFace, T, TestCases, FaceManagerCommandFixture) |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 191 | { |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 192 | using FaceType = typename T::first; |
| 193 | using CreateResult = typename T::second; |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 194 | |
| 195 | Name commandName("/localhost/nfd/faces"); |
| 196 | commandName.append("create"); |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 197 | commandName.append(FaceType::getParameters().wireEncode()); |
Junxiao Shi | b84e674 | 2016-07-19 13:16:22 +0000 | [diff] [blame] | 198 | auto command = makeInterest(commandName); |
Junxiao Shi | 221b6fe | 2016-07-14 18:21:56 +0000 | [diff] [blame] | 199 | m_keyChain.sign(*command); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 200 | |
| 201 | bool hasCallbackFired = false; |
Junxiao Shi | 221b6fe | 2016-07-14 18:21:56 +0000 | [diff] [blame] | 202 | this->node1.face.onSendData.connect([this, command, &hasCallbackFired] (const Data& response) { |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 203 | if (!command->getName().isPrefixOf(response.getName())) { |
| 204 | return; |
| 205 | } |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 206 | |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 207 | ControlResponse actual(response.getContent().blockFromValue()); |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 208 | ControlResponse expected(CreateResult::getExpected()); |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 209 | BOOST_TEST_MESSAGE(actual.getText()); |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 210 | BOOST_CHECK_EQUAL(expected.getCode(), actual.getCode()); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 211 | |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 212 | if (actual.getBody().hasWire()) { |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 213 | ControlParameters expectedParams(FaceType::getParameters()); |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 214 | ControlParameters actualParams(actual.getBody()); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 215 | |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 216 | BOOST_CHECK(actualParams.hasFaceId()); |
| 217 | BOOST_CHECK_EQUAL(expectedParams.getFacePersistency(), actualParams.getFacePersistency()); |
| 218 | |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 219 | if (actual.getCode() == 200) { |
| 220 | if (expectedParams.hasFlags()) { |
Eric Newberry | f40551a | 2016-09-05 15:41:16 -0700 | [diff] [blame] | 221 | BOOST_CHECK_EQUAL(expectedParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED), |
| 222 | actualParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED)); |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 223 | } |
| 224 | else { |
Eric Newberry | f40551a | 2016-09-05 15:41:16 -0700 | [diff] [blame] | 225 | // local fields are disabled by default |
| 226 | BOOST_CHECK_EQUAL(actualParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED), false); |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 227 | } |
| 228 | } |
| 229 | else { |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 230 | BOOST_CHECK_EQUAL(expectedParams.getUri(), actualParams.getUri()); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 231 | } |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 232 | } |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 233 | |
| 234 | if (actual.getCode() != 200) { |
| 235 | // ensure face not created |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 236 | FaceUri uri(FaceType::getParameters().getUri()); |
Eric Newberry | b5aa7f5 | 2016-09-03 20:36:12 -0700 | [diff] [blame] | 237 | auto& faceTable = this->node1.manager.m_faceTable; |
| 238 | BOOST_CHECK(std::none_of(faceTable.begin(), faceTable.end(), [uri] (Face& face) { |
| 239 | return face.getRemoteUri() == uri; |
| 240 | })); |
| 241 | } |
| 242 | |
Eric Newberry | 4260241 | 2016-08-27 09:33:18 -0700 | [diff] [blame] | 243 | hasCallbackFired = true; |
| 244 | }); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 245 | |
Junxiao Shi | 221b6fe | 2016-07-14 18:21:56 +0000 | [diff] [blame] | 246 | this->node1.face.receive(*command); |
Junxiao Shi | b84e674 | 2016-07-19 13:16:22 +0000 | [diff] [blame] | 247 | this->advanceClocks(time::milliseconds(1), 5); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 248 | |
| 249 | BOOST_CHECK(hasCallbackFired); |
| 250 | } |
| 251 | |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 252 | BOOST_FIXTURE_TEST_CASE(ExistingFace, FaceManagerCommandFixture) |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 253 | { |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 254 | using FaceType = UdpFacePersistent; |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 255 | |
| 256 | { |
| 257 | // create face |
| 258 | |
| 259 | Name commandName("/localhost/nfd/faces"); |
| 260 | commandName.append("create"); |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 261 | commandName.append(FaceType::getParameters().wireEncode()); |
Junxiao Shi | b84e674 | 2016-07-19 13:16:22 +0000 | [diff] [blame] | 262 | auto command = makeInterest(commandName); |
Junxiao Shi | 221b6fe | 2016-07-14 18:21:56 +0000 | [diff] [blame] | 263 | m_keyChain.sign(*command); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 264 | |
Junxiao Shi | 221b6fe | 2016-07-14 18:21:56 +0000 | [diff] [blame] | 265 | this->node1.face.receive(*command); |
Junxiao Shi | b84e674 | 2016-07-19 13:16:22 +0000 | [diff] [blame] | 266 | this->advanceClocks(time::milliseconds(1), 5); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 267 | } |
| 268 | |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 269 | // find the created face |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 270 | auto foundFace = this->node1.findFaceByUri(FaceType::getParameters().getUri()); |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 271 | BOOST_REQUIRE(foundFace != nullptr); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 272 | |
| 273 | { |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 274 | // re-create face |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 275 | |
| 276 | Name commandName("/localhost/nfd/faces"); |
| 277 | commandName.append("create"); |
Davide Pesavento | a3c9ddb | 2017-04-10 22:15:24 -0400 | [diff] [blame^] | 278 | commandName.append(FaceType::getParameters().wireEncode()); |
Junxiao Shi | b84e674 | 2016-07-19 13:16:22 +0000 | [diff] [blame] | 279 | auto command = makeInterest(commandName); |
Junxiao Shi | 221b6fe | 2016-07-14 18:21:56 +0000 | [diff] [blame] | 280 | m_keyChain.sign(*command); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 281 | |
| 282 | bool hasCallbackFired = false; |
Junxiao Shi | b84e674 | 2016-07-19 13:16:22 +0000 | [diff] [blame] | 283 | this->node1.face.onSendData.connect( |
| 284 | [this, command, &hasCallbackFired, foundFace] (const Data& response) { |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 285 | if (!command->getName().isPrefixOf(response.getName())) { |
| 286 | return; |
| 287 | } |
| 288 | |
| 289 | ControlResponse actual(response.getContent().blockFromValue()); |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 290 | BOOST_REQUIRE_EQUAL(actual.getCode(), 409); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 291 | |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 292 | ControlParameters actualParams(actual.getBody()); |
Yanbiao Li | 58ba3f9 | 2017-02-15 14:27:18 +0000 | [diff] [blame] | 293 | BOOST_CHECK_EQUAL(foundFace->getId(), actualParams.getFaceId()); |
| 294 | BOOST_CHECK_EQUAL(foundFace->getRemoteUri().toString(), actualParams.getUri()); |
| 295 | BOOST_CHECK_EQUAL(foundFace->getPersistency(), actualParams.getFacePersistency()); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 296 | |
| 297 | hasCallbackFired = true; |
| 298 | }); |
| 299 | |
Junxiao Shi | 221b6fe | 2016-07-14 18:21:56 +0000 | [diff] [blame] | 300 | this->node1.face.receive(*command); |
Junxiao Shi | b84e674 | 2016-07-19 13:16:22 +0000 | [diff] [blame] | 301 | this->advanceClocks(time::milliseconds(1), 5); |
Yanbiao Li | 73860e3 | 2015-08-19 16:30:16 -0700 | [diff] [blame] | 302 | |
| 303 | BOOST_CHECK(hasCallbackFired); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | BOOST_AUTO_TEST_SUITE_END() // CreateFace |
| 308 | BOOST_AUTO_TEST_SUITE_END() // TestFaceManager |
| 309 | BOOST_AUTO_TEST_SUITE_END() // Mgmt |
| 310 | |
Weiwei Liu | f5aee94 | 2016-03-19 07:00:42 +0000 | [diff] [blame] | 311 | } // namespace tests |
| 312 | } // namespace nfd |