Replace ryu with os_ken

Implements: blueprint ryu-framework-maintenace-transition
Change-Id: Ic721efc7cd0066be0ea7b6239b273e656643e9c1
This commit is contained in:
Hongbin Lu 2018-10-01 17:47:49 +00:00 committed by Lajos Katona
parent 462b510c50
commit 7a2b4dcff1
24 changed files with 149 additions and 146 deletions

View File

@ -77,7 +77,7 @@
jobs: jobs:
- neutron-functional - neutron-functional
- neutron-tempest-postgres-full - neutron-tempest-postgres-full
- neutron-tempest-with-ryu-master - neutron-tempest-with-os-ken-master
experimental: experimental:
jobs: jobs:
- neutron-functional-python35 - neutron-functional-python35
@ -276,10 +276,10 @@
- openstack/tempest - openstack/tempest
- job: - job:
name: neutron-tempest-with-ryu-master name: neutron-tempest-with-os-ken-master
parent: legacy-dsvm-base parent: legacy-dsvm-base
run: playbooks/legacy/neutron-tempest-with-ryu-master/run.yaml run: playbooks/legacy/neutron-tempest-with-os-ken-master/run.yaml
post-run: playbooks/legacy/neutron-tempest-with-ryu-master/post.yaml post-run: playbooks/legacy/neutron-tempest-with-os-ken-master/post.yaml
timeout: 7800 timeout: 7800
required-projects: required-projects:
- openstack-infra/devstack-gate - openstack-infra/devstack-gate

View File

@ -60,6 +60,7 @@ neutron-lib==1.21.0
openstackdocstheme==1.18.1 openstackdocstheme==1.18.1
openstacksdk==0.11.2 openstacksdk==0.11.2
os-client-config==1.28.0 os-client-config==1.28.0
os-ken==0.3.0
os-service-types==1.2.0 os-service-types==1.2.0
os-xenapi==0.3.1 os-xenapi==0.3.1
osc-lib==1.8.0 osc-lib==1.8.0
@ -123,7 +124,6 @@ requests==2.14.2
requestsexceptions==1.2.0 requestsexceptions==1.2.0
rfc3986==0.3.1 rfc3986==0.3.1
Routes==2.3.1 Routes==2.3.1
ryu==4.24
simplejson==3.5.1 simplejson==3.5.1
six==1.10.0 six==1.10.0
smmap==0.9.0 smmap==0.9.0

View File

@ -41,8 +41,8 @@ LOG = logging.getLogger(__name__)
EXTRA_LOG_LEVEL_DEFAULTS = [ EXTRA_LOG_LEVEL_DEFAULTS = [
'OFPHandler=INFO', 'OFPHandler=INFO',
'OfctlService=INFO', 'OfctlService=INFO',
'ryu.base.app_manager=INFO', 'os_ken.base.app_manager=INFO',
'ryu.controller.controller=INFO', 'os_ken.controller.controller=INFO',
'ovsdbapp.backend.ovs_idl.vlog=INFO' 'ovsdbapp.backend.ovs_idl.vlog=INFO'
] ]

View File

@ -14,9 +14,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from ryu.lib.packet import ether_types from os_ken.lib.packet import ether_types
from ryu.lib.packet import icmpv6 from os_ken.lib.packet import icmpv6
from ryu.lib.packet import in_proto from os_ken.lib.packet import in_proto
class OVSDVRProcessMixin(object): class OVSDVRProcessMixin(object):

View File

