#NEWLINE# def test__notify_l3_agent_update_port_with_allowed_address_pairs( self ) : #NEWLINE# #INDENT# port_id = str ( uuid . uuid4 ( ) ) #NEWLINE# kwargs = { #NEWLINE# #INDENT# 'context' : self . adminContext , #NEWLINE# 'port' : { #NEWLINE# #INDENT# 'id' : port_id , #NEWLINE# portbindings . HOST_ID : 'vm-host' , #NEWLINE# 'allowed_address_pairs' : [ { #NEWLINE# #INDENT# 'ip_address' : '10.1.0.201' , #NEWLINE# 'mac_address' : 'aa:bb:cc:dd:ee:ff' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'device_id' : 'vm-id' , #NEWLINE# 'device_owner' : DEVICE_OWNER_COMPUTE , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# 'original_port' : { #NEWLINE# #INDENT# 'id' : port , #NEWLINE# portbindings . HOST_ID : 'vm-host' , #NEWLINE# 'device_id' : 'vm-id' , #NEWLINE# 'device_owner' : DEVICE_OWNER_COMPUTE , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# port = kwargs . get ( 'port' ) #NEWLINE# port_addr_pairs = port [ 'allowed_address_pairs' ] #NEWLINE# l3plugin = mock . Mock ( ) #NEWLINE# with mock . patch . object ( manager . NeutronManager , 'get_service_plugins' , return_value = { #NEWLINE# #INDENT# 'L3_ROUTER_NAT' : l3plugin , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# l3_dvrscheduler_db . _notify_l3_agent_port_update ( 'port' , 'after_update' , mock . ANY , ** kwargs ) #NEWLINE# self . assertTrue ( l3plugin . update_unbound_allowed_address_pair_port_binding . called ) #NEWLINE# l3plugin . update_unbound_allowed_address_pair_port_binding . assert_called_once_with ( self . adminContext , port , port_addr_pairs [ 0 ] ) #NEWLINE# self . assertTrue ( l3plugin . update_arp_entry_for_dvr_service_port . called ) #NEWLINE# self . assertTrue ( l3plugin . dvr_handle_new_service_port . called )