face+mgmt: allow congestion marking parameters to be enabled and set

refs #4465

Change-Id: I9d49135ab32bacb2885b70031c573f7c8709ac1f
diff --git a/tests/daemon/face/ethernet-factory.t.cpp b/tests/daemon/face/ethernet-factory.t.cpp
index 8bdc139..70a9d5f 100644
--- a/tests/daemon/face/ethernet-factory.t.cpp
+++ b/tests/daemon/face/ethernet-factory.t.cpp
@@ -439,7 +439,7 @@
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:5e]"),
              FaceUri("dev://eth0"),
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 504, "No channels available to connect"});
 
   SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
@@ -448,25 +448,31 @@
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:5e]"),
              localUri,
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:5e]"),
              localUri,
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:53]"),
              localUri,
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:57]"),
              localUri,
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, true},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, true, false},
+             {CreateFaceExpectedResult::SUCCESS, 0, ""});
+
+  createFace(factory,
+             FaceUri("ether://[00:00:5e:00:53:5b]"),
+             localUri,
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, true},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 }
 
@@ -475,35 +481,35 @@
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:5e]"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Creation of unicast Ethernet faces requires a LocalUri with dev:// scheme"});
 
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:5e]"),
              FaceUri("udp4://127.0.0.1:20071"),
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Creation of unicast Ethernet faces requires a LocalUri with dev:// scheme"});
 
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:5e]"),
              FaceUri("dev://eth0"),
-             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Outgoing Ethernet faces do not support on-demand persistency"});
 
   createFace(factory,
              FaceUri("ether://[01:00:5e:90:10:5e]"),
              FaceUri("dev://eth0"),
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Cannot create multicast Ethernet faces"});
 
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:5e]"),
              FaceUri("dev://eth0"),
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, true, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, true, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Local fields can only be enabled on faces with local scope"});
 }
diff --git a/tests/daemon/face/factory-test-common.hpp b/tests/daemon/face/factory-test-common.hpp
index 6ea56bf..795bdf3 100644
--- a/tests/daemon/face/factory-test-common.hpp
+++ b/tests/daemon/face/factory-test-common.hpp
@@ -36,12 +36,19 @@
 
 struct TestFaceParams : public FaceParams
 {
-  TestFaceParams(ndn::nfd::FacePersistency persistency, bool wantLocalFields,
-                 bool wantLpReliability) noexcept
+  TestFaceParams(ndn::nfd::FacePersistency persistency,
+                 ndn::optional<time::nanoseconds> baseCongestionMarkingInterval,
+                 ndn::optional<uint64_t> defaultCongestionThreshold,
+                 bool wantLocalFields,
+                 bool wantLpReliability,
+                 boost::logic::tribool wantCongestionMarking) noexcept
   {
     this->persistency = persistency;
+    this->baseCongestionMarkingInterval = baseCongestionMarkingInterval;
+    this->defaultCongestionThreshold = defaultCongestionThreshold;
     this->wantLocalFields = wantLocalFields;
     this->wantLpReliability = wantLpReliability;
+    this->wantCongestionMarking = wantCongestionMarking;
   }
 };
 
diff --git a/tests/daemon/face/tcp-factory.t.cpp b/tests/daemon/face/tcp-factory.t.cpp
index 934229f..3785111 100644
--- a/tests/daemon/face/tcp-factory.t.cpp
+++ b/tests/daemon/face/tcp-factory.t.cpp
@@ -172,7 +172,7 @@
   createFace(factory,
              FaceUri("tcp4://127.0.0.1:6363"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 504, "No channels available to connect"});
 
   createChannel("127.0.0.1", "20071");
