@@ -1112,7 +1112,7 @@ def _test_set_port_status_down(self, is_compute_port=False):
11121112 resources .PORT ,
11131113 provisioning_blocks .L2_AGENT_ENTITY
11141114 )
1115- ude .assert_called_once_with (port1 ['port' ]['id' ])
1115+ ude .assert_called_once_with (port1 ['port' ]['id' ], False )
11161116
11171117 # If the port does NOT bellong to compute, do not notify Nova
11181118 # about it's status changes
@@ -1157,7 +1157,7 @@ def test_set_port_status_concurrent_delete(self):
11571157 side_effect = exc ) as apc , \
11581158 mock .patch .object (self .mech_driver ,
11591159 '_update_dnat_entry_if_needed' ) as ude :
1160- self .mech_driver .set_port_status_down (port1 ['port' ]['id' ])
1160+ self .mech_driver .set_port_status_down (port1 ['port' ]['id' ], False )
11611161 apc .assert_called_once_with (
11621162 mock .ANY ,
11631163 port1 ['port' ]['id' ],
@@ -2358,40 +2358,32 @@ def test_agent_with_nb_cfg_timestamp_not_timeout(self):
23582358 self .assertTrue (agent .alive , "Agent of type %s alive=%s" % (
23592359 agent .agent_type , agent .alive ))
23602360
2361- def _test__update_dnat_entry_if_needed (self , dvr = True ):
2362- if dvr :
2363- ovn_conf .cfg .CONF .set_override (
2364- 'enable_distributed_floating_ip' , True , group = 'ovn' )
2361+ def _test__update_dnat_entry_if_needed (self , up = True ):
2362+ ovn_conf .cfg .CONF .set_override (
2363+ 'enable_distributed_floating_ip' , True , group = 'ovn' )
23652364 port_id = 'fake-port-id'
23662365 fake_ext_mac_key = 'fake-ext-mac-key'
23672366 fake_nat_uuid = uuidutils .generate_uuid ()
23682367 nat_row = fakes .FakeOvsdbRow .create_one_ovsdb_row (
23692368 attrs = {'_uuid' : fake_nat_uuid , 'external_ids' : {
23702369 ovn_const .OVN_FIP_EXT_MAC_KEY : fake_ext_mac_key },
23712370 'external_mac' : 'aa:aa:aa:aa:aa:aa' })
2372-
23732371 fake_db_find = mock .Mock ()
23742372 fake_db_find .execute .return_value = [nat_row ]
23752373 self .nb_ovn .db_find .return_value = fake_db_find
2376-
2377- self .mech_driver ._update_dnat_entry_if_needed (port_id )
2378-
2379- if dvr :
2374+ self .mech_driver ._update_dnat_entry_if_needed (port_id , up = up )
2375+ if up :
23802376 # Assert that we are setting the external_mac in the NAT table
23812377 self .nb_ovn .db_set .assert_called_once_with (
23822378 'NAT' , fake_nat_uuid , ('external_mac' , fake_ext_mac_key ))
2383- self .nb_ovn .db_clear .assert_not_called ()
23842379 else :
2385- self .nb_ovn .db_set .assert_not_called ()
23862380 # Assert that we are cleaning the external_mac from the NAT table
23872381 self .nb_ovn .db_clear .assert_called_once_with (
23882382 'NAT' , fake_nat_uuid , 'external_mac' )
2389-
2390- def test__update_dnat_entry_if_needed_dvr (self ):
2383+ def test__update_dnat_entry_if_needed_up (self ):
23912384 self ._test__update_dnat_entry_if_needed ()
2392-
2393- def test__update_dnat_entry_if_needed_no_dvr (self ):
2394- self ._test__update_dnat_entry_if_needed (dvr = False )
2385+ def test__update_dnat_entry_if_needed_down (self ):
2386+ self ._test__update_dnat_entry_if_needed (up = False )
23952387
23962388 @mock .patch ('neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.'
23972389 'ovn_client.OVNClient._get_router_ports' )
0 commit comments