From b0ea7c95a3e08199a5d72a4dbd6ebf8a54296bdf Mon Sep 17 00:00:00 2001 From: Jakub Libosvar Date: Wed, 30 Nov 2016 09:33:42 -0500 Subject: [PATCH] Don't compile OVS kernel modules for functional job The only reason we need newer openvswitch is following fix [1] for user-space part of openvswitch. This patch fixes our test_install_flood_to_tun tests. Current 2.6 branch has issues with ovsdb where connection with native interface is getting lost and functional job gets stuck. To mitigate that, this patch switches back to OVS 2.5.1 version for functional jobs, compiling only user-space part as OVS 2.5.1 kernel modules are not supported by Xenial. Fullstack job remains running with 2.6 because the job needs OVS kernel patch for local VXLAN tunneling. [1] https://github.com/openvswitch/ovs/commit/56de2148f626d559a199028952fdd13f301ca80a Related-bug: bug/1646107 Change-Id: Ic5419afe7170e759749afd7055441c82c317efe0 --- devstack/lib/ovs | 14 +++++++++----- neutron/tests/contrib/gate_hook.sh | 9 ++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/devstack/lib/ovs b/devstack/lib/ovs index 77c36ec0276..d26fa4debc4 100644 --- a/devstack/lib/ovs +++ b/devstack/lib/ovs @@ -89,7 +89,11 @@ function is_ovs_version_ok { # upgrade_ovs_if_necessary() - Check if OVS version is high enough ( >= 2.5.1) # and upgrade if necessary. +# Accepts one optional parameter for kernel modules compilation: +# - first parameter is True by default and it means OVS will be +# compiled with kernel modules. False won't compile kernel modules. function upgrade_ovs_if_necessary { + local compile_modules=${1:-True} if ! is_ovs_version_ok; then if [ "$NEUTRON_OVERRIDE_OVS_BRANCH" ]; then OVS_BRANCH=$NEUTRON_OVERRIDE_OVS_BRANCH @@ -105,14 +109,14 @@ function upgrade_ovs_if_necessary { fi echo "Compiling OVS branch: $OVS_BRANCH" remove_ovs_packages - compile_ovs True /usr /var + compile_ovs $compile_modules /usr /var start_new_ovs fi } # compile_ovs() - Compile OVS from source and load needed modules. # Accepts two parameters: -# - first one is True, modules are built and installed. +# - first one is True by default and means that modules are built and installed. # - second optional parameter defines prefix for ovs compilation # - third optional parameter defines localstatedir for ovs single machine runtime # Env variables OVS_REPO_NAME, OVS_REPO and OVS_BRANCH must be set @@ -175,10 +179,10 @@ function compile_ovs { sudo make INSTALL_MOD_DIR=kernel/net/openvswitch modules_install sudo modprobe -r vport_geneve sudo modprobe -r openvswitch + load_module openvswitch + load_module vport-geneve False + dmesg | tail fi - load_module openvswitch - load_module vport-geneve False - dmesg | tail cd $_pwd } diff --git a/neutron/tests/contrib/gate_hook.sh b/neutron/tests/contrib/gate_hook.sh index 48e6ccd742d..7727c516a80 100644 --- a/neutron/tests/contrib/gate_hook.sh +++ b/neutron/tests/contrib/gate_hook.sh @@ -44,7 +44,14 @@ case $VENV in configure_host_for_func_testing - upgrade_ovs_if_necessary + # 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 + fi + upgrade_ovs_if_necessary $compile_modules load_conf_hook iptables_verify # Make the workspace owned by the stack user