Browse Source

Merge "functional: Remove TODOs related to ovsdbapp 0.17.0"

changes/37/683237/9
Zuul 1 month ago
parent
commit
4545651920

+ 1
- 13
networking_ovn/tests/functional/test_impl_idl.py View File

@@ -16,23 +16,11 @@ import uuid

from ovsdbapp import event as ovsdb_event
from ovsdbapp.tests.functional import base
from ovsdbapp.tests.functional.schema.ovn_southbound import event
from ovsdbapp.tests import utils

from networking_ovn.ovsdb import impl_idl_ovn as impl

# TODO(jlibosva): ovsdbapp has moved WaitForPortBindingEvent to its own module
# To keep backward compatiblity with ovsdbapp it first tries
# the new location and in case the module doesn't exist it uses
# the old location importing the whole test suite. Remove the
# fallback mechanism when we limit ovsdbapp version to the one
# containing event module.
try:
from ovsdbapp.tests.functional.schema.ovn_southbound import event
except ImportError:
from ovsdbapp.tests.functional.schema.ovn_southbound \
import test_impl_idl as event


class WaitForPortBindingEvent(event.WaitForPortBindingEvent):
def run(self, event, row, old):

+ 2
- 12
networking_ovn/tests/functional/test_metadata_agent.py View File

@@ -19,6 +19,7 @@ from oslo_config import fixture as fixture_config
from oslo_utils import uuidutils
from ovsdbapp.backend.ovs_idl import event
from ovsdbapp.backend.ovs_idl import idlutils
from ovsdbapp.tests.functional.schema.ovn_southbound import event as test_event

from networking_ovn.agent.metadata import agent
from networking_ovn.agent.metadata import ovsdb
@@ -47,17 +48,6 @@ class MetadataAgentHealthEvent(event.WaitEvent):
ovn_const.OVN_AGENT_METADATA_SB_CFG_KEY, 0)) >= self.sb_cfg


# TODO(jlibosva): Move this class to a common place in ovsdbapp. Once it's
# released we can just import the class from ovsdbapp
class WaitForPortBindingEvent(event.WaitEvent):
event_name = 'WaitForPortBindingEvent'

def __init__(self, port, timeout=5):
super(WaitForPortBindingEvent, self).__init__(
(self.ROW_CREATE,), 'Port_Binding', (('logical_port', '=', port),),
timeout=timeout)


class TestMetadataAgent(base.TestOVNFunctionalBase):
OVN_BRIDGE = 'br-int'
FAKE_CHASSIS_HOST = 'ovn-host-fake'
@@ -178,7 +168,7 @@ class TestMetadataAgent(base.TestOVNFunctionalBase):
# the OVN SB DB. Wait for port binding event to happen before binding
# the port to chassis.

pb_event = WaitForPortBindingEvent(lswitchport_name)
pb_event = test_event.WaitForPortBindingEvent(lswitchport_name)
self.handler.watch_event(pb_event)

with self.nb_api.transaction(check_error=True, log_errors=True) as txn:

Loading…
Cancel
Save