File tree Expand file tree Collapse file tree
tests/unit/plugins/filter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -519,6 +519,8 @@ def get_iface(name):
519519 # <network>_port_type_<portname>.
520520 for port in br_ports or []:
521521 port_iface = get_iface (port )
522+ if mtu :
523+ port_iface .setdefault ("mtu" , mtu )
522524 if "type" not in port_iface :
523525 # Check for explicit type configuration
524526 port_type = networks .net_attr (
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ class TestNMStateFilter(unittest.TestCase):
4444 "net3_interface" : "br0" ,
4545 "net3_bridge_ports" : ['eth1' ],
4646 "net3_bridge_stp" : True ,
47+ "net3_mtu" : 9000 ,
4748 # net4: bond on bond0 with slaves eth2 and eth3.
4849 "net4_interface" : "bond0" ,
4950 "net4_bond_slaves" : ['eth2' , 'eth3' ],
@@ -123,13 +124,15 @@ def test_nmstate_config_bridge(self):
123124 result = nmstate .nmstate_config (self .context , ["net3" ])
124125 br_iface = next (i for i in result ["interfaces" ] if i ["name" ] == "br0" )
125126 self .assertEqual (br_iface ["type" ], "linux-bridge" )
127+ self .assertEqual (br_iface ["mtu" ], 9000 )
126128 self .assertEqual (br_iface ["bridge" ]["port" ], [{"name" : "eth1" }])
127129 self .assertTrue (br_iface ["bridge" ]["options" ]["stp" ]["enabled" ])
128130
129131 # eth1 should be present as ethernet
130132 eth1_iface = next (i for i in result ["interfaces" ]
131133 if i ["name" ] == "eth1" )
132134 self .assertEqual (eth1_iface ["type" ], "ethernet" )
135+ self .assertEqual (eth1_iface ["mtu" ], 9000 )
133136
134137 def test_nmstate_config_bond (self ):
135138 result = nmstate .nmstate_config (self .context , ["net4" ])
You can’t perform that action at this time.
0 commit comments