@ -22,10 +22,10 @@
import netaddr import netaddr
from neutron_lib import constants as p_const from neutron_lib import constants as p_const
from os_ken.lib.packet import ether_types
from os_ken.lib.packet import icmpv6
from os_ken.lib.packet import in_proto
from oslo_log import log as logging from oslo_log import log as logging
from ryu.lib.packet import ether_types
from ryu.lib.packet import icmpv6
from ryu.lib.packet import in_proto
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \ from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \
@ -176,7 +176,7 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
# Allow neighbor advertisements as long as they match addresses # Allow neighbor advertisements as long as they match addresses
# that actually belong to the port. # that actually belong to the port.
for ip in ip_addresses: for ip in ip_addresses:
masked_ip = self._cidr_to_ryu(ip) masked_ip = self._cidr_to_os_ken(ip)
self.install_goto( self.install_goto(
table_id=constants.ARP_SPOOF_TABLE, priority=2, table_id=constants.ARP_SPOOF_TABLE, priority=2,
eth_type=ether_types.ETH_TYPE_IPV6, eth_type=ether_types.ETH_TYPE_IPV6,
@ -229,7 +229,7 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
# allow ARP replies as long as they match addresses that actually # allow ARP replies as long as they match addresses that actually
# belong to the port. # belong to the port.
for ip in ip_addresses: for ip in ip_addresses:
masked_ip = self._cidr_to_ryu(ip) masked_ip = self._cidr_to_os_ken(ip)
self.install_goto(table_id=constants.ARP_SPOOF_TABLE, self.install_goto(table_id=constants.ARP_SPOOF_TABLE,
priority=2, priority=2,
eth_type=ether_types.ETH_TYPE_ARP, eth_type=ether_types.ETH_TYPE_ARP,

View File

@ -29,8 +29,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from ryu.lib.packet import arp from os_ken.lib.packet import arp
from ryu.lib.packet import ether_types from os_ken.lib.packet import ether_types
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \ from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \

View File

@ -14,9 +14,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from os_ken.base import app_manager
from os_ken import cfg as os_ken_cfg
from oslo_config import cfg from oslo_config import cfg
from ryu.base import app_manager
from ryu import cfg as ryu_cfg
cfg.CONF.import_group( cfg.CONF.import_group(
@ -25,13 +25,13 @@ cfg.CONF.import_group(
def init_config(): def init_config():
ryu_cfg.CONF(project='ryu', args=[]) os_ken_cfg.CONF(project='os_ken', args=[])
ryu_cfg.CONF.ofp_listen_host = cfg.CONF.OVS.of_listen_address os_ken_cfg.CONF.ofp_listen_host = cfg.CONF.OVS.of_listen_address
ryu_cfg.CONF.ofp_tcp_listen_port = cfg.CONF.OVS.of_listen_port os_ken_cfg.CONF.ofp_tcp_listen_port = cfg.CONF.OVS.of_listen_port
def main(): def main():
app_manager.AppManager.run_apps([ app_manager.AppManager.run_apps([
'neutron.plugins.ml2.drivers.openvswitch.agent.' 'neutron.plugins.ml2.drivers.openvswitch.agent.'
'openflow.native.ovs_ryuapp', 'openflow.native.ovs_oskenapp',
]) ])

View File

@ -20,14 +20,14 @@ import random
import eventlet import eventlet
import netaddr import netaddr
from neutron_lib import exceptions from neutron_lib import exceptions
import os_ken.app.ofctl.api as ofctl_api
import os_ken.exception as os_ken_exc
from os_ken.lib import ofctl_string
from os_ken.ofproto import ofproto_parser
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import excutils from oslo_utils import excutils
from oslo_utils import timeutils from oslo_utils import timeutils
import ryu.app.ofctl.api as ofctl_api
import ryu.exception as ryu_exc
from ryu.lib import ofctl_string
from ryu.ofproto import ofproto_parser
import six import six
from neutron._i18n import _ from neutron._i18n import _
@ -51,19 +51,19 @@ class OpenFlowSwitchMixin(object):
""" """
@staticmethod @staticmethod
def _cidr_to_ryu(ip): def _cidr_to_os_ken(ip):
n = netaddr.IPNetwork(ip) n = netaddr.IPNetwork(ip)
if n.hostmask: if n.hostmask:
return (str(n.ip), str(n.netmask)) return (str(n.ip), str(n.netmask))
return str(n.ip) return str(n.ip)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self._app = kwargs.pop('ryu_app') self._app = kwargs.pop('os_ken_app')
self.active_bundles = set() self.active_bundles = set()
super(OpenFlowSwitchMixin, self).__init__(*args, **kwargs) super(OpenFlowSwitchMixin, self).__init__(*args, **kwargs)
def _get_dp_by_dpid(self, dpid_int): def _get_dp_by_dpid(self, dpid_int):
"""Get Ryu datapath object for the switch.""" """Get os-ken datapath object for the switch."""
timeout_sec = cfg.CONF.OVS.of_connect_timeout timeout_sec = cfg.CONF.OVS.of_connect_timeout
start_time = timeutils.now() start_time = timeutils.now()
while True: while True:
@ -90,7 +90,7 @@ class OpenFlowSwitchMixin(object):
active_bundle['bundle_flags'], msg, []) active_bundle['bundle_flags'], msg, [])
try: try:
result = ofctl_api.send_msg(self._app, msg, reply_cls, reply_multi) result = ofctl_api.send_msg(self._app, msg, reply_cls, reply_multi)
except ryu_exc.RyuException as e: except os_ken_exc.OSKenException as e:
m = _("ofctl request %(request)s error %(error)s") % { m = _("ofctl request %(request)s error %(error)s") % {
"request": msg, "request": msg,
"error": e, "error": e,

View File

@ -16,12 +16,12 @@
import functools import functools
import os_ken.app.ofctl.api # noqa
from os_ken.base import app_manager
from os_ken.lib import hub
from os_ken.ofproto import ofproto_v1_3
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import excutils from oslo_utils import excutils
import ryu.app.ofctl.api # noqa
from ryu.base import app_manager
from ryu.lib import hub
from ryu.ofproto import ofproto_v1_3
from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \ from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \
import br_int import br_int
@ -42,22 +42,22 @@ def agent_main_wrapper(bridge_classes):
with excutils.save_and_reraise_exception(): with excutils.save_and_reraise_exception():
LOG.exception("Agent main thread died of an exception") LOG.exception("Agent main thread died of an exception")
finally: finally:
# The following call terminates Ryu's AppManager.run_apps(), # The following call terminates os-ken's AppManager.run_apps(),
# which is needed for clean shutdown of an agent process. # which is needed for clean shutdown of an agent process.
# The close() call must be called in another thread, otherwise # The close() call must be called in another thread, otherwise
# it suicides and ends prematurely. # it suicides and ends prematurely.
hub.spawn(app_manager.AppManager.get_instance().close) hub.spawn(app_manager.AppManager.get_instance().close)
class OVSNeutronAgentRyuApp(app_manager.RyuApp): class OVSNeutronAgentOSKenApp(app_manager.OSKenApp):
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
def start(self): def start(self):
# Start Ryu event loop thread # Start os-ken event loop thread
super(OVSNeutronAgentRyuApp, self).start() super(OVSNeutronAgentOSKenApp, self).start()
def _make_br_cls(br_cls): def _make_br_cls(br_cls):
return functools.partial(br_cls, ryu_app=self) return functools.partial(br_cls, os_ken_app=self)
# Start agent main loop thread # Start agent main loop thread
bridge_classes = { bridge_classes = {

View File

@ -20,7 +20,7 @@ from oslo_log import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
# Field name mappings (from Ryu to ovs-ofctl) # Field name mappings (from os-ken to ovs-ofctl)
_keywords = { _keywords = {
'eth_src': 'dl_src', 'eth_src': 'dl_src',
'eth_dst': 'dl_dst', 'eth_dst': 'dl_dst',

View File

@ -13,16 +13,16 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from os_ken.base import app_manager
from os_ken.controller import handler
from os_ken.controller import ofp_event
from os_ken.ofproto import ofproto_v1_3
from oslo_log import log as logging from oslo_log import log as logging
from ryu.base import app_manager
from ryu.controller import handler
from ryu.controller import ofp_event
from ryu.ofproto import ofproto_v1_3
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class OVSLogRyuApp(app_manager.RyuApp): class OVSLogOSKenApp(app_manager.OSKenApp):
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
packet_in_handlers = [] packet_in_handlers = []

View File

@ -16,12 +16,12 @@
import collections import collections
from neutron_lib import constants as lib_const from neutron_lib import constants as lib_const
from os_ken.base import app_manager
from os_ken.lib.packet import packet
from oslo_config import cfg from oslo_config import cfg
from oslo_log import formatters from oslo_log import formatters
from oslo_log import handlers from oslo_log import handlers
from oslo_log import log as logging from oslo_log import log as logging
from ryu.base import app_manager
from ryu.lib.packet import packet
from neutron.agent.linux.openvswitch_firewall import constants as ovsfw_consts from neutron.agent.linux.openvswitch_firewall import constants as ovsfw_consts
from neutron.agent.linux.openvswitch_firewall import firewall as ovsfw from neutron.agent.linux.openvswitch_firewall import firewall as ovsfw
@ -31,7 +31,7 @@ from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants \
from neutron.services.logapi.agent import log_extension as log_ext from neutron.services.logapi.agent import log_extension as log_ext
from neutron.services.logapi.common import constants as log_const from neutron.services.logapi.common import constants as log_const
from neutron.services.logapi.common import exceptions as log_exc from neutron.services.logapi.common import exceptions as log_exc
from neutron.services.logapi.drivers.openvswitch import log_ryuapp from neutron.services.logapi.drivers.openvswitch import log_oskenapp
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -161,7 +161,7 @@ class OVSFirewallLoggingDriver(log_ext.LoggingDriver):
def start_logapp(self): def start_logapp(self):
app_mgr = app_manager.AppManager.get_instance() app_mgr = app_manager.AppManager.get_instance()
self.log_app = app_mgr.instantiate(log_ryuapp.OVSLogRyuApp) self.log_app = app_mgr.instantiate(log_oskenapp.OVSLogOSKenApp)
self.log_app.start() self.log_app.start()
self.log_app.register_packet_in_handler(self.packet_in_handler) self.log_app.register_packet_in_handler(self.packet_in_handler)

View File

@ -62,7 +62,7 @@ class LoggingExtensionTestFramework(test_firewall.BaseFirewallTestCase):
self.log_driver = self.initialize_ovs_fw_log() self.log_driver = self.initialize_ovs_fw_log()
def initialize_ovs_fw_log(self): def initialize_ovs_fw_log(self):
mock.patch('ryu.base.app_manager.AppManager.get_instance').start() mock.patch('os_ken.base.app_manager.AppManager.get_instance').start()
agent_api = ovs_ext_api.OVSAgentExtensionAPI( agent_api = ovs_ext_api.OVSAgentExtensionAPI(
ovs_bridge.OVSAgentBridge(self.tester.bridge.br_name), ovs_bridge.OVSAgentBridge(self.tester.bridge.br_name),
ovs_bridge.OVSAgentBridge('br-tun')) ovs_bridge.OVSAgentBridge('br-tun'))

View File

@ -96,63 +96,63 @@ class _Mod(object):
def patch_fake_oflib_of(): def patch_fake_oflib_of():
ryu_mod = mock.Mock() os_ken_mod = mock.Mock()
ryu_base_mod = ryu_mod.base os_ken_base_mod = os_ken_mod.base
ryu_exc_mod = ryu_mod.exception os_ken_exc_mod = os_ken_mod.exception
ryu_ctrl_mod = ryu_mod.controller os_ken_ctrl_mod = os_ken_mod.controller
handler = _Mod('ryu.controller.handler') handler = _Mod('os_ken.controller.handler')
handler.set_ev_cls = mock.Mock() handler.set_ev_cls = mock.Mock()
ofp_event = _Mod('ryu.controller.ofp_event') ofp_event = _Mod('os_ken.controller.ofp_event')
ryu_ctrl_mod.handler = handler os_ken_ctrl_mod.handler = handler
ryu_ctrl_mod.ofp_event = ofp_event os_ken_ctrl_mod.ofp_event = ofp_event
ryu_lib_mod = ryu_mod.lib os_ken_lib_mod = os_ken_mod.lib
ryu_lib_hub = ryu_lib_mod.hub os_ken_lib_hub = os_ken_lib_mod.hub
ryu_packet_mod = ryu_lib_mod.packet os_ken_packet_mod = os_ken_lib_mod.packet
packet = _Mod('ryu.lib.packet.packet') packet = _Mod('os_ken.lib.packet.packet')
arp = _Mod('ryu.lib.packet.arp') arp = _Mod('os_ken.lib.packet.arp')
ethernet = _Mod('ryu.lib.packet.ethernet') ethernet = _Mod('os_ken.lib.packet.ethernet')
ether_types = _Mod('ryu.lib.packet.ether_types') ether_types = _Mod('os_ken.lib.packet.ether_types')
in_proto = _Mod('ryu.lib.packet.in_proto') in_proto = _Mod('os_ken.lib.packet.in_proto')
icmpv6 = _Mod('ryu.lib.packet.icmpv6') icmpv6 = _Mod('os_ken.lib.packet.icmpv6')
vlan = _Mod('ryu.lib.packet.vlan') vlan = _Mod('os_ken.lib.packet.vlan')
ryu_packet_mod.packet = packet os_ken_packet_mod.packet = packet
packet.Packet = mock.Mock() packet.Packet = mock.Mock()
ryu_packet_mod.arp = arp os_ken_packet_mod.arp = arp
ryu_packet_mod.ethernet = ethernet os_ken_packet_mod.ethernet = ethernet
ryu_packet_mod.ether_types = ether_types os_ken_packet_mod.ether_types = ether_types
ryu_packet_mod.icmpv6 = icmpv6 os_ken_packet_mod.icmpv6 = icmpv6
ryu_packet_mod.in_proto = in_proto os_ken_packet_mod.in_proto = in_proto
ryu_packet_mod.vlan = vlan os_ken_packet_mod.vlan = vlan
ryu_ofproto_mod = ryu_mod.ofproto os_ken_ofproto_mod = os_ken_mod.ofproto
ofp = _Mod('ryu.ofproto.ofproto_v1_3') ofp = _Mod('os_ken.ofproto.ofproto_v1_3')
ofpp = _Mod('ryu.ofproto.ofproto_v1_3_parser') ofpp = _Mod('os_ken.ofproto.ofproto_v1_3_parser')
ryu_ofproto_mod.ofproto_v1_3 = ofp os_ken_ofproto_mod.ofproto_v1_3 = ofp
ryu_ofproto_mod.ofproto_v1_3_parser = ofpp os_ken_ofproto_mod.ofproto_v1_3_parser = ofpp
ryu_app_mod = ryu_mod.app os_ken_app_mod = os_ken_mod.app
ryu_app_ofctl_mod = ryu_app_mod.ofctl os_ken_app_ofctl_mod = os_ken_app_mod.ofctl
ryu_ofctl_api = ryu_app_ofctl_mod.api os_ken_ofctl_api = os_ken_app_ofctl_mod.api
modules = {'ryu': ryu_mod, modules = {'os_ken': os_ken_mod,
'ryu.base': ryu_base_mod, 'os_ken.base': os_ken_base_mod,
'ryu.controller': ryu_ctrl_mod, 'os_ken.controller': os_ken_ctrl_mod,
'ryu.controller.handler': handler, 'os_ken.controller.handler': handler,
'ryu.controller.handler.set_ev_cls': handler.set_ev_cls, 'os_ken.controller.handler.set_ev_cls': handler.set_ev_cls,
'ryu.controller.ofp_event': ofp_event, 'os_ken.controller.ofp_event': ofp_event,
'ryu.exception': ryu_exc_mod, 'os_ken.exception': os_ken_exc_mod,
'ryu.lib': ryu_lib_mod, 'os_ken.lib': os_ken_lib_mod,
'ryu.lib.hub': ryu_lib_hub, 'os_ken.lib.hub': os_ken_lib_hub,
'ryu.lib.packet': ryu_packet_mod, 'os_ken.lib.packet': os_ken_packet_mod,
'ryu.lib.packet.packet': packet, 'os_ken.lib.packet.packet': packet,
'ryu.lib.packet.packet.Packet': packet.Packet, 'os_ken.lib.packet.packet.Packet': packet.Packet,
'ryu.lib.packet.arp': arp, 'os_ken.lib.packet.arp': arp,
'ryu.lib.packet.ethernet': ethernet, 'os_ken.lib.packet.ethernet': ethernet,
'ryu.lib.packet.ether_types': ether_types, 'os_ken.lib.packet.ether_types': ether_types,
'ryu.lib.packet.icmpv6': icmpv6, 'os_ken.lib.packet.icmpv6': icmpv6,
'ryu.lib.packet.in_proto': in_proto, 'os_ken.lib.packet.in_proto': in_proto,
'ryu.lib.packet.vlan': vlan, 'os_ken.lib.packet.vlan': vlan,
'ryu.ofproto': ryu_ofproto_mod, 'os_ken.ofproto': os_ken_ofproto_mod,
'ryu.ofproto.ofproto_v1_3': ofp, 'os_ken.ofproto.ofproto_v1_3': ofp,
'ryu.ofproto.ofproto_v1_3_parser': ofpp, 'os_ken.ofproto.ofproto_v1_3_parser': ofpp,
'ryu.app': ryu_app_mod, 'os_ken.app': os_ken_app_mod,
'ryu.app.ofctl': ryu_app_ofctl_mod, 'os_ken.app.ofctl': os_ken_app_ofctl_mod,
'ryu.app.ofctl.api': ryu_ofctl_api} 'os_ken.app.ofctl.api': os_ken_ofctl_api}
return mock.patch.dict('sys.modules', modules) return mock.patch.dict('sys.modules', modules)

View File

@ -24,13 +24,13 @@ from neutron.tests.unit.plugins.ml2.drivers.openvswitch.agent \
call = mock.call # short hand call = mock.call # short hand
class OVSBridgeTestBase(ovs_test_base.OVSRyuTestBase): class OVSBridgeTestBase(ovs_test_base.OVSOSKenTestBase):
_ARP_MODULE = 'ryu.lib.packet.arp' _ARP_MODULE = 'os_ken.lib.packet.arp'
_ETHER_TYPES_MODULE = 'ryu.lib.packet.ether_types' _ETHER_TYPES_MODULE = 'os_ken.lib.packet.ether_types'
_ICMPV6_MODULE = 'ryu.lib.packet.icmpv6' _ICMPV6_MODULE = 'os_ken.lib.packet.icmpv6'
_IN_PROTO_MODULE = 'ryu.lib.packet.in_proto' _IN_PROTO_MODULE = 'os_ken.lib.packet.in_proto'
_OFP_MODULE = 'ryu.ofproto.ofproto_v1_3' _OFP_MODULE = 'os_ken.ofproto.ofproto_v1_3'
_OFPP_MODULE = 'ryu.ofproto.ofproto_v1_3_parser' _OFPP_MODULE = 'os_ken.ofproto.ofproto_v1_3_parser'
def setup_bridge_mock(self, name, cls): def setup_bridge_mock(self, name, cls):
self.br = cls(name) self.br = cls(name)
@ -129,8 +129,8 @@ class OVSBridgeTestBase(ovs_test_base.OVSRyuTestBase):
] ]
self.assertEqual(expected, self.mock.mock_calls) self.assertEqual(expected, self.mock.mock_calls)
def test__cidr_to_ryu(self): def test__cidr_to_os_ken(self):
f = self.br._cidr_to_ryu f = self.br._cidr_to_os_ken
self.assertEqual('192.168.0.1', f('192.168.0.1')) self.assertEqual('192.168.0.1', f('192.168.0.1'))
self.assertEqual('192.168.0.1', f('192.168.0.1/32')) self.assertEqual('192.168.0.1', f('192.168.0.1/32'))
self.assertEqual(('192.168.0.0', '255.255.255.0'), f('192.168.0.0/24')) self.assertEqual(('192.168.0.0', '255.255.255.0'), f('192.168.0.0/24'))

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
import mock import mock
from ryu.ofproto import ofproto_v1_3 from os_ken.ofproto import ofproto_v1_3
from ryu.ofproto import ofproto_v1_3_parser from os_ken.ofproto import ofproto_v1_3_parser
from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \ from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \
import ofswitch import ofswitch

View File

@ -24,7 +24,7 @@ from neutron.tests.unit.plugins.ml2.drivers.openvswitch.agent \
DPID = "0003e9" DPID = "0003e9"
class OVSAgentBridgeTestCase(ovs_test_base.OVSRyuTestBase): class OVSAgentBridgeTestCase(ovs_test_base.OVSOSKenTestBase):
def test__get_dp(self): def test__get_dp(self):
mock.patch.object( mock.patch.object(
ovs_lib.OVSBridge, 'get_datapath_id', return_value=DPID).start() ovs_lib.OVSBridge, 'get_datapath_id', return_value=DPID).start()

View File

@ -64,7 +64,7 @@ class OVSOFCtlTestBase(OVSAgentTestBase):
_BR_PHYS_CLASS = _DRIVER_PACKAGE + '.br_phys.OVSPhysicalBridge' _BR_PHYS_CLASS = _DRIVER_PACKAGE + '.br_phys.OVSPhysicalBridge'
class OVSRyuTestBase(OVSAgentTestBase): class OVSOSKenTestBase(OVSAgentTestBase):
_DRIVER_PACKAGE = _AGENT_PACKAGE + '.openflow.native' _DRIVER_PACKAGE = _AGENT_PACKAGE + '.openflow.native'
_BR_INT_CLASS = _DRIVER_PACKAGE + '.br_int.OVSIntegrationBridge' _BR_INT_CLASS = _DRIVER_PACKAGE + '.br_int.OVSIntegrationBridge'
_BR_TUN_CLASS = _DRIVER_PACKAGE + '.br_tun.OVSTunnelBridge' _BR_TUN_CLASS = _DRIVER_PACKAGE + '.br_tun.OVSTunnelBridge'
@ -74,8 +74,11 @@ class OVSRyuTestBase(OVSAgentTestBase):
self.fake_oflib_of = fake_oflib.patch_fake_oflib_of() self.fake_oflib_of = fake_oflib.patch_fake_oflib_of()
self.fake_oflib_of.start() self.fake_oflib_of.start()
self.addCleanup(self.fake_oflib_of.stop) self.addCleanup(self.fake_oflib_of.stop)
super(OVSRyuTestBase, self).setUp() super(OVSOSKenTestBase, self).setUp()
ryu_app = mock.Mock() os_ken_app = mock.Mock()
self.br_int_cls = functools.partial(self.br_int_cls, ryu_app=ryu_app) self.br_int_cls = functools.partial(self.br_int_cls,
self.br_phys_cls = functools.partial(self.br_phys_cls, ryu_app=ryu_app) os_ken_app=os_ken_app)
self.br_tun_cls = functools.partial(self.br_tun_cls, ryu_app=ryu_app) self.br_phys_cls = functools.partial(self.br_phys_cls,
os_ken_app=os_ken_app)
self.br_tun_cls = functools.partial(self.br_tun_cls,
os_ken_app=os_ken_app)

View File

@ -174,10 +174,10 @@ class TestOVSCookieBridgeOFCtl(ovs_test_base.OVSOFCtlTestBase):
) )
class TestOVSCookieBridgeRyu(native_ovs_bridge_test_base.OVSBridgeTestBase): class TestOVSCookieBridgeOSKen(native_ovs_bridge_test_base.OVSBridgeTestBase):
def setUp(self): def setUp(self):
super(TestOVSCookieBridgeRyu, self).setUp() super(TestOVSCookieBridgeOSKen, self).setUp()
self.setup_bridge_mock('br-int', self.br_int_cls) self.setup_bridge_mock('br-int', self.br_int_cls)
self.tested_bridge = ovs_ext_agt.OVSCookieBridge(self.br) self.tested_bridge = ovs_ext_agt.OVSCookieBridge(self.br)

View File

@ -2362,8 +2362,8 @@ class TestOvsNeutronAgentOFCtl(TestOvsNeutronAgent,
self.assertEqual(expected, del_flow.mock_calls) self.assertEqual(expected, del_flow.mock_calls)
class TestOvsNeutronAgentRyu(TestOvsNeutronAgent, class TestOvsNeutronAgentOSKen(TestOvsNeutronAgent,
ovs_test_base.OVSRyuTestBase): ovs_test_base.OVSOSKenTestBase):
def test_cleanup_stale_flows(self): def test_cleanup_stale_flows(self):
uint64_max = (1 << 64) - 1 uint64_max = (1 << 64) - 1
with mock.patch.object(self.agent.int_br, with mock.patch.object(self.agent.int_br,
@ -2372,7 +2372,7 @@ class TestOvsNeutronAgentRyu(TestOvsNeutronAgent,
'uninstall_flows') as uninstall_flows: 'uninstall_flows') as uninstall_flows:
self.agent.int_br.set_agent_uuid_stamp(1234) self.agent.int_br.set_agent_uuid_stamp(1234)
dump_flows.return_value = [ dump_flows.return_value = [
# mock ryu.ofproto.ofproto_v1_3_parser.OFPFlowStats # mock os_ken.ofproto.ofproto_v1_3_parser.OFPFlowStats
mock.Mock(cookie=1234, table_id=0), mock.Mock(cookie=1234, table_id=0),
mock.Mock(cookie=17185, table_id=2), mock.Mock(cookie=17185, table_id=2),
mock.Mock(cookie=9029, table_id=2), mock.Mock(cookie=9029, table_id=2),
@ -2515,8 +2515,8 @@ class AncillaryBridgesTestOFCtl(AncillaryBridgesTest,
pass pass
class AncillaryBridgesTestRyu(AncillaryBridgesTest, class AncillaryBridgesTestOSKen(AncillaryBridgesTest,
ovs_test_base.OVSRyuTestBase): ovs_test_base.OVSOSKenTestBase):
pass pass
@ -3529,8 +3529,8 @@ class TestOvsDvrNeutronAgentOFCtl(TestOvsDvrNeutronAgent,
pass pass
class TestOvsDvrNeutronAgentRyu(TestOvsDvrNeutronAgent, class TestOvsDvrNeutronAgentOSKen(TestOvsDvrNeutronAgent,
ovs_test_base.OVSRyuTestBase): ovs_test_base.OVSOSKenTestBase):
pass pass

View File

@ -649,7 +649,7 @@ class TunnelTestOFCtl(TunnelTest, ovs_test_base.OVSOFCtlTestBase):
pass pass
class TunnelTestRyu(TunnelTest, ovs_test_base.OVSRyuTestBase): class TunnelTestOSKen(TunnelTest, ovs_test_base.OVSOSKenTestBase):
pass pass
@ -747,8 +747,8 @@ class TunnelTestUseVethIntercoOFCtl(TunnelTestUseVethInterco,
pass pass
class TunnelTestUseVethIntercoRyu(TunnelTestUseVethInterco, class TunnelTestUseVethIntercoOSKen(TunnelTestUseVethInterco,
ovs_test_base.OVSRyuTestBase): ovs_test_base.OVSOSKenTestBase):
pass pass
@ -766,6 +766,6 @@ class TunnelTestWithMTUOFCtl(TunnelTestWithMTU,
pass pass
class TunnelTestWithMTURyu(TunnelTestWithMTU, class TunnelTestWithMTUOSKen(TunnelTestWithMTU,
ovs_test_base.OVSRyuTestBase): ovs_test_base.OVSOSKenTestBase):
pass pass

View File

@ -1,5 +1,5 @@
- hosts: all - hosts: all
name: Autoconverted job legacy-periodic-tempest-dsvm-neutron-with-ryu-master from name: Autoconverted job legacy-periodic-tempest-dsvm-neutron-with-os-ken-master from
old job periodic-tempest-dsvm-neutron-with-ryu-master-ubuntu-xenial old job periodic-tempest-dsvm-neutron-with-ryu-master-ubuntu-xenial
tasks: tasks:
@ -39,11 +39,11 @@
fi fi
function gate_hook { function gate_hook {
local ryu_path=$BASE/new/ryu_master local os_ken_path=$BASE/new/os_ken_master
if [ ! -d $ryu_path ]; then if [ ! -d $os_ken_path ]; then
git clone https://github.com/osrg/ryu $ryu_path git clone https://github.com/openstack/os-ken.git $os_ken_path
fi fi
sudo pip install -e $ryu_path sudo pip install -e $os_ken_path
$BASE/new/devstack-gate/devstack-vm-gate.sh $BASE/new/devstack-gate/devstack-vm-gate.sh
} }
export -f gate_hook export -f gate_hook

View File

@ -18,7 +18,6 @@ netifaces>=0.10.4 # MIT
neutron-lib>=1.21.0 # Apache-2.0 neutron-lib>=1.21.0 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0 python-neutronclient>=6.7.0 # Apache-2.0
tenacity>=3.2.1 # Apache-2.0 tenacity>=3.2.1 # Apache-2.0
ryu>=4.24 # Apache-2.0
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.2.0 # MIT SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.2.0 # MIT
WebOb>=1.8.2 # MIT WebOb>=1.8.2 # MIT
keystoneauth1>=3.4.0 # Apache-2.0 keystoneauth1>=3.4.0 # Apache-2.0
@ -44,6 +43,7 @@ oslo.upgradecheck>=0.1.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0
oslo.versionedobjects>=1.31.2 # Apache-2.0 oslo.versionedobjects>=1.31.2 # Apache-2.0
osprofiler>=1.4.0 # Apache-2.0 osprofiler>=1.4.0 # Apache-2.0
os-ken >= 0.3.0 # Apache-2.0
ovs>=2.8.0 # Apache-2.0 ovs>=2.8.0 # Apache-2.0
ovsdbapp>=0.9.1 # Apache-2.0 ovsdbapp>=0.9.1 # Apache-2.0
psutil>=3.2.2 # BSD psutil>=3.2.2 # BSD