From ee28e381fb46a04be3451de65a5166dd457eede8 Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Mon, 3 Apr 2023 15:19:28 -0500 Subject: [PATCH] Use OVN's OVS submodule for functional tests The OVN tree for several years has had an OVS submodule that pulls in the version of OVS it is guaranteed to work with. There is currently a patch in OVS master that breaks the build of OVN main so switch to using the submodule. Change-Id: I61195cd3ebf8a5015890d3ba3988c3d9795ee817 --- tools/setup-ovs.sh | 27 +++++++++------------------ tox.ini | 5 ++--- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/tools/setup-ovs.sh b/tools/setup-ovs.sh index c0366dc5..7fd10baa 100755 --- a/tools/setup-ovs.sh +++ b/tools/setup-ovs.sh @@ -1,25 +1,16 @@ #!/bin/bash -xe -OVS_BRANCH=${OVS_BRANCH:-master} OVN_BRANCH=${OVN_BRANCH:-main} -function use_new_ovn_repository { - # If OVN_BRANCH > branch-2.12 return 0 - return $(! printf "%s\n%s" $OVN_BRANCH branch-2.12 | sort -C -V) -} - -# We require at least OVS 2.7. Testing infrastructure doesn't support it yet, -# so build it. Eventually, we should run some checks to see what is actually -# installed and see if we can use it instead. -if [ "$OVS_SRCDIR" -a ! -d "$OVS_SRCDIR" ]; then - echo "Building OVS branch $OVS_BRANCH in $OVS_SRCDIR" - mkdir -p $OVS_SRCDIR - git clone https://github.com/openvswitch/ovs.git $OVS_SRCDIR - (cd $OVS_SRCDIR && git checkout $OVS_BRANCH && ./boot.sh && PYTHON=/usr/bin/python ./configure && make -j$(($(nproc) + 1))) -fi -if use_new_ovn_repository && [ "$OVN_SRCDIR" -a ! -d "$OVN_SRCDIR" ]; then +if [ "$OVN_SRCDIR" -a ! -d "$OVN_SRCDIR" ]; then echo "Building OVN branch $OVN_BRANCH in $OVN_SRCDIR" mkdir -p $OVN_SRCDIR - git clone https://github.com/ovn-org/ovn.git $OVN_SRCDIR - (cd $OVN_SRCDIR && git checkout $OVN_BRANCH && ./boot.sh && PYTHON=/usr/bin/python ./configure --with-ovs-source=$OVS_SRCDIR && make -j$(($(nproc) + 1))) + git clone --recurse-submodules https://github.com/ovn-org/ovn.git $OVN_SRCDIR + pushd $OVN_SRCDIR + git checkout $OVN_BRANCH + pushd ovs + ./boot.sh && PYTHON=/usr/bin/python ./configure && make -j$(($(nproc) + 1)) + popd + ./boot.sh && PYTHON=/usr/bin/python ./configure && make -j$(($(nproc) + 1)) + popd fi diff --git a/tox.ini b/tox.ini index 15106a17..91e9909d 100644 --- a/tox.ini +++ b/tox.ini @@ -63,10 +63,9 @@ commands = oslo_debug_helper {posargs} [testenv:functional] setenv = {[testenv]setenv} OS_TEST_PATH=./ovsdbapp/tests/functional - OVS_SRCDIR={envdir}/src/ovs OVN_SRCDIR={envdir}/src/ovn - VTEP_SRCDIR={envdir}/src/ovs/vtep - OVS_BRANCH={env:OVS_BRANCH:} + OVS_SRCDIR={envdir}/src/ovn/ovs + VTEP_SRCDIR={envdir}src/ovn/ovs/vtep OVN_BRANCH={env:OVN_BRANCH:} passenv = KEEP_VENV commands =