Handle the ovs/ovn split

This is the bare minimum to run against ovs/ovn master after the
split. It should be updated to handle running against system-
installed OVN.

Change-Id: I264200ae016e3928fb4aff3bdcc7c1a94f91cae4
This commit is contained in:
Terry Wilson 2019-09-20 13:22:35 -05:00
parent 51f675ac4b
commit 54ee85113a
4 changed files with 15 additions and 4 deletions

View File

@ -24,6 +24,7 @@ class FunctionalTestCase(base.TestCase):
_connections = None
ovsvenv = venv.OvsOvnVenvFixture(tempfile.mkdtemp(),
ovsdir=os.getenv('OVS_SRCDIR'),
ovndir=os.getenv('OVN_SRCDIR'),
remove=not bool(os.getenv('KEEP_VENV')))
atexit.register(ovsvenv.cleanUp)
ovsvenv.setUp()

View File

@ -129,26 +129,29 @@ class OvsVenvFixture(fixtures.Fixture):
class OvsOvnVenvFixture(OvsVenvFixture):
PATH_VAR_TEMPLATE = OvsVenvFixture.PATH_VAR_TEMPLATE + (
":{0}/ovn/controller:{0}/ovn/northd:{0}/ovn/utilities")
def __init__(self, *args, **kwargs):
self.add_chassis = kwargs.pop('add_chassis', False)
self.ovndir = kwargs.pop('ovndir')
self.PATH_VAR_TEMPLATE += (
":{0}/controller:{0}/northd:{0}/utilities".format(
self.ovndir))
super(OvsOvnVenvFixture, self).__init__(*args, **kwargs)
self.env.update({'OVN_RUNDIR': self.venv})
@property
def ovnsb_schema(self):
path = os.path.join(self.ovsdir, 'ovn', 'ovn-sb.ovsschema')
if os.path.isfile(path):
return path
return os.path.join(self.ovsdir, 'ovn-sb.ovsschema')
return os.path.join(self.ovndir, 'ovn-sb.ovsschema')
@property
def ovnnb_schema(self):
path = os.path.join(self.ovsdir, 'ovn', 'ovn-nb.ovsschema')
if os.path.isfile(path):
return path
return os.path.join(self.ovsdir, 'ovn-nb.ovsschema')
return os.path.join(self.ovndir, 'ovn-nb.ovsschema')
@property
def ovnnb_connection(self):

View File

@ -9,3 +9,9 @@ if [ "$OVS_SRCDIR" -a ! -d "$OVS_SRCDIR" ]; then
git clone git://github.com/openvswitch/ovs.git $OVS_SRCDIR
(cd $OVS_SRCDIR && ./boot.sh && PYTHON=/usr/bin/python ./configure && make -j$(($(nproc) + 1)))
fi
if [ "$OVN_SRCDIR" -a ! -d "$OVN_SRCDIR" ]; then
echo "Building OVN in $OVN_SRCDIR"
mkdir -p $OVN_SRCDIR
git clone git://github.com/ovn-org/ovn.git $OVN_SRCDIR
(cd $OVN_SRCDIR && ./boot.sh && PYTHON=/usr/bin/python ./configure --with-ovs-source=$OVS_SRCDIR && make -j$(($(nproc) + 1)))
fi

View File

@ -46,6 +46,7 @@ commands = oslo_debug_helper {posargs}
setenv = {[testenv]setenv}
OS_TEST_PATH=./ovsdbapp/tests/functional
OVS_SRCDIR={envdir}/src/ovs
OVN_SRCDIR={envdir}/src/ovn
passenv = KEEP_VENV
commands =
{toxinidir}/tools/setup-ovs.sh