@@ -180,25 +180,31 @@
   createFace(factory,
              FaceUri("tcp4://127.0.0.1:6363"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("tcp4://127.0.0.1:6363"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("tcp4://127.0.0.1:20072"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("tcp4://127.0.0.1:20073"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, true},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, true, false},
+             {CreateFaceExpectedResult::SUCCESS, 0, ""});
+
+  createFace(factory,
+             FaceUri("tcp4://127.0.0.1:20073"),
+             {},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, true},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 }
 
@@ -209,21 +215,21 @@
   createFace(factory,
              FaceUri("tcp4://127.0.0.1:20072"),
              FaceUri("tcp4://127.0.0.1:20071"),
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Unicast TCP faces cannot be created with a LocalUri"});
 
   createFace(factory,
              FaceUri("tcp4://127.0.0.1:20072"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Outgoing TCP faces do not support on-demand persistency"});
 
   createFace(factory,
              FaceUri("tcp4://198.51.100.100:6363"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, true, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, true, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Local fields can only be enabled on faces with local scope"});
 }
diff --git a/tests/daemon/face/udp-factory.t.cpp b/tests/daemon/face/udp-factory.t.cpp
index 7303f5c..ee5a3f4 100644
--- a/tests/daemon/face/udp-factory.t.cpp
+++ b/tests/daemon/face/udp-factory.t.cpp
@@ -877,7 +877,7 @@
   createFace(factory,
              FaceUri("udp4://127.0.0.1:6363"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 504, "No channels available to connect"});
 
   createChannel("127.0.0.1", 20071);
@@ -885,25 +885,31 @@
   createFace(factory,
              FaceUri("udp4://127.0.0.1:6363"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("udp4://127.0.0.1:6363"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("udp4://127.0.0.1:20072"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 
   createFace(factory,
              FaceUri("udp4://127.0.0.1:20073"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, true},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, true, false},
+             {CreateFaceExpectedResult::SUCCESS, 0, ""});
+
+  createFace(factory,
+             FaceUri("udp4://127.0.0.1:20073"),
+             {},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, true},
              {CreateFaceExpectedResult::SUCCESS, 0, ""});
 }
 
@@ -914,28 +920,28 @@
   createFace(factory,
              FaceUri("udp4://127.0.0.1:20072"),
              FaceUri("udp4://127.0.0.1:20071"),
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Unicast UDP faces cannot be created with a LocalUri"});
 
   createFace(factory,
              FaceUri("udp4://127.0.0.1:20072"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Outgoing UDP faces do not support on-demand persistency"});
 
   createFace(factory,
              FaceUri("udp4://233.252.0.1:23252"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Cannot create multicast UDP faces"});
 
   createFace(factory,
              FaceUri("udp4://127.0.0.1:20072"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, true, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, true, false, false},
              {CreateFaceExpectedResult::FAILURE, 406,
               "Local fields can only be enabled on faces with local scope"});
 }
diff --git a/tests/daemon/face/unix-stream-factory.t.cpp b/tests/daemon/face/unix-stream-factory.t.cpp
index 79eefa6..b07e5bf 100644
--- a/tests/daemon/face/unix-stream-factory.t.cpp
+++ b/tests/daemon/face/unix-stream-factory.t.cpp
@@ -125,19 +125,19 @@
   createFace(factory,
              FaceUri("unix:///var/run/nfd.sock"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406, "Unsupported protocol"});
 
   createFace(factory,
              FaceUri("unix:///var/run/nfd.sock"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406, "Unsupported protocol"});
 
   createFace(factory,
              FaceUri("unix:///var/run/nfd.sock"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406, "Unsupported protocol"});
 }
 
diff --git a/tests/daemon/face/websocket-factory.t.cpp b/tests/daemon/face/websocket-factory.t.cpp
index bb8a378..9ba5d5d 100644
--- a/tests/daemon/face/websocket-factory.t.cpp
+++ b/tests/daemon/face/websocket-factory.t.cpp
@@ -196,19 +196,19 @@
   createFace(factory,
              FaceUri("ws://127.0.0.1:20070"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406, "Unsupported protocol"});
 
   createFace(factory,
              FaceUri("ws://127.0.0.1:20070"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERSISTENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406, "Unsupported protocol"});
 
   createFace(factory,
              FaceUri("ws://127.0.0.1:20070"),
              {},
-             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, false, false},
+             {ndn::nfd::FACE_PERSISTENCY_PERMANENT, {}, {}, false, false, false},
              {CreateFaceExpectedResult::FAILURE, 406, "Unsupported protocol"});
 }