face: support runtime MTU changes on Ethernet faces
refs #3257
Change-Id: I160fe444b889b8f7be19022a2bd52bbc9f7a21aa
diff --git a/tests/daemon/face/multicast-ethernet-transport.t.cpp b/tests/daemon/face/multicast-ethernet-transport.t.cpp
index 8dde05f..4e0df3c 100644
--- a/tests/daemon/face/multicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/multicast-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,
@@ -89,6 +89,25 @@
BOOST_CHECK_EQUAL(transport->getState(), TransportState::UP);
}
+BOOST_AUTO_TEST_CASE(NetifMtuChange)
+{
+ SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
+ initializeMulticast();
+ 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(Close)
{
SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);