Merge "[functional tests] compatibility with ovsdbapp>=2.7.0"

This commit is contained in:
Zuul 2024-05-21 18:22:45 +00:00 committed by Gerrit Code Review
commit 1bb01f0095
2 changed files with 12 additions and 3 deletions

View File

@ -28,6 +28,7 @@ from oslo_config import cfg
from oslo_log import log
from oslo_utils import timeutils
from oslo_utils import uuidutils
from ovsdbapp.backend.ovs_idl import idlutils
from neutron.agent.linux import utils
from neutron.api import extensions as exts
@ -443,5 +444,12 @@ class TestOVNFunctionalBase(test_plugin.Ml2PluginV2TestCase,
def del_fake_chassis(self, chassis, if_exists=True):
self.sb_api.chassis_del(
chassis, if_exists=if_exists).execute(check_error=True)
self.sb_api.db_destroy(
'Chassis_Private', chassis).execute(check_error=True)
try:
self.sb_api.db_destroy(
'Chassis_Private', chassis).execute(check_error=True)
except idlutils.RowNotFound:
# NOTE(ykarel ): ovsdbapp >= 2.7.0 handles Chassis_Private
# record delete with chassis
# try/except can be dropped when neutron requirements.txt
# include ovsdbapp>=2.7.0
pass

View File

@ -1234,7 +1234,8 @@ class TestAgentApi(base.TestOVNFunctionalBase):
# then Chassis_Private.chassis = []; both metadata and controller
# agents will still be present in the agent list.
agent_event = AgentWaitEvent(self.mech_driver, [self.chassis],
events=(event.RowEvent.ROW_UPDATE,))
events=(event.RowEvent.ROW_UPDATE,
event.RowEvent.ROW_DELETE,))
self.sb_api.idl.notify_handler.watch_event(agent_event)
self.sb_api.chassis_del(self.chassis).execute(check_error=True)
self.assertTrue(agent_event.wait())