@@ -1124,7 +1124,7 @@ def _test_set_port_status_down(self, is_compute_port=False):
1124
1124
resources .PORT ,
1125
1125
provisioning_blocks .L2_AGENT_ENTITY
1126
1126
)
1127
- ude .assert_called_once_with (port1 ['port' ]['id' ], False )
1127
+ ude .assert_called_once_with (port1 ['port' ]['id' ])
1128
1128
1129
1129
# If the port does NOT bellong to compute, do not notify Nova
1130
1130
# about it's status changes
@@ -1174,7 +1174,7 @@ def test_set_port_status_concurrent_delete(self):
1174
1174
resources .PORT ,
1175
1175
provisioning_blocks .L2_AGENT_ENTITY
1176
1176
)
1177
- ude .assert_called_once_with (port1 ['port' ]['id' ], False )
1177
+ ude .assert_called_once_with (port1 ['port' ]['id' ])
1178
1178
1179
1179
def test_bind_port_unsupported_vnic_type (self ):
1180
1180
fake_port = fakes .FakePort .create_one_port (
@@ -2368,9 +2368,10 @@ def test_agent_with_nb_cfg_timestamp_not_timeout(self):
2368
2368
self .assertTrue (agent .alive , "Agent of type %s alive=%s" % (
2369
2369
agent .agent_type , agent .alive ))
2370
2370
2371
- def _test__update_dnat_entry_if_needed (self , up = True ):
2372
- ovn_conf .cfg .CONF .set_override (
2373
- 'enable_distributed_floating_ip' , True , group = 'ovn' )
2371
+ def _test__update_dnat_entry_if_needed (self , dvr = True ):
2372
+ if dvr :
2373
+ ovn_conf .cfg .CONF .set_override (
2374
+ 'enable_distributed_floating_ip' , True , group = 'ovn' )
2374
2375
port_id = 'fake-port-id'
2375
2376
fake_ext_mac_key = 'fake-ext-mac-key'
2376
2377
fake_nat_uuid = uuidutils .generate_uuid ()
@@ -2383,22 +2384,24 @@ def _test__update_dnat_entry_if_needed(self, up=True):
2383
2384
fake_db_find .execute .return_value = [nat_row ]
2384
2385
self .nb_ovn .db_find .return_value = fake_db_find
2385
2386
2386
- self .mech_driver ._update_dnat_entry_if_needed (port_id , up = up )
2387
+ self .mech_driver ._update_dnat_entry_if_needed (port_id )
2387
2388
2388
- if up :
2389
+ if dvr :
2389
2390
# Assert that we are setting the external_mac in the NAT table
2390
2391
self .nb_ovn .db_set .assert_called_once_with (
2391
2392
'NAT' , fake_nat_uuid , ('external_mac' , fake_ext_mac_key ))
2393
+ self .nb_ovn .db_clear .assert_not_called ()
2392
2394
else :
2395
+ self .nb_ovn .db_set .assert_not_called ()
2393
2396
# Assert that we are cleaning the external_mac from the NAT table
2394
2397
self .nb_ovn .db_clear .assert_called_once_with (
2395
2398
'NAT' , fake_nat_uuid , 'external_mac' )
2396
2399
2397
- def test__update_dnat_entry_if_needed_up (self ):
2400
+ def test__update_dnat_entry_if_needed_dvr (self ):
2398
2401
self ._test__update_dnat_entry_if_needed ()
2399
2402
2400
- def test__update_dnat_entry_if_needed_down (self ):
2401
- self ._test__update_dnat_entry_if_needed (up = False )
2403
+ def test__update_dnat_entry_if_needed_no_dvr (self ):
2404
+ self ._test__update_dnat_entry_if_needed (dvr = False )
2402
2405
2403
2406
@mock .patch ('neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.'
2404
2407
'ovn_client.OVNClient._get_router_ports' )
0 commit comments