@@ -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 (
@@ -2374,9 +2374,10 @@ def test_agent_with_nb_cfg_timestamp_not_timeout(self):
2374
2374
self .assertTrue (agent .alive , "Agent of type %s alive=%s" % (
2375
2375
agent .agent_type , agent .alive ))
2376
2376
2377
- def _test__update_dnat_entry_if_needed (self , up = True ):
2378
- ovn_conf .cfg .CONF .set_override (
2379
- 'enable_distributed_floating_ip' , True , group = 'ovn' )
2377
+ def _test__update_dnat_entry_if_needed (self , dvr = True ):
2378
+ if dvr :
2379
+ ovn_conf .cfg .CONF .set_override (
2380
+ 'enable_distributed_floating_ip' , True , group = 'ovn' )
2380
2381
port_id = 'fake-port-id'
2381
2382
fake_ext_mac_key = 'fake-ext-mac-key'
2382
2383
fake_nat_uuid = uuidutils .generate_uuid ()
@@ -2389,22 +2390,24 @@ def _test__update_dnat_entry_if_needed(self, up=True):
2389
2390
fake_db_find .execute .return_value = [nat_row ]
2390
2391
self .nb_ovn .db_find .return_value = fake_db_find
2391
2392
2392
- self .mech_driver ._update_dnat_entry_if_needed (port_id , up = up )
2393
+ self .mech_driver ._update_dnat_entry_if_needed (port_id )
2393
2394
2394
- if up :
2395
+ if dvr :
2395
2396
# Assert that we are setting the external_mac in the NAT table
2396
2397
self .nb_ovn .db_set .assert_called_once_with (
2397
2398
'NAT' , fake_nat_uuid , ('external_mac' , fake_ext_mac_key ))
2399
+ self .nb_ovn .db_clear .assert_not_called ()
2398
2400
else :
2401
+ self .nb_ovn .db_set .assert_not_called ()
2399
2402
# Assert that we are cleaning the external_mac from the NAT table
2400
2403
self .nb_ovn .db_clear .assert_called_once_with (
2401
2404
'NAT' , fake_nat_uuid , 'external_mac' )
2402
2405
2403
- def test__update_dnat_entry_if_needed_up (self ):
2406
+ def test__update_dnat_entry_if_needed_dvr (self ):
2404
2407
self ._test__update_dnat_entry_if_needed ()
2405
2408
2406
- def test__update_dnat_entry_if_needed_down (self ):
2407
- self ._test__update_dnat_entry_if_needed (up = False )
2409
+ def test__update_dnat_entry_if_needed_no_dvr (self ):
2410
+ self ._test__update_dnat_entry_if_needed (dvr = False )
2408
2411
2409
2412
@mock .patch ('neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.'
2410
2413
'ovn_client.OVNClient._get_router_ports' )
0 commit comments