blob: 921c1ffa14d0886a3d83c8be4529a41075471c10 [file] [log] [blame]
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +01001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
Alexander Afanasyev0eb70652014-02-27 18:35:07 -08007#include "face/unix-stream-factory.hpp"
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +01008#include <ndn-cpp-dev/security/key-chain.hpp>
9
Junxiao Shid9ee45c2014-02-27 15:38:11 -070010#include "tests/test-common.hpp"
Junxiao Shi7e2413b2014-03-02 11:15:09 -070011#include "tests/core/limited-io.hpp"
Junxiao Shid9ee45c2014-02-27 15:38:11 -070012
13namespace nfd {
14namespace tests {
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010015
16using namespace boost::asio::local;
17
Junxiao Shi61e3cc52014-03-03 20:40:28 -070018#define CHANNEL_PATH1 "unix-stream-test.1.sock"
19#define CHANNEL_PATH2 "unix-stream-test.2.sock"
20
Junxiao Shid9ee45c2014-02-27 15:38:11 -070021BOOST_FIXTURE_TEST_SUITE(FaceUnixStream, BaseFixture)
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010022
23BOOST_AUTO_TEST_CASE(ChannelMap)
24{
Alexander Afanasyev0eb70652014-02-27 18:35:07 -080025 UnixStreamFactory factory;
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010026
Junxiao Shi61e3cc52014-03-03 20:40:28 -070027 shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
28 shared_ptr<UnixStreamChannel> channel1a = factory.createChannel(CHANNEL_PATH1);
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010029 BOOST_CHECK_EQUAL(channel1, channel1a);
Junxiao Shi61e3cc52014-03-03 20:40:28 -070030 std::string channel1uri = channel1->getUri().toString();
31 BOOST_CHECK_EQUAL(channel1uri.find("unix:///"), 0); // third '/' is the path separator
32 BOOST_CHECK_EQUAL(channel1uri.rfind(CHANNEL_PATH1),
33 channel1uri.size() - std::string(CHANNEL_PATH1).size());
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010034
Junxiao Shi61e3cc52014-03-03 20:40:28 -070035 shared_ptr<UnixStreamChannel> channel2 = factory.createChannel(CHANNEL_PATH2);
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010036 BOOST_CHECK_NE(channel1, channel2);
37}
38
Junxiao Shid9ee45c2014-02-27 15:38:11 -070039class EndToEndFixture : protected BaseFixture
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010040{
41public:
42 void
43 client_onConnect(const boost::system::error_code& error)
44 {
45 BOOST_CHECK_MESSAGE(!error, error.message());
46
Junxiao Shi7e2413b2014-03-02 11:15:09 -070047 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010048 }
49
50 void
Junxiao Shi61e3cc52014-03-03 20:40:28 -070051 channel1_onFaceCreated(const shared_ptr<Face>& newFace)
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010052 {
53 BOOST_CHECK(!static_cast<bool>(m_face1));
Junxiao Shi61e3cc52014-03-03 20:40:28 -070054 m_face1 = static_pointer_cast<UnixStreamFace>(newFace);
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010055 m_face1->onReceiveInterest +=
56 bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
57 m_face1->onReceiveData +=
58 bind(&EndToEndFixture::face1_onReceiveData, this, _1);
59
Junxiao Shi7e2413b2014-03-02 11:15:09 -070060 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010061 }
62
63 void
64 channel1_onConnectFailed(const std::string& reason)
65 {
66 BOOST_CHECK_MESSAGE(false, reason);
67
Junxiao Shi7e2413b2014-03-02 11:15:09 -070068 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010069 }
Alexander Afanasyevbd220a02014-02-20 00:29:56 -080070
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010071 void
72 face1_onReceiveInterest(const Interest& interest)
73 {
74 m_face1_receivedInterests.push_back(interest);
75
Junxiao Shi7e2413b2014-03-02 11:15:09 -070076 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010077 }
Alexander Afanasyevbd220a02014-02-20 00:29:56 -080078
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010079 void
80 face1_onReceiveData(const Data& data)
81 {
82 m_face1_receivedDatas.push_back(data);
83
Junxiao Shi7e2413b2014-03-02 11:15:09 -070084 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010085 }
86
87 void
88 face2_onReceiveInterest(const Interest& interest)
89 {
90 m_face2_receivedInterests.push_back(interest);
91
Junxiao Shi7e2413b2014-03-02 11:15:09 -070092 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010093 }
Alexander Afanasyevbd220a02014-02-20 00:29:56 -080094
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010095 void
96 face2_onReceiveData(const Data& data)
97 {
98 m_face2_receivedDatas.push_back(data);
99
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700100 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100101 }
102
103 void
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700104 channel_onFaceCreated(const shared_ptr<Face>& newFace)
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100105 {
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700106 m_faces.push_back(static_pointer_cast<UnixStreamFace>(newFace));
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100107
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700108 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100109 }
110
111 void
112 channel_onConnectFailed(const std::string& reason)
113 {
114 BOOST_CHECK_MESSAGE(false, reason);
115
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700116 m_limitedIo.afterOp();
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100117 }
118
119protected:
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700120 LimitedIo m_limitedIo;
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100121
122 shared_ptr<UnixStreamFace> m_face1;
123 std::vector<Interest> m_face1_receivedInterests;
124 std::vector<Data> m_face1_receivedDatas;
125 shared_ptr<UnixStreamFace> m_face2;
126 std::vector<Interest> m_face2_receivedInterests;
127 std::vector<Data> m_face2_receivedDatas;
128
129 std::list< shared_ptr<UnixStreamFace> > m_faces;
130};
131
132
133BOOST_FIXTURE_TEST_CASE(EndToEnd, EndToEndFixture)
134{
Alexander Afanasyev0eb70652014-02-27 18:35:07 -0800135 UnixStreamFactory factory;
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100136
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700137 shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100138 channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
139 bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
140
141 shared_ptr<stream_protocol::socket> client =
Alexander Afanasyev7329e022014-02-27 14:47:22 -0800142 make_shared<stream_protocol::socket>(boost::ref(g_io));
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700143 client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100144 bind(&EndToEndFixture::client_onConnect, this, _1));
145
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700146 BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
147 "UnixStreamChannel error: cannot connect or cannot accept connection");
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100148
149 BOOST_REQUIRE(static_cast<bool>(m_face1));
150
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100151 m_face2 = make_shared<UnixStreamFace>(client);
152 m_face2->onReceiveInterest +=
153 bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
154 m_face2->onReceiveData +=
155 bind(&EndToEndFixture::face2_onReceiveData, this, _1);
156
157 Interest interest1("ndn:/TpnzGvW9R");
158 Data data1 ("ndn:/KfczhUqVix");
159 data1.setContent(0, 0);
160 Interest interest2("ndn:/QWiIMfj5sL");
161 Data data2 ("ndn:/XNBV796f");
162 data2.setContent(0, 0);
163
164 ndn::SignatureSha256WithRsa fakeSignature;
165 fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
166
167 // set fake signature on data1 and data2
168 data1.setSignature(fakeSignature);
169 data2.setSignature(fakeSignature);
170
171 m_face1->sendInterest(interest1);
172 m_face1->sendData (data1 );
173 m_face2->sendInterest(interest2);
174 m_face2->sendData (data2 );
175
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700176 BOOST_CHECK_MESSAGE(m_limitedIo.run(4, time::seconds(1)) == LimitedIo::EXCEED_OPS,
177 "UnixStreamChannel error: cannot send or receive Interest/Data packets");
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100178
179 BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
180 BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
181 BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
182 BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
183
184 BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
185 BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
186 BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
187 BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
188}
189
190BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
191{
Alexander Afanasyev0eb70652014-02-27 18:35:07 -0800192 UnixStreamFactory factory;
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100193
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700194 shared_ptr<UnixStreamChannel> channel = factory.createChannel(CHANNEL_PATH1);
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100195 channel->listen(bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
196 bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
197
198 shared_ptr<stream_protocol::socket> client1 =
Alexander Afanasyev7329e022014-02-27 14:47:22 -0800199 make_shared<stream_protocol::socket>(boost::ref(g_io));
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700200 client1->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100201 bind(&EndToEndFixture::client_onConnect, this, _1));
202
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700203 BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
204 "UnixStreamChannel error: cannot connect or cannot accept connection");
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100205
206 BOOST_CHECK_EQUAL(m_faces.size(), 1);
207
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100208 shared_ptr<stream_protocol::socket> client2 =
Alexander Afanasyev7329e022014-02-27 14:47:22 -0800209 make_shared<stream_protocol::socket>(boost::ref(g_io));
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700210 client2->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100211 bind(&EndToEndFixture::client_onConnect, this, _1));
212
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700213 BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
214 "UnixStreamChannel error: cannot accept multiple connections");
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100215
216 BOOST_CHECK_EQUAL(m_faces.size(), 2);
217
218 // now close one of the faces
219 m_faces.front()->close();
220
221 // we should still be able to send/receive with the other one
222 m_face1 = m_faces.back();
223 m_face1->onReceiveInterest +=
224 bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
225 m_face1->onReceiveData +=
226 bind(&EndToEndFixture::face1_onReceiveData, this, _1);
227
228 m_face2 = make_shared<UnixStreamFace>(client2);
229 m_face2->onReceiveInterest +=
230 bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
231 m_face2->onReceiveData +=
232 bind(&EndToEndFixture::face2_onReceiveData, this, _1);
233
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100234 Interest interest1("ndn:/TpnzGvW9R");
235 Data data1 ("ndn:/KfczhUqVix");
236 data1.setContent(0, 0);
237 Interest interest2("ndn:/QWiIMfj5sL");
238 Data data2 ("ndn:/XNBV796f");
239 data2.setContent(0, 0);
240
241 ndn::SignatureSha256WithRsa fakeSignature;
242 fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
243
244 // set fake signature on data1 and data2
245 data1.setSignature(fakeSignature);
246 data2.setSignature(fakeSignature);
247
248 m_face1->sendInterest(interest1);
249 m_face1->sendData (data1 );
250 m_face2->sendInterest(interest2);
251 m_face2->sendData (data2 );
252
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700253 BOOST_CHECK_MESSAGE(m_limitedIo.run(4, time::seconds(1)) == LimitedIo::EXCEED_OPS,
254 "UnixStreamChannel error: cannot send or receive Interest/Data packets");
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100255
256 BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
257 BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
258 BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
259 BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
260
261 BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
262 BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
263 BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
264 BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
265}
266
Alexander Afanasyevbd220a02014-02-20 00:29:56 -0800267static inline void
268noOp()
269{
270}
271
272BOOST_FIXTURE_TEST_CASE(UnixStreamFaceLocalControlHeader, EndToEndFixture)
273{
Alexander Afanasyev0eb70652014-02-27 18:35:07 -0800274 UnixStreamFactory factory;
Alexander Afanasyevbd220a02014-02-20 00:29:56 -0800275
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700276 shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
Alexander Afanasyevbd220a02014-02-20 00:29:56 -0800277 channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
278 bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
279
280 shared_ptr<stream_protocol::socket> client =
Alexander Afanasyev7329e022014-02-27 14:47:22 -0800281 make_shared<stream_protocol::socket>(boost::ref(g_io));
Junxiao Shi61e3cc52014-03-03 20:40:28 -0700282 client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
Alexander Afanasyevbd220a02014-02-20 00:29:56 -0800283 bind(&EndToEndFixture::client_onConnect, this, _1));
284
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700285 BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
286 "UnixStreamChannel error: cannot connect or cannot accept connection");
Alexander Afanasyevbd220a02014-02-20 00:29:56 -0800287
288 BOOST_REQUIRE(static_cast<bool>(m_face1));
289
Alexander Afanasyevbd220a02014-02-20 00:29:56 -0800290 m_face2 = make_shared<UnixStreamFace>(client);
291 m_face2->onReceiveInterest +=
292 bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
293 m_face2->onReceiveData +=
294 bind(&EndToEndFixture::face2_onReceiveData, this, _1);
295
296 Interest interest1("ndn:/TpnzGvW9R");
297 Data data1 ("ndn:/KfczhUqVix");
298 data1.setContent(0, 0);
299 Interest interest2("ndn:/QWiIMfj5sL");
300 Data data2 ("ndn:/XNBV796f");
301 data2.setContent(0, 0);
302
303 ndn::SignatureSha256WithRsa fakeSignature;
304 fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
305
306 // set fake signature on data1 and data2
307 data1.setSignature(fakeSignature);
308 data2.setSignature(fakeSignature);
309
310 m_face1->setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID);
311 m_face1->setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_NEXTHOP_FACEID);
312
313 BOOST_CHECK(m_face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID));
314 BOOST_CHECK(m_face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_HEADER_FEATURE_NEXTHOP_FACEID));
315
316 m_face2->setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID);
317 m_face2->setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_NEXTHOP_FACEID);
318
319 BOOST_CHECK(m_face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID));
320 BOOST_CHECK(m_face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_HEADER_FEATURE_NEXTHOP_FACEID));
321
322 ////////////////////////////////////////////////////////
323
324 interest1.setIncomingFaceId(11);
325 interest1.setNextHopFaceId(111);
326
327 m_face1->sendInterest(interest1);
328
329 data1.setIncomingFaceId(22);
330 data1.getLocalControlHeader().setNextHopFaceId(222);
331
332 m_face1->sendData (data1);
333
334 //
335
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700336 BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
337 "UnixStreamChannel error: cannot send or receive Interest/Data packets");
Alexander Afanasyevbd220a02014-02-20 00:29:56 -0800338
339 BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
340 BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
341
342 // sending allows only IncomingFaceId, receiving allows only NextHopFaceId
343 BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
344 BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), false);
345
346 BOOST_CHECK_EQUAL(m_face2_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
347 BOOST_CHECK_EQUAL(m_face2_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
348
349 ////////////////////////////////////////////////////////
350
351 using namespace boost::asio;
352
353 std::vector<const_buffer> interestWithHeader;
354 Block iHeader = interest1.getLocalControlHeader().wireEncode(interest1, true, true);
355 Block iPayload = interest1.wireEncode();
356 interestWithHeader.push_back(buffer(iHeader.wire(), iHeader.size()));
357 interestWithHeader.push_back(buffer(iPayload.wire(), iPayload.size()));
358
359 std::vector<const_buffer> dataWithHeader;
360 Block dHeader = data1.getLocalControlHeader().wireEncode(data1, true, true);
361 Block dPayload = data1.wireEncode();
362 dataWithHeader.push_back(buffer(dHeader.wire(), dHeader.size()));
363 dataWithHeader.push_back(buffer(dPayload.wire(), dPayload.size()));
364
365 //
366
367 client->async_send(interestWithHeader, bind(&noOp));
368 client->async_send(dataWithHeader, bind(&noOp));
369
Junxiao Shi7e2413b2014-03-02 11:15:09 -0700370 BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
371 "UnixStreamChannel error: cannot send or receive Interest/Data packets");
Alexander Afanasyevbd220a02014-02-20 00:29:56 -0800372
373 BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
374 BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
375
376 BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
377 BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), true);
378 BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getNextHopFaceId(), 111);
379
380 BOOST_CHECK_EQUAL(m_face1_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
381 BOOST_CHECK_EQUAL(m_face1_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
382}
383
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100384BOOST_AUTO_TEST_SUITE_END()
385
Junxiao Shid9ee45c2014-02-27 15:38:11 -0700386} // namespace tests
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +0100387} // namespace nfd