face: support runtime MTU changes on Ethernet faces

refs #3257

Change-Id: I160fe444b889b8f7be19022a2bd52bbc9f7a21aa
diff --git a/tests/daemon/face/unicast-ethernet-transport.t.cpp b/tests/daemon/face/unicast-ethernet-transport.t.cpp
index 355a3ea..634a119 100644
--- a/tests/daemon/face/unicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/unicast-ethernet-transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -58,6 +58,25 @@
   BOOST_CHECK_EQUAL(transport->canChangePersistencyTo(ndn::nfd::FACE_PERSISTENCY_PERMANENT), true);
 }
 
+BOOST_AUTO_TEST_CASE(NetifMtuChange)
+{
+  SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
+  initializeUnicast();
+  BOOST_CHECK_EQUAL(transport->getMtu(), netif->getMtu());
+
+  // netif changes MTU from initial value to 1024
+  netif->setMtu(1024);
+  BOOST_CHECK_EQUAL(transport->getMtu(), 1024);
+
+  // netif changes MTU from 1024 to 4000
+  netif->setMtu(4000);
+  BOOST_CHECK_EQUAL(transport->getMtu(), 4000);
+
+  // netif changes MTU from 4000 to 0
+  netif->setMtu(0);
+  BOOST_CHECK_EQUAL(transport->getMtu(), 0);
+}
+
 BOOST_AUTO_TEST_CASE(ExpirationTime)
 {
   SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);