Skip to content

Commit dcd0d3e

Browse files
committed
[FT] Match the correct event in test_subport_delete
When testing the deletion of a Trunk subport, the event to be waiting for is the SB Port_Binding deletion. Closes-Bug: #2111908 Change-Id: I777491c4a80c7a84c521206a4c15b7046d4bb89c (cherry picked from commit 8dea545)
1 parent fd57d6a commit dcd0d3e

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

neutron/tests/functional/services/trunk/drivers/ovn/test_trunk_driver.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
from neutron.tests.functional import base
2727

2828

29-
class WaitForLogicalSwitchPortUpdateEvent(event.WaitEvent):
30-
event_name = 'WaitForDataPathBindingCreateEvent'
29+
class WaitForPortBindingDeleteEvent(event.WaitEvent):
30+
event_name = 'WaitForPortBindingDeleteEvent'
3131

32-
def __init__(self):
33-
table = 'Logical_Switch_Port'
34-
events = (self.ROW_UPDATE,)
35-
super().__init__(events, table, None, timeout=15)
32+
def __init__(self, port_id):
33+
table = 'Port_Binding'
34+
events = (self.ROW_DELETE, )
35+
conditions = (('logical_port', '=', port_id), )
36+
super().__init__(events, table, conditions, timeout=10)
3637

3738

3839
class TestOVNTrunkDriver(base.TestOVNFunctionalBase):
@@ -127,14 +128,14 @@ def test_subport_add(self):
127128
def test_subport_delete(self):
128129
with self.subport() as subport:
129130
with self.trunk([subport]) as trunk:
130-
lsp_event = WaitForLogicalSwitchPortUpdateEvent()
131-
self.mech_driver.nb_ovn.idl.notify_handler.watch_events(
132-
(lsp_event,))
131+
pb_event = WaitForPortBindingDeleteEvent(subport['port_id'])
132+
self.mech_driver.sb_ovn.idl.notify_handler.watch_event(
133+
pb_event)
133134
self.trunk_plugin.remove_subports(self.context, trunk['id'],
134135
{'sub_ports': [subport]})
135136
new_trunk = self.trunk_plugin.get_trunk(self.context,
136137
trunk['id'])
137-
self.assertTrue(lsp_event.wait())
138+
self.assertTrue(pb_event.wait())
138139
self._verify_trunk_info(new_trunk, has_items=False)
139140

140141
def test_trunk_delete(self):

0 commit comments

Comments
 (0)