@@ -1106,7 +1106,7 @@ def _test_set_port_status_down(self, is_compute_port=False):
1106
1106
resources .PORT ,
1107
1107
provisioning_blocks .L2_AGENT_ENTITY
1108
1108
)
1109
- ude .assert_called_once_with (port1 ['port' ]['id' ], False )
1109
+ ude .assert_called_once_with (port1 ['port' ]['id' ])
1110
1110
1111
1111
# If the port does NOT bellong to compute, do not notify Nova
1112
1112
# about it's status changes
@@ -1156,7 +1156,7 @@ def test_set_port_status_concurrent_delete(self):
1156
1156
resources .PORT ,
1157
1157
provisioning_blocks .L2_AGENT_ENTITY
1158
1158
)
1159
- ude .assert_called_once_with (port1 ['port' ]['id' ], False )
1159
+ ude .assert_called_once_with (port1 ['port' ]['id' ])
1160
1160
1161
1161
def test_bind_port_unsupported_vnic_type (self ):
1162
1162
fake_port = fakes .FakePort .create_one_port (
@@ -2350,9 +2350,10 @@ def test_agent_with_nb_cfg_timestamp_not_timeout(self):
2350
2350
self .assertTrue (agent .alive , "Agent of type %s alive=%s" % (
2351
2351
agent .agent_type , agent .alive ))
2352
2352
2353
- def _test__update_dnat_entry_if_needed (self , up = True ):
2354
- ovn_conf .cfg .CONF .set_override (
2355
- 'enable_distributed_floating_ip' , True , group = 'ovn' )
2353
+ def _test__update_dnat_entry_if_needed (self , dvr = True ):
2354
+ if dvr :
2355
+ ovn_conf .cfg .CONF .set_override (
2356
+ 'enable_distributed_floating_ip' , True , group = 'ovn' )
2356
2357
port_id = 'fake-port-id'
2357
2358
fake_ext_mac_key = 'fake-ext-mac-key'
2358
2359
fake_nat_uuid = uuidutils .generate_uuid ()
@@ -2365,22 +2366,24 @@ def _test__update_dnat_entry_if_needed(self, up=True):
2365
2366
fake_db_find .execute .return_value = [nat_row ]
2366
2367
self .nb_ovn .db_find .return_value = fake_db_find
2367
2368
2368
- self .mech_driver ._update_dnat_entry_if_needed (port_id , up = up )
2369
+ self .mech_driver ._update_dnat_entry_if_needed (port_id )
2369
2370
2370
- if up :
2371
+ if dvr :
2371
2372
# Assert that we are setting the external_mac in the NAT table
2372
2373
self .nb_ovn .db_set .assert_called_once_with (
2373
2374
'NAT' , fake_nat_uuid , ('external_mac' , fake_ext_mac_key ))
2375
+ self .nb_ovn .db_clear .assert_not_called ()
2374
2376
else :
2377
+ self .nb_ovn .db_set .assert_not_called ()
2375
2378
# Assert that we are cleaning the external_mac from the NAT table
2376
2379
self .nb_ovn .db_clear .assert_called_once_with (
2377
2380
'NAT' , fake_nat_uuid , 'external_mac' )
2378
2381
2379
- def test__update_dnat_entry_if_needed_up (self ):
2382
+ def test__update_dnat_entry_if_needed_dvr (self ):
2380
2383
self ._test__update_dnat_entry_if_needed ()
2381
2384
2382
- def test__update_dnat_entry_if_needed_down (self ):
2383
- self ._test__update_dnat_entry_if_needed (up = False )
2385
+ def test__update_dnat_entry_if_needed_no_dvr (self ):
2386
+ self ._test__update_dnat_entry_if_needed (dvr = False )
2384
2387
2385
2388
@mock .patch ('neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.'
2386
2389
'ovn_client.OVNClient._get_router_ports' )
0 commit comments