Wait until local OVS DB updates Bridge "datapath_id"

Closes-Bug: #2000163
Change-Id: I9c8ebbb334df89e8d5b3b80bbfba2e91d3d848f5
This commit is contained in:
Rodolfo Alonso Hernandez 2022-12-12 07:58:14 +01:00
parent 4deda7e92e
commit cbd03c7ea5
1 changed files with 5 additions and 1 deletions

View File

@ -217,11 +217,15 @@ class OVSBridgeTestCase(OVSBridgeTestBase):
self._test_set_igmp_snooping_state(False)
def test_get_datapath_id(self):
def _check_datapath_id():
return True if dpid in self.br.get_datapath_id() else False
brdev = ip_lib.IPDevice(self.br.br_name)
dpid = brdev.link.attributes['link/ether'].replace(':', '')
self.br.set_db_attribute('Bridge',
self.br.br_name, 'datapath_id', dpid)
self.assertIn(dpid, self.br.get_datapath_id())
# Wait until local OVS DB cache is updated.
utils.wait_until_true(_check_datapath_id, timeout=5)
def _test_add_tunnel_port(self, attrs,
expected_tunnel_type=const.TYPE_GRE):