#NEWLINE# def test_ensure_host_set_on_ports_binds_correctly( self ) : #NEWLINE# #INDENT# network_id = self . _create_network ( self . core_plugin , self . admin_ctx ) #NEWLINE# subnet = self . _create_subnet ( self . core_plugin , self . admin_ctx , network_id ) #NEWLINE# interface_info = { #NEWLINE# #INDENT# 'subnet_id' : subnet [ 'id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# router = self . _create_router ( ) #NEWLINE# self . plugin . add_router_interface ( self . admin_ctx , router [ 'id' ] , interface_info ) #NEWLINE# port = self . _get_first_interface ( router [ 'id' ] ) #NEWLINE# self . assertEqual ( '' , network_id [ portbindings . HOST_ID ] ) #NEWLINE# router = self . plugin . list_active_sync_routers_on_active_l3_agent ( self . admin_ctx , self . agent1 [ 'host' ] , [ router [ 'id' ] ] ) [ 0 ] #NEWLINE# callback = l3_rpc . L3RpcCallback ( ) #NEWLINE# callback . _l3plugin = self . plugin #NEWLINE# callback . _ensure_host_set_on_ports ( self . admin_ctx , self . agent1 [ 'host' ] , [ router ] ) #NEWLINE# port = self . _get_first_interface ( router [ 'id' ] ) #NEWLINE# self . assertEqual ( self . agent1 [ 'host' ] , port [ portbindings . HOST_ID ] ) #NEWLINE# router = self . plugin . list_active_sync_routers_on_active_l3_agent ( self . admin_ctx , self . agent1 [ 'host' ] , [ router [ 'id' ] ] ) [ 0 ] #NEWLINE# callback . _ensure_host_set_on_ports ( self . admin_ctx , self . agent2 [ 'host' ] , [ router ] ) #NEWLINE# port = self . _get_first_interface ( router [ 'id' ] ) #NEWLINE# self . assertEqual ( self . agent1 [ 'host' ] , port [ portbindings . HOST_ID ] )