Merge "ovs-dpdk support in neutron-sanity-check"
This commit is contained in:
commit
64c432434b
@ -85,7 +85,8 @@ def _get_ovn_version(check_type):
|
|||||||
def ovs_vxlan_supported(from_ip='192.0.2.1', to_ip='192.0.2.2'):
|
def ovs_vxlan_supported(from_ip='192.0.2.1', to_ip='192.0.2.2'):
|
||||||
br_name = common_utils.get_rand_device_name(prefix='vxlantest-')
|
br_name = common_utils.get_rand_device_name(prefix='vxlantest-')
|
||||||
port_name = common_utils.get_rand_device_name(prefix='vxlantest-')
|
port_name = common_utils.get_rand_device_name(prefix='vxlantest-')
|
||||||
with ovs_lib.OVSBridge(br_name) as br:
|
with ovs_lib.OVSBridge(br_name,
|
||||||
|
datapath_type=cfg.CONF.OVS.datapath_type) as br:
|
||||||
port = br.add_tunnel_port(
|
port = br.add_tunnel_port(
|
||||||
port_name=port_name,
|
port_name=port_name,
|
||||||
remote_ip=from_ip,
|
remote_ip=from_ip,
|
||||||
@ -97,7 +98,8 @@ def ovs_vxlan_supported(from_ip='192.0.2.1', to_ip='192.0.2.2'):
|
|||||||
def ovs_geneve_supported(from_ip='192.0.2.3', to_ip='192.0.2.4'):
|
def ovs_geneve_supported(from_ip='192.0.2.3', to_ip='192.0.2.4'):
|
||||||
br_name = common_utils.get_rand_device_name(prefix='genevetest-')
|
br_name = common_utils.get_rand_device_name(prefix='genevetest-')
|
||||||
port_name = common_utils.get_rand_device_name(prefix='genevetest-')
|
port_name = common_utils.get_rand_device_name(prefix='genevetest-')
|
||||||
with ovs_lib.OVSBridge(br_name) as br:
|
with ovs_lib.OVSBridge(br_name,
|
||||||
|
datapath_type=cfg.CONF.OVS.datapath_type) as br:
|
||||||
port = br.add_tunnel_port(
|
port = br.add_tunnel_port(
|
||||||
port_name=port_name,
|
port_name=port_name,
|
||||||
remote_ip=from_ip,
|
remote_ip=from_ip,
|
||||||
@ -119,7 +121,8 @@ def iproute2_vxlan_supported():
|
|||||||
def patch_supported():
|
def patch_supported():
|
||||||
name, peer_name, patch_name = common_utils.get_related_rand_device_names(
|
name, peer_name, patch_name = common_utils.get_related_rand_device_names(
|
||||||
['patchtest-', 'peertest0-', 'peertest1-'])
|
['patchtest-', 'peertest0-', 'peertest1-'])
|
||||||
with ovs_lib.OVSBridge(name) as br:
|
with ovs_lib.OVSBridge(name,
|
||||||
|
datapath_type=cfg.CONF.OVS.datapath_type) as br:
|
||||||
port = br.add_patch_port(patch_name, peer_name)
|
port = br.add_patch_port(patch_name, peer_name)
|
||||||
return port != ovs_lib.INVALID_OFPORT
|
return port != ovs_lib.INVALID_OFPORT
|
||||||
|
|
||||||
@ -141,7 +144,9 @@ def ofctl_arg_supported(cmd, **kwargs):
|
|||||||
:returns: a boolean if the supplied arguments are supported.
|
:returns: a boolean if the supplied arguments are supported.
|
||||||
"""
|
"""
|
||||||
br_name = common_utils.get_rand_device_name(prefix='br-test-')
|
br_name = common_utils.get_rand_device_name(prefix='br-test-')
|
||||||
with ovs_lib.OVSBridge(br_name) as test_br:
|
with ovs_lib.OVSBridge(
|
||||||
|
br_name,
|
||||||
|
datapath_type=cfg.CONF.OVS.datapath_type) as test_br:
|
||||||
full_args = ["ovs-ofctl", cmd, test_br.br_name,
|
full_args = ["ovs-ofctl", cmd, test_br.br_name,
|
||||||
ovs_lib._build_flow_expr_str(kwargs, cmd.split('-')[0],
|
ovs_lib._build_flow_expr_str(kwargs, cmd.split('-')[0],
|
||||||
False)]
|
False)]
|
||||||
@ -397,7 +402,8 @@ def keepalived_ipv6_supported():
|
|||||||
gw_vip = 'fdf8:f53b:82e4::10/64'
|
gw_vip = 'fdf8:f53b:82e4::10/64'
|
||||||
expected_default_gw = 'fe80:f816::1'
|
expected_default_gw = 'fe80:f816::1'
|
||||||
|
|
||||||
with ovs_lib.OVSBridge(br_name) as br:
|
with ovs_lib.OVSBridge(br_name,
|
||||||
|
datapath_type=cfg.CONF.OVS.datapath_type) as br:
|
||||||
with KeepalivedIPv6Test(ha_port, gw_port, gw_vip,
|
with KeepalivedIPv6Test(ha_port, gw_port, gw_vip,
|
||||||
expected_default_gw) as ka:
|
expected_default_gw) as ka:
|
||||||
br.add_port(ha_port, ('type', 'internal'))
|
br.add_port(ha_port, ('type', 'internal'))
|
||||||
@ -453,7 +459,8 @@ def ovsdb_native_supported():
|
|||||||
def ovs_conntrack_supported():
|
def ovs_conntrack_supported():
|
||||||
br_name = common_utils.get_rand_device_name(prefix="ovs-test-")
|
br_name = common_utils.get_rand_device_name(prefix="ovs-test-")
|
||||||
|
|
||||||
with ovs_lib.OVSBridge(br_name) as br:
|
with ovs_lib.OVSBridge(br_name,
|
||||||
|
datapath_type=cfg.CONF.OVS.datapath_type) as br:
|
||||||
try:
|
try:
|
||||||
br.add_protocols(*["OpenFlow%d" % i for i in range(10, 15)])
|
br.add_protocols(*["OpenFlow%d" % i for i in range(10, 15)])
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
|
@ -19,6 +19,7 @@ from oslo_utils import uuidutils
|
|||||||
from neutron.agent.linux import iptables_firewall
|
from neutron.agent.linux import iptables_firewall
|
||||||
from neutron.agent.linux import iptables_manager
|
from neutron.agent.linux import iptables_manager
|
||||||
from neutron.cmd.sanity import checks
|
from neutron.cmd.sanity import checks
|
||||||
|
from neutron.cmd import sanity_check
|
||||||
from neutron.common import utils as common_utils
|
from neutron.common import utils as common_utils
|
||||||
from neutron.tests.common import net_helpers
|
from neutron.tests.common import net_helpers
|
||||||
from neutron.tests.fullstack import base
|
from neutron.tests.fullstack import base
|
||||||
@ -36,6 +37,8 @@ class StatelessRulesNotConfiguredException(Exception):
|
|||||||
class OVSVersionChecker(object):
|
class OVSVersionChecker(object):
|
||||||
conntrack_supported = None
|
conntrack_supported = None
|
||||||
|
|
||||||
|
sanity_check.setup_conf()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def supports_ovsfirewall(cls):
|
def supports_ovsfirewall(cls):
|
||||||
if cls.conntrack_supported is None:
|
if cls.conntrack_supported is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user