Replace ryu with os_ken
Implements: blueprint ryu-framework-maintenace-transition Change-Id: Ic721efc7cd0066be0ea7b6239b273e656643e9c1
This commit is contained in:
parent
462b510c50
commit
7a2b4dcff1
@ -77,7 +77,7 @@
|
||||
jobs:
|
||||
- neutron-functional
|
||||
- neutron-tempest-postgres-full
|
||||
- neutron-tempest-with-ryu-master
|
||||
- neutron-tempest-with-os-ken-master
|
||||
experimental:
|
||||
jobs:
|
||||
- neutron-functional-python35
|
||||
@ -276,10 +276,10 @@
|
||||
- openstack/tempest
|
||||
|
||||
- job:
|
||||
name: neutron-tempest-with-ryu-master
|
||||
name: neutron-tempest-with-os-ken-master
|
||||
parent: legacy-dsvm-base
|
||||
run: playbooks/legacy/neutron-tempest-with-ryu-master/run.yaml
|
||||
post-run: playbooks/legacy/neutron-tempest-with-ryu-master/post.yaml
|
||||
run: playbooks/legacy/neutron-tempest-with-os-ken-master/run.yaml
|
||||
post-run: playbooks/legacy/neutron-tempest-with-os-ken-master/post.yaml
|
||||
timeout: 7800
|
||||
required-projects:
|
||||
- openstack-infra/devstack-gate
|
||||
|
@ -60,6 +60,7 @@ neutron-lib==1.21.0
|
||||
openstackdocstheme==1.18.1
|
||||
openstacksdk==0.11.2
|
||||
os-client-config==1.28.0
|
||||
os-ken==0.3.0
|
||||
os-service-types==1.2.0
|
||||
os-xenapi==0.3.1
|
||||
osc-lib==1.8.0
|
||||
@ -123,7 +124,6 @@ requests==2.14.2
|
||||
requestsexceptions==1.2.0
|
||||
rfc3986==0.3.1
|
||||
Routes==2.3.1
|
||||
ryu==4.24
|
||||
simplejson==3.5.1
|
||||
six==1.10.0
|
||||
smmap==0.9.0
|
||||
|
@ -41,8 +41,8 @@ LOG = logging.getLogger(__name__)
|
||||
EXTRA_LOG_LEVEL_DEFAULTS = [
|
||||
'OFPHandler=INFO',
|
||||
'OfctlService=INFO',
|
||||
'ryu.base.app_manager=INFO',
|
||||
'ryu.controller.controller=INFO',
|
||||
'os_ken.base.app_manager=INFO',
|
||||
'os_ken.controller.controller=INFO',
|
||||
'ovsdbapp.backend.ovs_idl.vlog=INFO'
|
||||
]
|
||||
|
||||
|
@ -14,9 +14,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from ryu.lib.packet import ether_types
|
||||
from ryu.lib.packet import icmpv6
|
||||
from ryu.lib.packet import in_proto
|
||||
from os_ken.lib.packet import ether_types
|
||||
from os_ken.lib.packet import icmpv6
|
||||
from os_ken.lib.packet import in_proto
|
||||
|
||||
|
||||
class OVSDVRProcessMixin(object):
|
||||
|
@ -22,10 +22,10 @@
|
||||
import netaddr
|
||||
|
||||
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 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.openflow.native \
|
||||
@ -176,7 +176,7 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
|
||||
# Allow neighbor advertisements as long as they match addresses
|
||||
# that actually belong to the port.
|
||||
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, priority=2,
|
||||
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
|
||||
# belong to the port.
|
||||
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,
|
||||
priority=2,
|
||||
eth_type=ether_types.ETH_TYPE_ARP,
|
||||
|
@ -29,8 +29,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from ryu.lib.packet import arp
|
||||
from ryu.lib.packet import ether_types
|
||||
from os_ken.lib.packet import arp
|
||||
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.openflow.native \
|
||||
|
@ -14,9 +14,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# 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 ryu.base import app_manager
|
||||
from ryu import cfg as ryu_cfg
|
||||
|
||||
|
||||
cfg.CONF.import_group(
|
||||
@ -25,13 +25,13 @@ cfg.CONF.import_group(
|
||||
|
||||
|
||||
def init_config():
|
||||
ryu_cfg.CONF(project='ryu', args=[])
|
||||
ryu_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(project='os_ken', args=[])
|
||||
os_ken_cfg.CONF.ofp_listen_host = cfg.CONF.OVS.of_listen_address
|
||||
os_ken_cfg.CONF.ofp_tcp_listen_port = cfg.CONF.OVS.of_listen_port
|
||||
|
||||
|
||||
def main():
|
||||
app_manager.AppManager.run_apps([
|
||||
'neutron.plugins.ml2.drivers.openvswitch.agent.'
|
||||
'openflow.native.ovs_ryuapp',
|
||||
'openflow.native.ovs_oskenapp',
|
||||
])
|
||||
|
@ -20,14 +20,14 @@ import random
|
||||
import eventlet
|
||||
import netaddr
|
||||
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_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
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
|
||||
|
||||
from neutron._i18n import _
|
||||
@ -51,19 +51,19 @@ class OpenFlowSwitchMixin(object):
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def _cidr_to_ryu(ip):
|
||||
def _cidr_to_os_ken(ip):
|
||||
n = netaddr.IPNetwork(ip)
|
||||
if n.hostmask:
|
||||
return (str(n.ip), str(n.netmask))
|
||||
return str(n.ip)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self._app = kwargs.pop('ryu_app')
|
||||
self._app = kwargs.pop('os_ken_app')
|
||||
self.active_bundles = set()
|
||||
super(OpenFlowSwitchMixin, self).__init__(*args, **kwargs)
|
||||
|
||||
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
|
||||
start_time = timeutils.now()
|
||||
while True:
|
||||
@ -90,7 +90,7 @@ class OpenFlowSwitchMixin(object):
|
||||
active_bundle['bundle_flags'], msg, [])
|
||||
try:
|
||||
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") % {
|
||||
"request": msg,
|
||||
"error": e,
|
||||
|
@ -16,12 +16,12 @@
|
||||
|
||||
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_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 \
|
||||
import br_int
|
||||
@ -42,22 +42,22 @@ def agent_main_wrapper(bridge_classes):
|
||||
with excutils.save_and_reraise_exception():
|
||||
LOG.exception("Agent main thread died of an exception")
|
||||
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.
|
||||
# The close() call must be called in another thread, otherwise
|
||||
# it suicides and ends prematurely.
|
||||
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]
|
||||
|
||||
def start(self):
|
||||
# Start Ryu event loop thread
|
||||
super(OVSNeutronAgentRyuApp, self).start()
|
||||
# Start os-ken event loop thread
|
||||
super(OVSNeutronAgentOSKenApp, self).start()
|
||||
|
||||
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
|
||||
bridge_classes = {
|
@ -20,7 +20,7 @@ from oslo_log import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
# Field name mappings (from Ryu to ovs-ofctl)
|
||||
# Field name mappings (from os-ken to ovs-ofctl)
|
||||
_keywords = {
|
||||
'eth_src': 'dl_src',
|
||||
'eth_dst': 'dl_dst',
|
||||
|
@ -13,16 +13,16 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# 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 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__)
|
||||
|
||||
|
||||
class OVSLogRyuApp(app_manager.RyuApp):
|
||||
class OVSLogOSKenApp(app_manager.OSKenApp):
|
||||
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
|
||||
packet_in_handlers = []
|
||||
|
@ -16,12 +16,12 @@
|
||||
import collections
|
||||
|
||||
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_log import formatters
|
||||
from oslo_log import handlers
|
||||
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 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.common import constants as log_const
|
||||
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__)
|
||||
|
||||
@ -161,7 +161,7 @@ class OVSFirewallLoggingDriver(log_ext.LoggingDriver):
|
||||
|
||||
def start_logapp(self):
|
||||
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.register_packet_in_handler(self.packet_in_handler)
|
||||
|
||||
|
@ -62,7 +62,7 @@ class LoggingExtensionTestFramework(test_firewall.BaseFirewallTestCase):
|
||||
self.log_driver = self.initialize_ovs_fw_log()
|
||||
|
||||
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(
|
||||
ovs_bridge.OVSAgentBridge(self.tester.bridge.br_name),
|
||||
ovs_bridge.OVSAgentBridge('br-tun'))
|
||||
|
@ -96,63 +96,63 @@ class _Mod(object):
|
||||
|
||||
|
||||
def patch_fake_oflib_of():
|
||||
ryu_mod = mock.Mock()
|
||||
ryu_base_mod = ryu_mod.base
|
||||
ryu_exc_mod = ryu_mod.exception
|
||||
ryu_ctrl_mod = ryu_mod.controller
|
||||
handler = _Mod('ryu.controller.handler')
|
||||
os_ken_mod = mock.Mock()
|
||||
os_ken_base_mod = os_ken_mod.base
|
||||
os_ken_exc_mod = os_ken_mod.exception
|
||||
os_ken_ctrl_mod = os_ken_mod.controller
|
||||
handler = _Mod('os_ken.controller.handler')
|
||||
handler.set_ev_cls = mock.Mock()
|
||||
ofp_event = _Mod('ryu.controller.ofp_event')
|
||||
ryu_ctrl_mod.handler = handler
|
||||
ryu_ctrl_mod.ofp_event = ofp_event
|
||||
ryu_lib_mod = ryu_mod.lib
|
||||
ryu_lib_hub = ryu_lib_mod.hub
|
||||
ryu_packet_mod = ryu_lib_mod.packet
|
||||
packet = _Mod('ryu.lib.packet.packet')
|
||||
arp = _Mod('ryu.lib.packet.arp')
|
||||
ethernet = _Mod('ryu.lib.packet.ethernet')
|
||||
ether_types = _Mod('ryu.lib.packet.ether_types')
|
||||
in_proto = _Mod('ryu.lib.packet.in_proto')
|
||||
icmpv6 = _Mod('ryu.lib.packet.icmpv6')
|
||||
vlan = _Mod('ryu.lib.packet.vlan')
|
||||
ryu_packet_mod.packet = packet
|
||||
ofp_event = _Mod('os_ken.controller.ofp_event')
|
||||
os_ken_ctrl_mod.handler = handler
|
||||
os_ken_ctrl_mod.ofp_event = ofp_event
|
||||
os_ken_lib_mod = os_ken_mod.lib
|
||||
os_ken_lib_hub = os_ken_lib_mod.hub
|
||||
os_ken_packet_mod = os_ken_lib_mod.packet
|
||||
packet = _Mod('os_ken.lib.packet.packet')
|
||||
arp = _Mod('os_ken.lib.packet.arp')
|
||||
ethernet = _Mod('os_ken.lib.packet.ethernet')
|
||||
ether_types = _Mod('os_ken.lib.packet.ether_types')
|
||||
in_proto = _Mod('os_ken.lib.packet.in_proto')
|
||||
icmpv6 = _Mod('os_ken.lib.packet.icmpv6')
|
||||
vlan = _Mod('os_ken.lib.packet.vlan')
|
||||
os_ken_packet_mod.packet = packet
|
||||
packet.Packet = mock.Mock()
|
||||
ryu_packet_mod.arp = arp
|
||||
ryu_packet_mod.ethernet = ethernet
|
||||
ryu_packet_mod.ether_types = ether_types
|
||||
ryu_packet_mod.icmpv6 = icmpv6
|
||||
ryu_packet_mod.in_proto = in_proto
|
||||
ryu_packet_mod.vlan = vlan
|
||||
ryu_ofproto_mod = ryu_mod.ofproto
|
||||
ofp = _Mod('ryu.ofproto.ofproto_v1_3')
|
||||
ofpp = _Mod('ryu.ofproto.ofproto_v1_3_parser')
|
||||
ryu_ofproto_mod.ofproto_v1_3 = ofp
|
||||
ryu_ofproto_mod.ofproto_v1_3_parser = ofpp
|
||||
ryu_app_mod = ryu_mod.app
|
||||
ryu_app_ofctl_mod = ryu_app_mod.ofctl
|
||||
ryu_ofctl_api = ryu_app_ofctl_mod.api
|
||||
modules = {'ryu': ryu_mod,
|
||||
'ryu.base': ryu_base_mod,
|
||||
'ryu.controller': ryu_ctrl_mod,
|
||||
'ryu.controller.handler': handler,
|
||||
'ryu.controller.handler.set_ev_cls': handler.set_ev_cls,
|
||||
'ryu.controller.ofp_event': ofp_event,
|
||||
'ryu.exception': ryu_exc_mod,
|
||||
'ryu.lib': ryu_lib_mod,
|
||||
'ryu.lib.hub': ryu_lib_hub,
|
||||
'ryu.lib.packet': ryu_packet_mod,
|
||||
'ryu.lib.packet.packet': packet,
|
||||
'ryu.lib.packet.packet.Packet': packet.Packet,
|
||||
'ryu.lib.packet.arp': arp,
|
||||
'ryu.lib.packet.ethernet': ethernet,
|
||||
'ryu.lib.packet.ether_types': ether_types,
|
||||
'ryu.lib.packet.icmpv6': icmpv6,
|
||||
'ryu.lib.packet.in_proto': in_proto,
|
||||
'ryu.lib.packet.vlan': vlan,
|
||||
'ryu.ofproto': ryu_ofproto_mod,
|
||||
'ryu.ofproto.ofproto_v1_3': ofp,
|
||||
'ryu.ofproto.ofproto_v1_3_parser': ofpp,
|
||||
'ryu.app': ryu_app_mod,
|
||||
'ryu.app.ofctl': ryu_app_ofctl_mod,
|
||||
'ryu.app.ofctl.api': ryu_ofctl_api}
|
||||
os_ken_packet_mod.arp = arp
|
||||
os_ken_packet_mod.ethernet = ethernet
|
||||
os_ken_packet_mod.ether_types = ether_types
|
||||
os_ken_packet_mod.icmpv6 = icmpv6
|
||||
os_ken_packet_mod.in_proto = in_proto
|
||||
os_ken_packet_mod.vlan = vlan
|
||||
os_ken_ofproto_mod = os_ken_mod.ofproto
|
||||
ofp = _Mod('os_ken.ofproto.ofproto_v1_3')
|
||||
ofpp = _Mod('os_ken.ofproto.ofproto_v1_3_parser')
|
||||
os_ken_ofproto_mod.ofproto_v1_3 = ofp
|
||||
os_ken_ofproto_mod.ofproto_v1_3_parser = ofpp
|
||||
os_ken_app_mod = os_ken_mod.app
|
||||
os_ken_app_ofctl_mod = os_ken_app_mod.ofctl
|
||||
os_ken_ofctl_api = os_ken_app_ofctl_mod.api
|
||||
modules = {'os_ken': os_ken_mod,
|
||||
'os_ken.base': os_ken_base_mod,
|
||||
'os_ken.controller': os_ken_ctrl_mod,
|
||||
'os_ken.controller.handler': handler,
|
||||
'os_ken.controller.handler.set_ev_cls': handler.set_ev_cls,
|
||||
'os_ken.controller.ofp_event': ofp_event,
|
||||
'os_ken.exception': os_ken_exc_mod,
|
||||
'os_ken.lib': os_ken_lib_mod,
|
||||
'os_ken.lib.hub': os_ken_lib_hub,
|
||||
'os_ken.lib.packet': os_ken_packet_mod,
|
||||
'os_ken.lib.packet.packet': packet,
|
||||
'os_ken.lib.packet.packet.Packet': packet.Packet,
|
||||
'os_ken.lib.packet.arp': arp,
|
||||
'os_ken.lib.packet.ethernet': ethernet,
|
||||
'os_ken.lib.packet.ether_types': ether_types,
|
||||
'os_ken.lib.packet.icmpv6': icmpv6,
|
||||
'os_ken.lib.packet.in_proto': in_proto,
|
||||
'os_ken.lib.packet.vlan': vlan,
|
||||
'os_ken.ofproto': os_ken_ofproto_mod,
|
||||
'os_ken.ofproto.ofproto_v1_3': ofp,
|
||||
'os_ken.ofproto.ofproto_v1_3_parser': ofpp,
|
||||
'os_ken.app': os_ken_app_mod,
|
||||
'os_ken.app.ofctl': os_ken_app_ofctl_mod,
|
||||
'os_ken.app.ofctl.api': os_ken_ofctl_api}
|
||||
return mock.patch.dict('sys.modules', modules)
|
||||
|
@ -24,13 +24,13 @@ from neutron.tests.unit.plugins.ml2.drivers.openvswitch.agent \
|
||||
call = mock.call # short hand
|
||||
|
||||
|
||||
class OVSBridgeTestBase(ovs_test_base.OVSRyuTestBase):
|
||||
_ARP_MODULE = 'ryu.lib.packet.arp'
|
||||
_ETHER_TYPES_MODULE = 'ryu.lib.packet.ether_types'
|
||||
_ICMPV6_MODULE = 'ryu.lib.packet.icmpv6'
|
||||
_IN_PROTO_MODULE = 'ryu.lib.packet.in_proto'
|
||||
_OFP_MODULE = 'ryu.ofproto.ofproto_v1_3'
|
||||
_OFPP_MODULE = 'ryu.ofproto.ofproto_v1_3_parser'
|
||||
class OVSBridgeTestBase(ovs_test_base.OVSOSKenTestBase):
|
||||
_ARP_MODULE = 'os_ken.lib.packet.arp'
|
||||
_ETHER_TYPES_MODULE = 'os_ken.lib.packet.ether_types'
|
||||
_ICMPV6_MODULE = 'os_ken.lib.packet.icmpv6'
|
||||
_IN_PROTO_MODULE = 'os_ken.lib.packet.in_proto'
|
||||
_OFP_MODULE = 'os_ken.ofproto.ofproto_v1_3'
|
||||
_OFPP_MODULE = 'os_ken.ofproto.ofproto_v1_3_parser'
|
||||
|
||||
def setup_bridge_mock(self, name, cls):
|
||||
self.br = cls(name)
|
||||
@ -129,8 +129,8 @@ class OVSBridgeTestBase(ovs_test_base.OVSRyuTestBase):
|
||||
]
|
||||
self.assertEqual(expected, self.mock.mock_calls)
|
||||
|
||||
def test__cidr_to_ryu(self):
|
||||
f = self.br._cidr_to_ryu
|
||||
def test__cidr_to_os_ken(self):
|
||||
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/32'))
|
||||
self.assertEqual(('192.168.0.0', '255.255.255.0'), f('192.168.0.0/24'))
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.ofproto import ofproto_v1_3_parser
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.ofproto import ofproto_v1_3_parser
|
||||
|
||||
from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \
|
||||
import ofswitch
|
||||
|
@ -24,7 +24,7 @@ from neutron.tests.unit.plugins.ml2.drivers.openvswitch.agent \
|
||||
DPID = "0003e9"
|
||||
|
||||
|
||||
class OVSAgentBridgeTestCase(ovs_test_base.OVSRyuTestBase):
|
||||
class OVSAgentBridgeTestCase(ovs_test_base.OVSOSKenTestBase):
|
||||
def test__get_dp(self):
|
||||
mock.patch.object(
|
||||
ovs_lib.OVSBridge, 'get_datapath_id', return_value=DPID).start()
|
||||
|
@ -64,7 +64,7 @@ class OVSOFCtlTestBase(OVSAgentTestBase):
|
||||
_BR_PHYS_CLASS = _DRIVER_PACKAGE + '.br_phys.OVSPhysicalBridge'
|
||||
|
||||
|
||||
class OVSRyuTestBase(OVSAgentTestBase):
|
||||
class OVSOSKenTestBase(OVSAgentTestBase):
|
||||
_DRIVER_PACKAGE = _AGENT_PACKAGE + '.openflow.native'
|
||||
_BR_INT_CLASS = _DRIVER_PACKAGE + '.br_int.OVSIntegrationBridge'
|
||||
_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.start()
|
||||
self.addCleanup(self.fake_oflib_of.stop)
|
||||
super(OVSRyuTestBase, self).setUp()
|
||||
ryu_app = mock.Mock()
|
||||
self.br_int_cls = functools.partial(self.br_int_cls, ryu_app=ryu_app)
|
||||
self.br_phys_cls = functools.partial(self.br_phys_cls, ryu_app=ryu_app)
|
||||
self.br_tun_cls = functools.partial(self.br_tun_cls, ryu_app=ryu_app)
|
||||
super(OVSOSKenTestBase, self).setUp()
|
||||
os_ken_app = mock.Mock()
|
||||
self.br_int_cls = functools.partial(self.br_int_cls,
|
||||
os_ken_app=os_ken_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)
|
||||
|
@ -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):
|
||||
super(TestOVSCookieBridgeRyu, self).setUp()
|
||||
super(TestOVSCookieBridgeOSKen, self).setUp()
|
||||
self.setup_bridge_mock('br-int', self.br_int_cls)
|
||||
self.tested_bridge = ovs_ext_agt.OVSCookieBridge(self.br)
|
||||
|
||||
|
@ -2362,8 +2362,8 @@ class TestOvsNeutronAgentOFCtl(TestOvsNeutronAgent,
|
||||
self.assertEqual(expected, del_flow.mock_calls)
|
||||
|
||||
|
||||
class TestOvsNeutronAgentRyu(TestOvsNeutronAgent,
|
||||
ovs_test_base.OVSRyuTestBase):
|
||||
class TestOvsNeutronAgentOSKen(TestOvsNeutronAgent,
|
||||
ovs_test_base.OVSOSKenTestBase):
|
||||
def test_cleanup_stale_flows(self):
|
||||
uint64_max = (1 << 64) - 1
|
||||
with mock.patch.object(self.agent.int_br,
|
||||
@ -2372,7 +2372,7 @@ class TestOvsNeutronAgentRyu(TestOvsNeutronAgent,
|
||||
'uninstall_flows') as uninstall_flows:
|
||||
self.agent.int_br.set_agent_uuid_stamp(1234)
|
||||
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=17185, table_id=2),
|
||||
mock.Mock(cookie=9029, table_id=2),
|
||||
@ -2515,8 +2515,8 @@ class AncillaryBridgesTestOFCtl(AncillaryBridgesTest,
|
||||
pass
|
||||
|
||||
|
||||
class AncillaryBridgesTestRyu(AncillaryBridgesTest,
|
||||
ovs_test_base.OVSRyuTestBase):
|
||||
class AncillaryBridgesTestOSKen(AncillaryBridgesTest,
|
||||
ovs_test_base.OVSOSKenTestBase):
|
||||
pass
|
||||
|
||||
|
||||
@ -3529,8 +3529,8 @@ class TestOvsDvrNeutronAgentOFCtl(TestOvsDvrNeutronAgent,
|
||||
pass
|
||||
|
||||
|
||||
class TestOvsDvrNeutronAgentRyu(TestOvsDvrNeutronAgent,
|
||||
ovs_test_base.OVSRyuTestBase):
|
||||
class TestOvsDvrNeutronAgentOSKen(TestOvsDvrNeutronAgent,
|
||||
ovs_test_base.OVSOSKenTestBase):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -649,7 +649,7 @@ class TunnelTestOFCtl(TunnelTest, ovs_test_base.OVSOFCtlTestBase):
|
||||
pass
|
||||
|
||||
|
||||
class TunnelTestRyu(TunnelTest, ovs_test_base.OVSRyuTestBase):
|
||||
class TunnelTestOSKen(TunnelTest, ovs_test_base.OVSOSKenTestBase):
|
||||
pass
|
||||
|
||||
|
||||
@ -747,8 +747,8 @@ class TunnelTestUseVethIntercoOFCtl(TunnelTestUseVethInterco,
|
||||
pass
|
||||
|
||||
|
||||
class TunnelTestUseVethIntercoRyu(TunnelTestUseVethInterco,
|
||||
ovs_test_base.OVSRyuTestBase):
|
||||
class TunnelTestUseVethIntercoOSKen(TunnelTestUseVethInterco,
|
||||
ovs_test_base.OVSOSKenTestBase):
|
||||
pass
|
||||
|
||||
|
||||
@ -766,6 +766,6 @@ class TunnelTestWithMTUOFCtl(TunnelTestWithMTU,
|
||||
pass
|
||||
|
||||
|
||||
class TunnelTestWithMTURyu(TunnelTestWithMTU,
|
||||
ovs_test_base.OVSRyuTestBase):
|
||||
class TunnelTestWithMTUOSKen(TunnelTestWithMTU,
|
||||
ovs_test_base.OVSOSKenTestBase):
|
||||
pass
|
||||
|
@ -1,5 +1,5 @@
|
||||
- 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
|
||||
tasks:
|
||||
|
||||
@ -39,11 +39,11 @@
|
||||
fi
|
||||
|
||||
function gate_hook {
|
||||
local ryu_path=$BASE/new/ryu_master
|
||||
if [ ! -d $ryu_path ]; then
|
||||
git clone https://github.com/osrg/ryu $ryu_path
|
||||
local os_ken_path=$BASE/new/os_ken_master
|
||||
if [ ! -d $os_ken_path ]; then
|
||||
git clone https://github.com/openstack/os-ken.git $os_ken_path
|
||||
fi
|
||||
sudo pip install -e $ryu_path
|
||||
sudo pip install -e $os_ken_path
|
||||
$BASE/new/devstack-gate/devstack-vm-gate.sh
|
||||
}
|
||||
export -f gate_hook
|
@ -18,7 +18,6 @@ netifaces>=0.10.4 # MIT
|
||||
neutron-lib>=1.21.0 # Apache-2.0
|
||||
python-neutronclient>=6.7.0 # 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
|
||||
WebOb>=1.8.2 # MIT
|
||||
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.versionedobjects>=1.31.2 # 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
|
||||
ovsdbapp>=0.9.1 # Apache-2.0
|
||||
psutil>=3.2.2 # BSD
|
||||
|
Loading…
Reference in New Issue
Block a user