#NEWLINE# def _define_expected_calls( self , arp_responder = False ) : #NEWLINE# #INDENT# self . mock_int_bridge_cls_expected = [ mock . call ( self . INT_BRIDGE , datapath_type = mock . ANY ) ] #NEWLINE# self . mock_phys_bridge_cls_expected = [ mock . call ( self . MAP_TUN_BRIDGE , datapath_type = mock . ANY ) ] #NEWLINE# self . mock_tun_bridge_cls_expected = [ mock . call ( self . TUN_BRIDGE , datapath_type = mock . ANY ) ] #NEWLINE# self . mock_int_bridge = self . ovs_bridges [ self . INT_BRIDGE ] #NEWLINE# self . mock_int_bridge_expected = [ mock . call . create ( ) , mock . call . set_secure_mode ( ) , mock . call . setup_controllers ( mock . ANY ) , mock . call . setup_default_table ( ) ] #NEWLINE# self . mock_map_tun_bridge_expected = [ mock . call . create ( ) , mock . call . setup_controllers ( mock . ANY ) , mock . call . setup_default_table ( ) , mock . call . get_port_ofport ( ( 'phy-%s' % self . MAP_TUN_BRIDGE ) ) , mock . call . add_patch_port ( ( 'phy-%s' % self . MAP_TUN_BRIDGE ) , constants . NONEXISTENT_PEER ) ] #NEWLINE# self . mock_int_bridge_expected += [ mock . call . db_get_val ( 'Interface' , ( 'int-%s' % self . MAP_TUN_BRIDGE ) , 'type' , log_errors = False ) , mock . call . get_port_ofport ( ( 'int-%s' % self . MAP_TUN_BRIDGE ) ) , mock . call . add_patch_port ( ( 'int-%s' % self . MAP_TUN_BRIDGE ) , constants . NONEXISTENT_PEER ) ] #NEWLINE# self . mock_int_bridge_expected += [ mock . call . drop_port ( in_port = self . MAP_TUN_INT_OFPORT ) , mock . call . set_db_attribute ( 'Interface' , ( 'int-%s' % self . MAP_TUN_BRIDGE ) , 'options' , { #NEWLINE# #INDENT# 'peer' : ( 'phy-%s' % self . MAP_TUN_BRIDGE ) , #NEWLINE# #UNINDENT# } ) ] #NEWLINE# self . mock_map_tun_bridge_expected += [ mock . call . drop_port ( in_port = self . MAP_TUN_PHY_OFPORT ) , mock . call . set_db_attribute ( 'Interface' , ( 'phy-%s' % self . MAP_TUN_BRIDGE ) , 'options' , { #NEWLINE# #INDENT# 'peer' : ( 'int-%s' % self . MAP_TUN_BRIDGE ) , #NEWLINE# #UNINDENT# } ) ] #NEWLINE# self . mock_aux_bridge = self . ovs_bridges [ arp_responder . AUX_BRIDGE ] #NEWLINE# self . mock_aux_bridge_expected = [ ] #NEWLINE# self . mock_tun_bridge_expected = [ mock . call . create ( secure_mode = True ) , mock . call . setup_controllers ( mock . ANY ) , mock . call . port_exists ( 'patch-int' ) , nonzero ( mock . call . port_exists ( ) ) , mock . call . add_patch_port ( 'patch-int' , 'patch-tun' ) ] #NEWLINE# self . mock_int_bridge_expected += [ mock . call . port_exists ( 'patch-tun' ) , nonzero ( mock . call . port_exists ( ) ) , mock . call . add_patch_port ( 'patch-tun' , 'patch-int' ) ] #NEWLINE# self . mock_int_bridge_expected += [ mock . call . get_vif_ports ( ) , mock . call . get_ports_attributes ( 'Port' , columns = [ 'name' , 'other_config' , 'tag' ] , ports = [ ] ) ] #NEWLINE# self . mock_tun_bridge_expected += [ mock . call . setup_default_table ( self . INT_OFPORT , arp_responder ) ] #NEWLINE# self . ipdevice_expected = [ ] #NEWLINE# self . ipwrapper_expected = [ mock . call ( ) ] #NEWLINE# self . get_bridges_expected = [ mock . call ( ) , mock . call ( ) ] #NEWLINE# self . inta_expected = [ ] #NEWLINE# self . intb_expected = [ ] #NEWLINE# self . execute_expected = [ ]