mgmt: permit LocalUri in FaceCreateCommand response
refs #3956
Change-Id: If81c9b59fa52cb6d07539f9a2568721ec87dfcb9
diff --git a/src/mgmt/nfd/control-command.cpp b/src/mgmt/nfd/control-command.cpp
index a51ecb6..de840d6 100644
--- a/src/mgmt/nfd/control-command.cpp
+++ b/src/mgmt/nfd/control-command.cpp
@@ -104,7 +104,8 @@
.required(CONTROL_PARAMETER_FACE_ID)
.required(CONTROL_PARAMETER_FACE_PERSISTENCY)
.optional(CONTROL_PARAMETER_FLAGS)
- .optional(CONTROL_PARAMETER_URI);
+ .optional(CONTROL_PARAMETER_URI)
+ .optional(CONTROL_PARAMETER_LOCAL_URI);
}
void
diff --git a/tests/unit-tests/mgmt/nfd/control-command.t.cpp b/tests/unit-tests/mgmt/nfd/control-command.t.cpp
index 6e60ad2..ecabab2 100644
--- a/tests/unit-tests/mgmt/nfd/control-command.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/control-command.t.cpp
@@ -60,10 +60,13 @@
BOOST_CHECK_NO_THROW(command.validateRequest(p4));
ControlParameters p5;
- p5.setUri("tcp4://192.0.2.1")
- .setFacePersistency(FACE_PERSISTENCY_PERSISTENT)
+ p5.setFaceId(27518)
+ .setUri("tcp4://192.0.2.1:6363")
+ .setLocalUri("tcp4://192.0.2.2:32114")
+ .setFacePersistency(FACE_PERSISTENCY_PERMANENT)
.setFlags(0x1);
BOOST_CHECK_THROW(command.validateRequest(p5), ControlCommand::ArgumentError);
+ BOOST_CHECK_NO_THROW(command.validateResponse(p5));
p4.unsetFacePersistency();
BOOST_CHECK_NO_THROW(command.validateRequest(p4));