]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/test-network/systemd-networkd-tests.py
test-network: add test for MTU field of 'networkctl status'
[thirdparty/systemd.git] / test / test-network / systemd-networkd-tests.py
index 0eb3492b7d7a68e94eeefac2e3864657c39a7efa..803b7122e841805c6771c635aaac67ac880b62dc 100755 (executable)
@@ -309,6 +309,7 @@ class NetworkctlTests(unittest.TestCase, Utilities):
 
     units = [
         '11-dummy.netdev',
+        '11-dummy-mtu.netdev',
         '11-dummy.network',
         '25-veth.netdev',
         'netdev-link-local-addressing-yes.network',
@@ -347,6 +348,15 @@ class NetworkctlTests(unittest.TestCase, Utilities):
         self.assertNotRegex(output, '1: lo ')
         self.assertRegex(output, 'test1')
 
+    def test_mtu(self):
+        self.copy_unit_to_networkd_unit_path('11-dummy-mtu.netdev', '11-dummy.network')
+        self.start_networkd(0)
+
+        self.wait_online(['test1:degraded'])
+
+        output = subprocess.check_output(networkctl_cmd + ['status', 'test1'], universal_newlines=True, env=env).rstrip()
+        self.assertRegex(output, 'MTU: 1600')
+
     @expectedFailureIfEthtoolDoesNotSupportDriver()
     def test_udev_driver(self):
         self.copy_unit_to_networkd_unit_path('11-dummy.netdev', '11-dummy.network',