@@ -790,6 +790,40 @@ def test_external_port_update_switchdev_vnic_direct_physical(self):
790
790
def test_external_port_update_switchdev_vnic_macvtap (self ):
791
791
self ._test_external_port_update_switchdev (portbindings .VNIC_MACVTAP )
792
792
793
+ def test_external_port_network_update (self ):
794
+ net_id = self .n1 ['network' ]['id' ]
795
+ port_data = {
796
+ 'port' : {'network_id' : net_id ,
797
+ 'tenant_id' : self ._tenant_id ,
798
+ portbindings .VNIC_TYPE : 'direct' }}
799
+
800
+ # Create external port
801
+ port_req = self .new_create_request ('ports' , port_data , self .fmt )
802
+ port_res = port_req .get_response (self .api )
803
+ port = self .deserialize (self .fmt , port_res )['port' ]
804
+ ovn_port = self ._find_port_row_by_name (port ['id' ])
805
+ self .assertEqual (ovn_const .LSP_TYPE_EXTERNAL , ovn_port .type )
806
+ # Update MTU of network with external port
807
+ mtu_value = self .n1 ['network' ]['mtu' ] - 100
808
+ dhcp_options = (
809
+ self .mech_driver ._ovn_client ._nb_idl .get_subnet_dhcp_options (
810
+ self .sub ['subnet' ]['id' ])
811
+ )
812
+ self .assertNotEqual (
813
+ int (dhcp_options ['subnet' ]['options' ]['mtu' ]),
814
+ mtu_value )
815
+ data = {'network' : {'mtu' : mtu_value }}
816
+ req = self .new_update_request (
817
+ 'networks' , data , self .n1 ['network' ]['id' ], self .fmt )
818
+ req .get_response (self .api )
819
+ dhcp_options = (
820
+ self .mech_driver ._ovn_client ._nb_idl .get_subnet_dhcp_options (
821
+ self .sub ['subnet' ]['id' ])
822
+ )
823
+ self .assertEqual (
824
+ int (dhcp_options ['subnet' ]['options' ]['mtu' ]),
825
+ mtu_value )
826
+
793
827
794
828
class TestSecurityGroup (base .TestOVNFunctionalBase ):
795
829
0 commit comments