Browse Source

Change way of retrieving LSP in virtual_port functional tests

Sometimes we had a situation, where Logical_Switch_Port type
received by IDL had a different type, that type set in the
NBDB. We changed the way we retrieve the LS from DB, to not
loop over rows in table, but call db_find_rows() instead.
With this change after about 40 retries of functional tests we
don't spot the same issue again.

Change-Id: I07c081d1984b26a10a4d854d17117cfeaac7f8ac
Related-Bug: 1862618
tags/16.0.0.0rc1
Maciej Józefczyk 9 months ago
parent
commit
08132e213d
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py

+ 4
- 3
neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py View File

@@ -232,9 +232,10 @@ class TestVirtualPorts(base.TestOVNFunctionalBase):
return self._update_allowed_address_pair(port_id, [])

def _find_port_row(self, port_id):
for row in self.nb_api._tables['Logical_Switch_Port'].rows.values():
if row.name == port_id:
return row
cmd = self.nb_api.db_find_rows(
'Logical_Switch_Port', ('name', '=', port_id))
rows = cmd.execute(check_error=True)
return rows[0] if rows else None

def _is_ovn_port_type(self, port_id, port_type):
ovn_vport = self._find_port_row(port_id)


Loading…
Cancel
Save