Merge "functional: Stop compiling OVS from source" into stable/newton

This commit is contained in:
Jenkins 2017-03-11 05:09:51 +00:00 committed by Gerrit Code Review
commit 941ec3f4d1
3 changed files with 27 additions and 7 deletions

View File

@ -13,6 +13,8 @@
# under the License.
import datetime
from distutils import version
import functools
import os
import random
@ -22,6 +24,7 @@ import six
import testtools
import neutron
from neutron.agent.common import ovs_lib
from neutron.common import topics
from neutron import context
from neutron.db import agents_db
@ -220,3 +223,21 @@ def get_not_used_vlan(bridge, vlan_range):
used_vlan_tags = {val['tag'] for val in port_vlans}
available_vlans = vlan_range - used_vlan_tags
return random.choice(list(available_vlans))
def skip_if_ovs_older_than(ovs_version):
"""Decorator for test method to skip if OVS version doesn't meet
minimal requirement.
"""
def skip_if_bad_ovs(f):
@functools.wraps(f)
def check_ovs_and_skip(test):
ovs = ovs_lib.BaseOVS()
current_ovs_version = version.StrictVersion(
ovs.config['ovs_version'])
if current_ovs_version < version.StrictVersion(ovs_version):
test.skip("This test requires OVS version %s or higher." %
ovs_version)
return f(test)
return check_ovs_and_skip
return skip_if_bad_ovs

View File

@ -64,14 +64,11 @@ case $VENV in
configure_host_for_func_testing
# Kernel modules are not needed for functional job. They are needed only
# for fullstack because of bug present in Ubuntu Xenial kernel version
# that makes VXLAN local tunneling fail.
if [[ "$VENV" =~ "dsvm-functional" ]]; then
compile_modules=False
NEUTRON_OVERRIDE_OVS_BRANCH=v2.5.1
# Because of bug present in current Ubuntu Xenial kernel version
# we need a fix for VXLAN local tunneling.
if [[ "$VENV" =~ "dsvm-fullstack" ]]; then
upgrade_ovs_if_necessary
fi
upgrade_ovs_if_necessary $compile_modules
load_conf_hook iptables_verify
# Make the workspace owned by the stack user

View File

@ -32,6 +32,7 @@ from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
from neutron.plugins.ml2.drivers.openvswitch.agent \
import ovs_neutron_agent as ovsagt
from neutron.tests.common import base as common_base
from neutron.tests.common import helpers
from neutron.tests.common import net_helpers
from neutron.tests.functional.agent import test_ovs_lib
from neutron.tests.functional import base
@ -387,6 +388,7 @@ class OVSFlowTestCase(OVSAgentTestBase):
self.assertTrue(("dl_src=%(gateway_mac)s" % kwargs) in
trace["Final flow"])
@helpers.skip_if_ovs_older_than("2.5.1")
def test_install_flood_to_tun(self):
attrs = {
'remote_ip': '192.0.2.1', # RFC 5737 TEST-NET-1