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 =