diff --git a/devstack/lib/ovs b/devstack/lib/ovs index 287e3e48dff..6112a71661d 100644 --- a/devstack/lib/ovs +++ b/devstack/lib/ovs @@ -31,6 +31,20 @@ function load_module { fi } +# is_kernel_supported_for_ovs25() - compilation of openvswitch 2.5 kernel module +# supports only kernels up to 4.3.x, function +# determines whether compilation from source +# will succeed on this machine +function is_kernel_supported_for_ovs25 { + major=$(uname -r | cut -d\. -f 1) + minor=$(uname -r | cut -d\. -f 2) + if [ $major -le 4 -a $minor -le 3 ]; then + return 0 + fi + + return 1 +} + # compile_ovs() - Compile OVS from source and load needed modules. # Accepts two parameters: # - first one is True, modules are built and installed. diff --git a/neutron/tests/contrib/gate_hook.sh b/neutron/tests/contrib/gate_hook.sh index f993c63ce47..52e51ecb711 100644 --- a/neutron/tests/contrib/gate_hook.sh +++ b/neutron/tests/contrib/gate_hook.sh @@ -44,14 +44,16 @@ case $VENV in configure_host_for_func_testing - # The OVS_BRANCH variable is used by git checkout. In the case below, - # we use a current (2016-08-19) HEAD commit from branch-2.5 that contains - # a fix for usage of VXLAN tunnels on a single node: - # https://github.com/openvswitch/ovs/commit/741f47cf35df2bfc7811b2cff75c9bb8d05fd26f - OVS_BRANCH=042326c3fcf61e8638fa15926f984ce5ae142f4b - remove_ovs_packages - compile_ovs True /usr /var - start_new_ovs + if is_kernel_supported_for_ovs25; then + # The OVS_BRANCH variable is used by git checkout. In the case below, + # we use a current (2016-08-19) HEAD commit from branch-2.5 that contains + # a fix for usage of VXLAN tunnels on a single node: + # https://github.com/openvswitch/ovs/commit/741f47cf35df2bfc7811b2cff75c9bb8d05fd26f + OVS_BRANCH=042326c3fcf61e8638fa15926f984ce5ae142f4b + remove_ovs_packages + compile_ovs True /usr /var + start_new_ovs + fi load_conf_hook iptables_verify # Make the workspace owned by the stack user