blob: 4601de6f355928875353b66d99c6ac4d0cd504c6 [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Junxiao Shi5ec80222014-03-25 20:08:05 -07002/**
Yanbiao Licbdacb22016-08-02 16:02:35 +08003 * Copyright (c) 2013-2016 Regents of the University of California.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07006 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -04007 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
Junxiao Shi5ec80222014-03-25 20:08:05 -070020 */
21
22#include "management/nfd-control-command.hpp"
Junxiao Shi5ec80222014-03-25 20:08:05 -070023
Alexander Afanasyevb1db7c62014-04-03 14:57:25 -070024#include "boost-test.hpp"
Junxiao Shi5ec80222014-03-25 20:08:05 -070025
26namespace ndn {
27namespace nfd {
Spyridon Mastorakis429634f2015-02-19 17:35:33 -080028namespace tests {
Junxiao Shi5ec80222014-03-25 20:08:05 -070029
Spyridon Mastorakis429634f2015-02-19 17:35:33 -080030BOOST_AUTO_TEST_SUITE(ManagementNfdControlCommand)
Junxiao Shi5ec80222014-03-25 20:08:05 -070031
32BOOST_AUTO_TEST_CASE(FaceCreate)
33{
34 FaceCreateCommand command;
Junxiao Shi5ec80222014-03-25 20:08:05 -070035
36 ControlParameters p1;
37 p1.setUri("tcp4://192.0.2.1")
38 .setFaceId(4);
39 BOOST_CHECK_THROW(command.validateRequest(p1), ControlCommand::ArgumentError);
Yukai Tud93c5fc2015-08-25 11:37:16 +080040 BOOST_CHECK_THROW(command.validateResponse(p1), ControlCommand::ArgumentError);
Junxiao Shi5ec80222014-03-25 20:08:05 -070041
42 ControlParameters p2;
43 p2.setName("ndn:/example");
44 BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
45 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
46
47 ControlParameters p3;
48 p3.setUri("tcp4://192.0.2.1")
49 .setFaceId(0);
50 BOOST_CHECK_THROW(command.validateResponse(p3), ControlCommand::ArgumentError);
Junxiao Shi5de006b2014-10-26 20:20:52 -070051
52 ControlParameters p4;
Yukai Tud93c5fc2015-08-25 11:37:16 +080053 p4.setUri("tcp4://192.0.2.1")
Eric Newberry138ef2c2016-08-15 20:29:03 -070054 .setFacePersistency(FACE_PERSISTENCY_PERSISTENT)
Eric Newberryda916d62016-08-11 23:04:34 -070055 .setFlags(0x3)
56 .setMask(0x1);
Yukai Tud93c5fc2015-08-25 11:37:16 +080057 BOOST_CHECK_NO_THROW(command.validateRequest(p4));
58
Eric Newberryda916d62016-08-11 23:04:34 -070059 ControlParameters p5;
60 p5.setUri("tcp4://192.0.2.1")
Eric Newberry138ef2c2016-08-15 20:29:03 -070061 .setFacePersistency(FACE_PERSISTENCY_PERSISTENT)
Eric Newberryda916d62016-08-11 23:04:34 -070062 .setFlags(0x1);
63 BOOST_CHECK_THROW(command.validateRequest(p5), ControlCommand::ArgumentError);
64
Yukai Tud93c5fc2015-08-25 11:37:16 +080065 p4.unsetFacePersistency();
66 BOOST_CHECK_NO_THROW(command.validateRequest(p4));
67 command.applyDefaultsToRequest(p4);
68 BOOST_REQUIRE(p4.hasFacePersistency());
Eric Newberry138ef2c2016-08-15 20:29:03 -070069 BOOST_CHECK_EQUAL(p4.getFacePersistency(), FACE_PERSISTENCY_PERSISTENT);
Yukai Tud93c5fc2015-08-25 11:37:16 +080070
Yukai Tud93c5fc2015-08-25 11:37:16 +080071 ControlParameters p6;
Eric Newberryda916d62016-08-11 23:04:34 -070072 p6.setFaceId(4)
73 .setUri("tcp4://192.0.2.1")
Eric Newberry138ef2c2016-08-15 20:29:03 -070074 .setFacePersistency(FACE_PERSISTENCY_PERSISTENT);
Eric Newberryda916d62016-08-11 23:04:34 -070075 BOOST_CHECK_NO_THROW(command.validateResponse(p6));
76
77 ControlParameters p7;
78 p7.setUri("tcp4://192.0.2.1:6363");
79 Name n7;
80 BOOST_CHECK_NO_THROW(n7 = command.getRequestName("/PREFIX", p7));
81 BOOST_CHECK(Name("ndn:/PREFIX/faces/create").isPrefixOf(n7));
82
83 ControlParameters p8;
84 p8.setFaceId(5)
Eric Newberry138ef2c2016-08-15 20:29:03 -070085 .setFacePersistency(FACE_PERSISTENCY_PERMANENT)
Eric Newberryda916d62016-08-11 23:04:34 -070086 .setFlags(0x2);
87 BOOST_CHECK_NO_THROW(command.validateResponse(p8));
Junxiao Shi5ec80222014-03-25 20:08:05 -070088}
89
Yanbiao Licbdacb22016-08-02 16:02:35 +080090BOOST_AUTO_TEST_CASE(FaceUpdate)
91{
92 FaceUpdateCommand command;
93
94 ControlParameters p1;
95 p1.setFaceId(0);
Eric Newberryda916d62016-08-11 23:04:34 -070096 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
Eric Newberry138ef2c2016-08-15 20:29:03 -070097 BOOST_CHECK_THROW(command.validateResponse(p1), ControlCommand::ArgumentError);
Yanbiao Licbdacb22016-08-02 16:02:35 +080098
99 p1.setFaceId(1);
100 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
Eric Newberry138ef2c2016-08-15 20:29:03 -0700101 BOOST_CHECK_THROW(command.validateResponse(p1), ControlCommand::ArgumentError);
102 command.applyDefaultsToRequest(p1);
103 BOOST_CHECK_EQUAL(p1.getFaceId(), 1);
Yanbiao Licbdacb22016-08-02 16:02:35 +0800104
105 ControlParameters p2;
106 p2.setFaceId(1)
Eric Newberry138ef2c2016-08-15 20:29:03 -0700107 .setFacePersistency(FACE_PERSISTENCY_PERSISTENT)
108 .setFlagBit(BIT_LOCAL_FIELDS_ENABLED, false);
Yanbiao Licbdacb22016-08-02 16:02:35 +0800109 BOOST_CHECK_NO_THROW(command.validateRequest(p2));
Eric Newberry138ef2c2016-08-15 20:29:03 -0700110 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError); // Mask forbidden but present
Yanbiao Licbdacb22016-08-02 16:02:35 +0800111
Eric Newberry138ef2c2016-08-15 20:29:03 -0700112 // Flags without Mask
Eric Newberryda916d62016-08-11 23:04:34 -0700113 p2.unsetMask();
114 BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
Eric Newberry138ef2c2016-08-15 20:29:03 -0700115 BOOST_CHECK_NO_THROW(command.validateResponse(p2));
116
117 p2.setFlagBit(BIT_LOCAL_FIELDS_ENABLED, false);
118 p2.unsetFaceId();
119 BOOST_CHECK_NO_THROW(command.validateRequest(p2));
Eric Newberryda916d62016-08-11 23:04:34 -0700120
Yanbiao Licbdacb22016-08-02 16:02:35 +0800121 ControlParameters p3;
Eric Newberryda916d62016-08-11 23:04:34 -0700122 p3.setFaceId(1)
123 .setName("/ndn/name");
Yanbiao Licbdacb22016-08-02 16:02:35 +0800124 BOOST_CHECK_THROW(command.validateRequest(p3), ControlCommand::ArgumentError);
125 BOOST_CHECK_THROW(command.validateResponse(p3), ControlCommand::ArgumentError);
126
127 ControlParameters p4;
128 p4.setFaceId(1)
Eric Newberryda916d62016-08-11 23:04:34 -0700129 .setUri("tcp4://192.0.2.1");
Yanbiao Licbdacb22016-08-02 16:02:35 +0800130 BOOST_CHECK_THROW(command.validateRequest(p4), ControlCommand::ArgumentError);
131 BOOST_CHECK_THROW(command.validateResponse(p4), ControlCommand::ArgumentError);
132
133 ControlParameters p5;
Eric Newberry138ef2c2016-08-15 20:29:03 -0700134 BOOST_CHECK_NO_THROW(command.validateRequest(p5));
135 BOOST_CHECK_THROW(command.validateResponse(p5), ControlCommand::ArgumentError);
136 BOOST_CHECK(!p5.hasFaceId());
137 command.applyDefaultsToRequest(p5);
138 BOOST_REQUIRE(p5.hasFaceId());
139 BOOST_CHECK_NO_THROW(command.validateRequest(p5));
140 BOOST_CHECK_THROW(command.validateResponse(p5), ControlCommand::ArgumentError);
141 BOOST_CHECK_EQUAL(p5.getFaceId(), 0);
Yanbiao Licbdacb22016-08-02 16:02:35 +0800142}
143
Junxiao Shi5ec80222014-03-25 20:08:05 -0700144BOOST_AUTO_TEST_CASE(FaceDestroy)
145{
146 FaceDestroyCommand command;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700147
148 ControlParameters p1;
149 p1.setUri("tcp4://192.0.2.1")
150 .setFaceId(4);
151 BOOST_CHECK_THROW(command.validateRequest(p1), ControlCommand::ArgumentError);
152 BOOST_CHECK_THROW(command.validateResponse(p1), ControlCommand::ArgumentError);
153
154 ControlParameters p2;
155 p2.setFaceId(0);
156 BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
157 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
158
159 ControlParameters p3;
160 p3.setFaceId(6);
161 BOOST_CHECK_NO_THROW(command.validateRequest(p3));
162 BOOST_CHECK_NO_THROW(command.validateResponse(p3));
Junxiao Shi5de006b2014-10-26 20:20:52 -0700163 Name n3;
164 BOOST_CHECK_NO_THROW(n3 = command.getRequestName("/PREFIX", p3));
165 BOOST_CHECK(Name("ndn:/PREFIX/faces/destroy").isPrefixOf(n3));
Junxiao Shi5ec80222014-03-25 20:08:05 -0700166}
167
168BOOST_AUTO_TEST_CASE(FaceEnableLocalControl)
169{
170 FaceEnableLocalControlCommand command;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700171
172 ControlParameters p1;
173 p1.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
174 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
175 BOOST_CHECK_NO_THROW(command.validateResponse(p1));
Junxiao Shi5de006b2014-10-26 20:20:52 -0700176 Name n1;
177 BOOST_CHECK_NO_THROW(n1 = command.getRequestName("/PREFIX", p1));
178 BOOST_CHECK(Name("ndn:/PREFIX/faces/enable-local-control").isPrefixOf(n1));
Junxiao Shi5ec80222014-03-25 20:08:05 -0700179
180 ControlParameters p2;
181 p2.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID)
182 .setFaceId(9);
183 BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
184 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
Junxiao Shi6888bc12014-03-29 23:01:41 -0700185
186 ControlParameters p3;
187 p3.setLocalControlFeature(static_cast<LocalControlFeature>(666));
188 BOOST_CHECK_THROW(command.validateRequest(p3), ControlCommand::ArgumentError);
189 BOOST_CHECK_THROW(command.validateResponse(p3), ControlCommand::ArgumentError);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700190}
191
192BOOST_AUTO_TEST_CASE(FaceDisableLocalControl)
193{
194 FaceDisableLocalControlCommand command;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700195
196 ControlParameters p1;
197 p1.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
198 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
199 BOOST_CHECK_NO_THROW(command.validateResponse(p1));
Junxiao Shi5de006b2014-10-26 20:20:52 -0700200 Name n1;
201 BOOST_CHECK_NO_THROW(n1 = command.getRequestName("/PREFIX", p1));
202 BOOST_CHECK(Name("ndn:/PREFIX/faces/disable-local-control").isPrefixOf(n1));
Junxiao Shi5ec80222014-03-25 20:08:05 -0700203
204 ControlParameters p2;
205 p2.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID)
206 .setFaceId(9);
207 BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
208 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
Junxiao Shi6888bc12014-03-29 23:01:41 -0700209
210 ControlParameters p3;
211 p3.setLocalControlFeature(static_cast<LocalControlFeature>(666));
212 BOOST_CHECK_THROW(command.validateRequest(p3), ControlCommand::ArgumentError);
213 BOOST_CHECK_THROW(command.validateResponse(p3), ControlCommand::ArgumentError);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700214}
215
216BOOST_AUTO_TEST_CASE(FibAddNextHop)
217{
218 FibAddNextHopCommand command;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700219
220 ControlParameters p1;
221 p1.setName("ndn:/")
222 .setFaceId(22);
223 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
224 BOOST_CHECK_THROW(command.validateResponse(p1), ControlCommand::ArgumentError);
Junxiao Shi5de006b2014-10-26 20:20:52 -0700225 Name n1;
226 BOOST_CHECK_NO_THROW(n1 = command.getRequestName("/PREFIX", p1));
227 BOOST_CHECK(Name("ndn:/PREFIX/fib/add-nexthop").isPrefixOf(n1));
Junxiao Shi5ec80222014-03-25 20:08:05 -0700228
229 ControlParameters p2;
230 p2.setName("ndn:/example")
231 .setFaceId(0)
232 .setCost(6);
233 BOOST_CHECK_NO_THROW(command.validateRequest(p2));
234 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
235
236 command.applyDefaultsToRequest(p1);
237 BOOST_REQUIRE(p1.hasCost());
238 BOOST_CHECK_EQUAL(p1.getCost(), 0);
Junxiao Shicaac54e2014-05-20 15:27:01 -0700239
240 p1.unsetFaceId();
241 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
242 command.applyDefaultsToRequest(p1);
243 BOOST_REQUIRE(p1.hasFaceId());
244 BOOST_CHECK_EQUAL(p1.getFaceId(), 0);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700245}
246
247BOOST_AUTO_TEST_CASE(FibRemoveNextHop)
248{
249 FibRemoveNextHopCommand command;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700250
251 ControlParameters p1;
252 p1.setName("ndn:/")
253 .setFaceId(22);
254 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
255 BOOST_CHECK_NO_THROW(command.validateResponse(p1));
Junxiao Shi5de006b2014-10-26 20:20:52 -0700256 Name n1;
257 BOOST_CHECK_NO_THROW(n1 = command.getRequestName("/PREFIX", p1));
258 BOOST_CHECK(Name("ndn:/PREFIX/fib/remove-nexthop").isPrefixOf(n1));
Junxiao Shi5ec80222014-03-25 20:08:05 -0700259
260 ControlParameters p2;
261 p2.setName("ndn:/example")
262 .setFaceId(0);
263 BOOST_CHECK_NO_THROW(command.validateRequest(p2));
264 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
Junxiao Shicaac54e2014-05-20 15:27:01 -0700265
266 p1.unsetFaceId();
267 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
268 command.applyDefaultsToRequest(p1);
269 BOOST_REQUIRE(p1.hasFaceId());
270 BOOST_CHECK_EQUAL(p1.getFaceId(), 0);
Junxiao Shi5ec80222014-03-25 20:08:05 -0700271}
272
273BOOST_AUTO_TEST_CASE(StrategyChoiceSet)
274{
275 StrategyChoiceSetCommand command;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700276
277 ControlParameters p1;
278 p1.setName("ndn:/")
279 .setStrategy("ndn:/strategy/P");
280 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
281 BOOST_CHECK_NO_THROW(command.validateResponse(p1));
Junxiao Shi5de006b2014-10-26 20:20:52 -0700282 Name n1;
283 BOOST_CHECK_NO_THROW(n1 = command.getRequestName("/PREFIX", p1));
284 BOOST_CHECK(Name("ndn:/PREFIX/strategy-choice/set").isPrefixOf(n1));
Junxiao Shi5ec80222014-03-25 20:08:05 -0700285
286 ControlParameters p2;
287 p2.setName("ndn:/example");
288 BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
289 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
290}
291
292BOOST_AUTO_TEST_CASE(StrategyChoiceUnset)
293{
294 StrategyChoiceUnsetCommand command;
Junxiao Shi5ec80222014-03-25 20:08:05 -0700295
296 ControlParameters p1;
297 p1.setName("ndn:/example");
298 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
299 BOOST_CHECK_NO_THROW(command.validateResponse(p1));
Junxiao Shi5de006b2014-10-26 20:20:52 -0700300 Name n1;
301 BOOST_CHECK_NO_THROW(n1 = command.getRequestName("/PREFIX", p1));
302 BOOST_CHECK(Name("ndn:/PREFIX/strategy-choice/unset").isPrefixOf(n1));
Junxiao Shi5ec80222014-03-25 20:08:05 -0700303
304 ControlParameters p2;
305 p2.setName("ndn:/example")
306 .setStrategy("ndn:/strategy/P");
307 BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
308 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
309
310 ControlParameters p3;
311 p3.setName("ndn:/");
312 BOOST_CHECK_THROW(command.validateRequest(p3), ControlCommand::ArgumentError);
313 BOOST_CHECK_THROW(command.validateResponse(p3), ControlCommand::ArgumentError);
314}
315
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700316BOOST_AUTO_TEST_CASE(RibRegister)
317{
318 RibRegisterCommand command;
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700319
320 ControlParameters p1;
321 p1.setName("ndn:/");
322 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
323 BOOST_CHECK_THROW(command.validateResponse(p1), ControlCommand::ArgumentError);
Junxiao Shi5de006b2014-10-26 20:20:52 -0700324 Name n1;
325 BOOST_CHECK_NO_THROW(n1 = command.getRequestName("/PREFIX", p1));
326 BOOST_CHECK(Name("ndn:/PREFIX/rib/register").isPrefixOf(n1));
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700327
328 command.applyDefaultsToRequest(p1);
329 BOOST_REQUIRE(p1.hasOrigin());
330 BOOST_CHECK_EQUAL(p1.getOrigin(), static_cast<uint64_t>(ROUTE_ORIGIN_APP));
331 BOOST_REQUIRE(p1.hasCost());
332 BOOST_CHECK_EQUAL(p1.getCost(), 0);
333 BOOST_REQUIRE(p1.hasFlags());
334 BOOST_CHECK_EQUAL(p1.getFlags(), static_cast<uint64_t>(ROUTE_FLAG_CHILD_INHERIT));
Alexander Afanasyev21f13b02014-07-17 16:17:34 -0700335 BOOST_CHECK_EQUAL(p1.hasExpirationPeriod(), false);
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700336
337 ControlParameters p2;
338 p2.setName("ndn:/example")
339 .setFaceId(2)
340 .setCost(6);
341 BOOST_CHECK_NO_THROW(command.validateRequest(p2));
342 command.applyDefaultsToRequest(p2);
Alexander Afanasyev21f13b02014-07-17 16:17:34 -0700343 BOOST_CHECK_EQUAL(p2.hasExpirationPeriod(), false);
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700344 BOOST_CHECK_NO_THROW(command.validateResponse(p2));
345}
346
347BOOST_AUTO_TEST_CASE(RibUnregister)
348{
349 RibUnregisterCommand command;
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700350
351 ControlParameters p1;
352 p1.setName("ndn:/")
353 .setFaceId(22)
354 .setOrigin(ROUTE_ORIGIN_STATIC);
355 BOOST_CHECK_NO_THROW(command.validateRequest(p1));
356 BOOST_CHECK_NO_THROW(command.validateResponse(p1));
Junxiao Shi5de006b2014-10-26 20:20:52 -0700357 Name n1;
358 BOOST_CHECK_NO_THROW(n1 = command.getRequestName("/PREFIX", p1));
359 BOOST_CHECK(Name("ndn:/PREFIX/rib/unregister").isPrefixOf(n1));
Junxiao Shi5f6c74f2014-04-18 16:29:44 -0700360
361 ControlParameters p2;
362 p2.setName("ndn:/example")
363 .setFaceId(0)
364 .setOrigin(ROUTE_ORIGIN_APP);
365 BOOST_CHECK_NO_THROW(command.validateRequest(p2));
366 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
367
368 p2.unsetFaceId();
369 BOOST_CHECK_NO_THROW(command.validateRequest(p2));
370 BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
371}
372
Junxiao Shi5ec80222014-03-25 20:08:05 -0700373BOOST_AUTO_TEST_SUITE_END()
374
Spyridon Mastorakis429634f2015-02-19 17:35:33 -0800375} // namespace tests
Junxiao Shi5ec80222014-03-25 20:08:05 -0700376} // namespace nfd
377} // namespace ndn