Browse Source

Merge "functional: Remove TODOs related to ovsdbapp 0.17.0"

Zuul Gerrit Code Review 7 months ago
2 changed files with 3 additions and 25 deletions
  1. +1
  2. +2

+ 1
- 13
networking_ovn/tests/functional/ 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.
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/ 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),),

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)

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