[ovs-dev] [PATCH ovn 2/4] Build OVN using external OVS directory

Mark Michelson mmichels at redhat.com
Fri Aug 16 17:14:42 UTC 2019


On 8/13/19 12:27 PM, nusiddiq at redhat.com wrote:
> From: Numan Siddique <nusiddiq at redhat.com>
> 
> With this patch we have to configure OVN to refer to external OVS source/build
> directory instead of the ovs subtree.
> 
> The new configuration options added are:
>   * --with-ovs-source=/path/to/ovs/source/dir
>   * --with-ovs-build=/path/to/ovs/build/dir
> 
> Before configuring OVN, user should configure and compile OVS. If the user has
> configured OVS on a different directory than the source dir, then 'with-ovs-build'
> should be specified.
> 
> If ovs-build dir is not defined, then ovs-source is used.
> 
> An upcoming patch will delete the ovs subtree.
> 
> Example usage:
>    $ # Clone OVS repo
>    $cd /home/foo/ovs
>    $./boot.sh
>    $mkdir _gcc
>    $cd _gcc && ../configure && cd ..
>    $make -C _gcc
> 
>    $ # Clone OVN repo
>    $cd /home/foo/ovn
>    $./boot.sh
>    $./configure --with-ovs-source=/home/foo/ovs/ --with-ovs-build=/home/foo/ovs/_gcc
>    $make
> 
> The test files ovn-controller-vtep.at, ovn-nbctl.at and ovn-sbctl.at needed to be modified
> because of this commit [1] in the openvswitch repo.
> 
> This patch also updates the tutorial/ovs-sandbox to use OVS binaries from the OVS build
> folder.
> 
> [1] - https://github.com/openvswitch/ovs/commit/29004db273985088cdb60097bdfd4a6bc6a966d1
> 
> Acked-by: Lucas Alvares Gomes <lucasagomes at gmail.com>
> Signed-off-by: Numan Siddique <nusiddiq at redhat.com>
> Tested-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
> ---
>   .travis/linux-build.sh                  |  17 +-
>   .travis/osx-build.sh                    |  13 +-
>   Documentation/intro/install/general.rst |  31 ++-
>   Makefile.am                             |  24 +-
>   acinclude.m4                            |  35 +++
>   configure.ac                            |  29 +--
>   controller-vtep/automake.mk             |   2 +-
>   include/ovn/version.h.in                |  28 +++
>   lib/ovsdb_automake.mk                   |   7 +-
>   tests/automake.mk                       |   6 +-
>   tests/ofproto-macros.at                 |   4 +-
>   tests/ovn-controller-vtep.at            |  12 +-
>   tests/ovn-nbctl.at                      |   6 +-
>   tests/ovn-sbctl.at                      |  20 +-
>   tests/ovn.at                            | 158 ++++++------
>   tests/ovsdb-macros.at                   |   2 +-
>   tutorial/automake.mk                    |   2 +-
>   tutorial/ovs-sandbox                    | 308 ++++++++++++------------
>   18 files changed, 403 insertions(+), 301 deletions(-)
>   create mode 100644 include/ovn/version.h.in
> 
> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> index a20474345..37a6844ab 100755
> --- a/.travis/linux-build.sh
> +++ b/.travis/linux-build.sh
> @@ -10,7 +10,18 @@ TARGET="x86_64-native-linuxapp-gcc"
>   
>   function configure_ovs()
>   {
> +    git clone https://github.com/openvswitch/ovs.git ovs_src
> +    pushd ovs_src
>       ./boot.sh && ./configure $* || { cat config.log; exit 1; }
> +    make -j4
> +    popd
> +}
> +
> +function configure_ovn()
> +{
> +    configure_ovs $*
> +    ./boot.sh && ./configure --with-ovs-source=$PWD/ovs_src $* || \
> +    { cat config.log; exit 1; }
>   }
>   
>   OPTS="$EXTRA_OPTS $*"
> @@ -28,16 +39,16 @@ fi
>   if [ "$TESTSUITE" ]; then
>       # 'distcheck' will reconfigure with required options.
>       # Now we only need to prepare the Makefile without sparse-wrapped CC.
> -    configure_ovs
> +    configure_ovn
>   
> -    export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
> +    export DISTCHECK_CONFIGURE_FLAGS="$OPTS --with-ovs-source=$PWD/ovs_src"
>       if ! make distcheck -j4 TESTSUITEFLAGS="-j4 -k ovn" RECHECK=yes; then
>           # testsuite.log is necessary for debugging.
>           cat */_build/tests/testsuite.log
>           exit 1
>       fi
>   else
> -    configure_ovs $OPTS
> +    configure_ovn $OPTS
>       make selinux-policy
>   
>       make -j4
> diff --git a/.travis/osx-build.sh b/.travis/osx-build.sh
> index f11d7b9af..1d6ac54af 100755
> --- a/.travis/osx-build.sh
> +++ b/.travis/osx-build.sh
> @@ -7,10 +7,20 @@ EXTRA_OPTS=""
>   
>   function configure_ovs()
>   {
> +    git clone https://github.com/openvswitch/ovs.git ovs_src
> +    pushd ovs_src
>       ./boot.sh && ./configure $*
> +    make -j4
> +    popd
>   }
>   
> -configure_ovs $EXTRA_OPTS $*
> +function configure_ovn()
> +{
> +    configure_ovs $*
> +    ./boot.sh && ./configure $* --with-ovs-source=$PWD/ovs_src
> +}
> +
> +configure_ovn $EXTRA_OPTS $*
>   
>   if [ "$CC" = "clang" ]; then
>       make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
> @@ -18,6 +28,7 @@ else
>       make CFLAGS="$CFLAGS $BUILD_ENV"
>   fi
>   if [ "$TESTSUITE" ] && [ "$CC" != "clang" ]; then
> +    export DISTCHECK_CONFIGURE_FLAGS="$EXTRA_OPTS --with-ovs-source=$PWD/ovs_src"
>       if ! make distcheck RECHECK=yes; then
>           # testsuite.log is necessary for debugging.
>           cat */_build/tests/testsuite.log
> diff --git a/Documentation/intro/install/general.rst b/Documentation/intro/install/general.rst
> index 4cc9c4c3a..c19b717b2 100644
> --- a/Documentation/intro/install/general.rst
> +++ b/Documentation/intro/install/general.rst
> @@ -42,9 +42,8 @@ out.  This is the right branch for general development.
>   
>   As of now there are no official OVN releases.
>   
> -Although building OVN, also builds OVS, it is recommended to clone
> -and build OVS from its own repo. Please see the Open vSwitch
> -documentation to build and install OVS.
> +Before building OVN you should configure and build OVS.

It would be user-friendly to provide the OVS repo here.

> +Please see the Open vSwitch documentation to build and install OVS.
>   
>   .. _general-build-reqs:
>   
> @@ -143,18 +142,25 @@ the "configure" script::
>   
>       $ ./boot.sh
>   
> +Before configuring OVN, clone, configure and build Open vSwitch.
> +
>   .. _general-configuring:
>   
>   Configuring
>   -----------
>   
> -Configure the package by running the configure script. You can usually
> -invoke configure without any arguments. For example::
> +Configure the package by running the configure script. You need to
> +invoke configure with atleast the argument --with-ovs-source.
> +For example::
> +
> +    $ ./configure --with-ovs-source=/path/to/ovs/source
>   
> -    $ ./configure
> +If you have built Open vSwitch in a separate directory, then you
> +need to provide that path in the option - --with-ovs-build.
>   
>   By default all files are installed under ``/usr/local``. OVN expects to find
>   its database in ``/usr/local/etc/ovn`` by default.
> +
>   If you want to install all files into, e.g., ``/usr`` and ``/var`` instead of
>   ``/usr/local`` and ``/usr/local/var`` and expect to use ``/etc/ovn`` as
>   the default database directory, add options as shown here::
> @@ -272,6 +278,19 @@ you wish to link with jemalloc add it to LIBS::
>   
>       $ ./configure LIBS=-ljemalloc
>   
> +Example usage::
> +    $ # Clone OVS repo
> +    $cd /home/foo/ovs
> +    $./boot.sh
> +    $mkdir _gcc
> +    $cd _gcc && ../configure && cd ..
> +    $make -C _gcc
> +
> +    $ # Clone OVN repo
> +    $cd /home/foo/ovn
> +    $./boot.sh
> +    $./configure --with-ovs-source=/home/foo/ovs/ --with-ovs-build=/home/foo/ovs/_gcc
> +
>   .. _general-building:
>   
>   Building
> diff --git a/Makefile.am b/Makefile.am
> index 6447e348b..d2dae3948 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -7,7 +7,7 @@
>   
>   AUTOMAKE_OPTIONS = foreign subdir-objects
>   ACLOCAL_AMFLAGS = -I m4
> -SUBDIRS = ovs
> +#SUBDIRS = ovs
>   
>   OVS_SRCDIR=@ovs_srcdir@
>   OVS_BUILDDIR=@ovs_builddir@
> @@ -22,9 +22,9 @@ AM_LDFLAGS += $(OVS_LDFLAGS)
>   AM_CPPFLAGS += -I $(top_srcdir)/include
>   
>   if WIN32
> -AM_CPPFLAGS += -I $(top_srcdir)/ovs/include
> -AM_CPPFLAGS += -I $(top_srcdir)/ovs/lib
> -AM_CPPFLAGS += -I $(top_srcdir)/ovs
> +AM_CPPFLAGS += -I $(OVS_SRCDIR)/include
> +AM_CPPFLAGS += -I $(OVS_SRCDIR)/lib
> +AM_CPPFLAGS += -I $(OVS_SRCDIR)
>   AM_CPPFLAGS += -I $(top_srcdir)/lib
>   AM_CPPFLAGS += $(PTHREAD_INCLUDES)
>   AM_CPPFLAGS += $(MSVC_CFLAGS)
> @@ -33,6 +33,10 @@ AM_LDFLAGS += $(MSVC64_LDFLAGS)
>   PLATFORM = $(MSVC_PLATFORM)
>   endif
>   
> +AM_CPPFLAGS += -I $(top_srcdir)/include
> +AM_CPPFLAGS += -I $(top_srcdir)/ovn
> +AM_CPPFLAGS += -I $(top_builddir)/include
> +
>   AM_CPPFLAGS += -I $(OVS_SRCDIR)/include
>   AM_CPPFLAGS += -I $(OVS_BUILDDIR)/include
>   AM_CPPFLAGS += -I $(OVS_SRCDIR)/lib
> @@ -113,8 +117,7 @@ EXTRA_DIST = \
>   	ovn-nb.ovsschema \
>   	ovn-nb.xml \
>   	ovn-sb.ovsschema \
> -	ovn-sb.xml \
> -	ovs/
> +	ovn-sb.xml
>   bin_PROGRAMS =
>   sbin_PROGRAMS =
>   bin_SCRIPTS =
> @@ -222,13 +225,6 @@ CLEAN_LOCAL += clean-pycov
>   ALL_LOCAL += dist-hook-git
>   dist-hook-git: distfiles
>   	@if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
> -	  (cd ovs && $(MAKE) distfiles); \
> -	  (cat distfiles; sed 's|^|ovs/|' ovs/distfiles) | \
> -	    LC_ALL=C sort -u > ovs-distfiles; \
> -	  (cd ovs/datapath && $(MAKE) distfiles); \
> -	  (cat distfiles; sed 's|^|ovs/datapath/|' ovs/datapath/distfiles) | \
> -	    LC_ALL=C sort -u > datapath-distfiles; \
> -		LC_ALL=C sort -u ovs-distfiles datapath-distfiles > all-distfiles; \
>   	  (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \
>   	    grep -v '\.gitattributes$$' | \
>   	    LC_ALL=C sort -u > all-gitfiles; \
> @@ -244,7 +240,7 @@ dist-hook-git: distfiles
>   	    exit 1; \
>   	  fi \
>   	fi
> -CLEANFILES += ovs-distfiles datapath-distfiles all-distfiles all-gitfiles missing-distfiles
> +CLEANFILES += all-distfiles all-gitfiles missing-distfiles
>   # The following is based on commands for the Automake "distdir" target.
>   distfiles: Makefile
>   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
> diff --git a/acinclude.m4 b/acinclude.m4
> index 7604c92b8..b0211ed35 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -1206,3 +1206,38 @@ AC_DEFUN([OVS_CHECK_LINUX_HOST],
>           [ovs_cv_linux=true],
>           [ovs_cv_linux=false])])
>      AM_CONDITIONAL([LINUX], [$ovs_cv_linux])])
> +
> +dnl OVN_CHECK_OVS
> +dnl
> +dnl Check for OVS sources
> +AC_DEFUN([OVN_CHECK_OVS], [
> +  AC_ARG_WITH([ovs-source],
> +              [AC_HELP_STRING([--ovs-source=/path/to/ovs/src/dir],
> +                              [Specify the OVS src directory])])
> +  AC_ARG_WITH([ovs-build],
> +              [AC_HELP_STRING([--ovs-build=/path/to/ovs/build/dir],
> +                              [Specify the OVS build directory])])
> +
> +  AC_MSG_CHECKING([for OVS source directory])
> +  if test X"$with_ovs_source" != X; then
> +    OVSDIR=$with_ovs_source
> +  else
> +    AC_ERROR([OVS source dir path needs to be specified])
> +  fi
> +
> +  OVSDIR=`eval echo "$OVSDIR"`
> +  AC_MSG_RESULT([$OVSDIR])
> +  AC_SUBST(OVSDIR)
> +
> +  AC_MSG_CHECKING([for OVS build directory])
> +  if test X"$with_ovs_build" != X; then
> +    OVSBUILDDIR=$with_ovs_build
> +  else
> +    # If separate build dir is not specified, use src dir.
> +    OVSBUILDDIR=$OVSDIR
> +  fi
> +
> +  OVSBUILDDIR=`eval echo "$OVSBUILDDIR"`
> +  AC_MSG_RESULT([$OVSBUILDDIR])
> +  AC_SUBST(OVSBUILDDIR)
> +])
> diff --git a/configure.ac b/configure.ac
> index c74b17a1d..4ba092f51 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -20,7 +20,7 @@ AC_CONFIG_HEADERS([config.h])
>   AC_CONFIG_TESTDIR([tests])
>   AM_INIT_AUTOMAKE([tar-pax])
>   
> -AC_CONFIG_SUBDIRS([ovs])
> +#AC_CONFIG_SUBDIRS([ovs])
>   
>   AC_PROG_CC_C99
>   AM_PROG_CC_C_O
> @@ -64,23 +64,17 @@ m4_pattern_forbid([LT_INIT]) dnl Make autoconf fail if libtool is missing.
>   #    the new version. This is the case when symbols have been modified or
>   #    deleted. Bump current, set revision and age to 0.
>   
> -m4_define([libopenvswitch_lt_current],    [0])
> -m4_define([libopenvswitch_lt_revision],   [0])
> -m4_define([libopenvswitch_lt_age],        [0])
> +m4_define([libovn_lt_current],    [0])
> +m4_define([libovn_lt_revision],   [0])
> +m4_define([libovn_lt_age],        [0])
>   
> -LT_CURRENT=libopenvswitch_lt_current
> +LT_CURRENT=libovn_lt_current
>   AC_SUBST([LT_CURRENT])
> -LT_REVISION=libopenvswitch_lt_revision
> +LT_REVISION=libovn_lt_revision
>   AC_SUBST([LT_REVISION])
> -LT_AGE=libopenvswitch_lt_age
> +LT_AGE=libovn_lt_age
>   AC_SUBST([LT_AGE])
>   
> -AC_SUBST([ovs_srcdir], ['${top_srcdir}/ovs'])
> -AC_SUBST([ovs_builddir], ['${top_builddir}/ovs'])
> -AC_SUBST([ovs_libdir], ['${top_builddir}/ovs/lib'])
> -AC_SUBST([ovsdb_libdir], ['${top_builddir}/ovs/ovsdb'])
> -AC_SUBST([ovs_mandir], ['${top_srcdir}/ovs/'])
> -
>   AC_SEARCH_LIBS([pow], [m])
>   AC_SEARCH_LIBS([clock_gettime], [rt])
>   AC_SEARCH_LIBS([timer_create], [rt])
> @@ -188,12 +182,19 @@ OVS_CHECK_LINUX
>   OVS_CHECK_LINUX_TC
>   OVS_CHECK_DPDK
>   OVS_CHECK_PRAGMA_MESSAGE
> +OVN_CHECK_OVS
>   AC_SUBST([OVS_CFLAGS])
>   AC_SUBST([OVS_LDFLAGS])
>   
> +AC_SUBST([ovs_srcdir], ['${OVSDIR}'])
> +AC_SUBST([ovs_builddir], ['${OVSBUILDDIR}'])
> +AC_SUBST([ovs_libdir], ['${OVSBUILDDIR}/lib'])
> +AC_SUBST([ovsdb_libdir], ['${OVSBUILDDIR}/ovsdb'])
> +AC_SUBST([ovs_mandir], ['${OVSDIR}'])
> +
>   AC_CONFIG_FILES(Makefile)
>   AC_CONFIG_FILES(tests/atlocal)
> -AC_CONFIG_FILES(ovs/include/openvswitch/version.h)
> +AC_CONFIG_FILES(include/ovn/version.h)
>   
>   dnl This makes sure that include/openflow gets created in the build directory.
>   AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
> diff --git a/controller-vtep/automake.mk b/controller-vtep/automake.mk
> index a6810969f..a5779eba6 100644
> --- a/controller-vtep/automake.mk
> +++ b/controller-vtep/automake.mk
> @@ -8,7 +8,7 @@ controller_vtep_ovn_controller_vtep_SOURCES = \
>   	controller-vtep/ovn-controller-vtep.h \
>   	controller-vtep/vtep.c \
>   	controller-vtep/vtep.h
> -controller_vtep_ovn_controller_vtep_LDADD = lib/libovn.la $(OVS_LIBDIR)/libopenvswitch.la ovs/vtep/libvtep.la
> +controller_vtep_ovn_controller_vtep_LDADD = lib/libovn.la $(OVS_LIBDIR)/libopenvswitch.la $(OVSBUILDDIR)/vtep/libvtep.la
>   man_MANS += controller-vtep/ovn-controller-vtep.8
>   EXTRA_DIST += controller-vtep/ovn-controller-vtep.8.xml
>   CLEANFILES += controller-vtep/ovn-controller-vtep.8
> diff --git a/include/ovn/version.h.in b/include/ovn/version.h.in
> new file mode 100644
> index 000000000..e27415ba1
> --- /dev/null
> +++ b/include/ovn/version.h.in
> @@ -0,0 +1,28 @@
> +/*
> + * Copyright (c) 2014 Nicira, Inc.
> + * Copyright (c) 2014 Cisco Systems, Inc.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at:
> + *
> + *     http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +
> +#ifndef OVN_VERSION_H
> +#define OVN_VERSION_H 1
> +
> +#define OVN_PACKAGE_STRING  "@PACKAGE_STRING@"
> +#define OVN_PACKAGE_VERSION "@PACKAGE_VERSION@"
> +
> +#define OVN_LIB_VERSION     @LT_CURRENT@
> +#define OVN_LIB_REVISION    @LT_REVISION@
> +#define OVN_LIB_AGE         @LT_AGE@
> +
> +#endif /* ovn/version.h */
> diff --git a/lib/ovsdb_automake.mk b/lib/ovsdb_automake.mk
> index f6fd5e8b3..32f22b672 100644
> --- a/lib/ovsdb_automake.mk
> +++ b/lib/ovsdb_automake.mk
> @@ -1,10 +1,6 @@
>   # ovsdb-idlc
> -noinst_SCRIPTS += ovs/ovsdb/ovsdb-idlc
> -EXTRA_DIST += ovs/ovsdb/ovsdb-idlc.in
> -MAN_ROOTS += ovs/ovsdb/ovsdb-idlc.1
> -CLEANFILES += ovs/ovsdb/ovsdb-idlc
>   SUFFIXES += .ovsidl .ovsschema
> -OVSDB_IDLC = $(run_python) $(srcdir)/ovs/ovsdb/ovsdb-idlc.in
> +OVSDB_IDLC = $(run_python) ${OVSDIR}/ovsdb/ovsdb-idlc.in
>   .ovsidl.c:
>   	$(AM_V_GEN)$(OVSDB_IDLC) c-idl-source $< > $@.tmp && mv $@.tmp $@
>   .ovsidl.h:
> @@ -21,5 +17,4 @@ CLEANFILES += $(OVSIDL_BUILT)
>   # However, current versions of Automake seem to output all variable
>   # assignments before any targets, so it doesn't seem to be a problem,
>   # at least for now.
> -$(OVSIDL_BUILT): ovs/ovsdb/ovsdb-idlc.in
>   
> diff --git a/tests/automake.mk b/tests/automake.mk
> index 5411772a4..1fabb5350 100644
> --- a/tests/automake.mk
> +++ b/tests/automake.mk
> @@ -51,10 +51,10 @@ SYSTEM_KMOD_TESTSUITE = $(srcdir)/tests/system-kmod-testsuite
>   SYSTEM_USERSPACE_TESTSUITE = $(srcdir)/tests/system-userspace-testsuite
>   DISTCLEANFILES += tests/atconfig tests/atlocal
>   
> -AUTOTEST_PATH = ovs/utilities:ovs/vswitchd:ovs/ovsdb:ovs/vtep:tests:$(PTHREAD_WIN32_DIR_DLL):$(SSL_DIR):controller-vtep:northd:utilities:controller
> +AUTOTEST_PATH = $(ovs_builddir)/utilities:$(ovs_builddir)/vswitchd:$(ovs_builddir)/ovsdb:$(ovs_builddir)/vtep:tests:$(PTHREAD_WIN32_DIR_DLL):$(SSL_DIR):controller-vtep:northd:utilities:controller
>   
>   check-local:
> -	set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH); \
> +	set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) ovs_srcdir=$(ovs_srcdir); \
>   	"$$@" $(TESTSUITEFLAGS) || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
>   
>   # Python Coverage support.
> @@ -230,7 +230,7 @@ tests/testpki-req2.pem: tests/pki/stamp
>   tests/testpki-privkey2.pem: tests/pki/stamp
>   	$(AM_V_GEN)cp tests/pki/test2-privkey.pem $@
>   
> -OVS_PKI = $(SHELL) $(srcdir)/ovs/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
> +OVS_PKI = $(SHELL) $(ovs_srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
>   tests/pki/stamp:
>   	$(AM_V_at)rm -f tests/pki/stamp
>   	$(AM_V_at)rm -rf tests/pki
> diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
> index 4d4683775..536da8dd7 100644
> --- a/tests/ofproto-macros.at
> +++ b/tests/ofproto-macros.at
> @@ -91,7 +91,7 @@ sim_add () {
>   
>      # Create database and start ovsdb-server.
>      : > "$d"/.conf.db.~lock~
> -   as $1 ovsdb-tool create "$d"/conf.db "$abs_top_srcdir"/ovs/vswitchd/vswitch.ovsschema || return 1
> +   as $1 ovsdb-tool create "$d"/conf.db "$ovs_srcdir"/vswitchd/vswitch.ovsschema || return 1
>      as $1 start_daemon ovsdb-server --remote=punix:"$d"/db.sock || return 1
>   
>      # Initialize database.
> @@ -322,7 +322,7 @@ m4_define([TESTABLE_LOG], [-vPATTERN:ANY:'%c|%p|%m'])
>   m4_define([_OVS_VSWITCHD_START],
>     [dnl Create database.
>      touch .conf.db.~lock~
> -   AT_CHECK([ovsdb-tool create conf.db $abs_top_srcdir/ovs/vswitchd/vswitch.ovsschema])
> +   AT_CHECK([ovsdb-tool create conf.db $ovs_srcdir/vswitchd/vswitch.ovsschema])
>   
>      dnl Start ovsdb-server.
>      AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock], [0], [], [stderr])
> diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
> index 187235138..e8c731fca 100644
> --- a/tests/ovn-controller-vtep.at
> +++ b/tests/ovn-controller-vtep.at
> @@ -18,11 +18,11 @@ m4_define([OVN_CONTROLLER_VTEP_START],
>      AT_SKIP_IF([test $HAVE_PYTHON = no])
>   
>      dnl Create databases (ovn-nb, ovn-sb, vtep).
> -   AT_CHECK([ovsdb-tool create vswitchd.db $abs_top_srcdir/ovs/vswitchd/vswitch.ovsschema])
> +   AT_CHECK([ovsdb-tool create vswitchd.db $ovs_srcdir/vswitchd/vswitch.ovsschema])
>      for daemon in ovn-nb ovn-sb; do
>         AT_CHECK([ovsdb-tool create $daemon.db $abs_top_srcdir/${daemon}.ovsschema])
>      done
> -   AT_CHECK([ovsdb-tool create vtep.db $abs_top_srcdir/ovs/vtep/vtep.ovsschema])
> +   AT_CHECK([ovsdb-tool create vtep.db $ovs_srcdir/vtep/vtep.ovsschema])
>   
>      dnl Start ovsdb-server.
>      AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock vswitchd.db vtep.db], [0], [], [stderr])
> @@ -137,28 +137,28 @@ AT_CHECK([ovn-sbctl --columns=ip list Encap | cut -d ':' -f2 | tr -d ' '], [0],
>   AT_CHECK([vtep-ctl add-ls lswitch0 -- bind-ls br-vtep p0 100 lswitch0 -- bind-ls br-vtep p0 200 lswitch0 -- bind-ls br-vtep p1 300 lswitch0])
>   OVS_WAIT_UNTIL([test -n "`ovn-sbctl list Chassis | grep -- lswitch0`"])
>   AT_CHECK([ovn-sbctl --columns=vtep_logical_switches list Chassis | cut -d ':' -f2 | tr -d ' ' ], [0], [dnl
> -[["lswitch0"]]
> +[[lswitch0]]
>   ])
>   
>   # adds another logical switch and new vlan_bindings.
>   AT_CHECK([vtep-ctl add-ls lswitch1 -- bind-ls br-vtep p0 300 lswitch1])
>   OVS_WAIT_UNTIL([test -n "`ovn-sbctl list Chassis | grep -- lswitch1`"])
>   AT_CHECK([ovn-sbctl --columns=vtep_logical_switches list Chassis | cut -d ':' -f2 | tr -d ' '], [0], [dnl
> -[["lswitch0","lswitch1"]]
> +[[lswitch0,lswitch1]]
>   ])
>   
>   # unbinds one port from lswitch0, nothing should change.
>   AT_CHECK([vtep-ctl unbind-ls br-vtep p0 200])
>   OVS_WAIT_UNTIL([test -z "`vtep-ctl --columns=vlan_bindings list physical_port p0 | grep -- '200='`"])
>   AT_CHECK([ovn-sbctl --columns=vtep_logical_switches list Chassis | cut -d ':' -f2 | tr -d ' ' ], [0], [dnl
> -[["lswitch0","lswitch1"]]
> +[[lswitch0,lswitch1]]
>   ])
>   
>   # unbinds all ports from lswitch0.
>   AT_CHECK([vtep-ctl unbind-ls br-vtep p0 100 -- unbind-ls br-vtep p1 300])
>   OVS_WAIT_UNTIL([test -z "`ovn-sbctl list Chassis | grep -- br-vtep_lswitch0`"])
>   AT_CHECK([ovn-sbctl --columns=vtep_logical_switches list Chassis | cut -d ':' -f2 | tr -d ' ' ], [0], [dnl
> -[["lswitch1"]]
> +[[lswitch1]]
>   ])
>   
>   # unbinds all ports from lswitch1.
> diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
> index cf06966ed..a46174c72 100644
> --- a/tests/ovn-nbctl.at
> +++ b/tests/ovn-nbctl.at
> @@ -1594,7 +1594,7 @@ OVN_NBCTL_TEST([ovn_nbctl_port_groups], [port groups], [
>   dnl Check that port group can be looked up by name
>   AT_CHECK([ovn-nbctl create Port_Group name=pg0], [0], [ignore])
>   AT_CHECK([ovn-nbctl get Port_Group pg0 name], [0], [dnl
> -"pg0"
> +pg0
>   ])])
>   
>   OVN_NBCTL_TEST([ovn_nbctl_extra_newlines], [extra newlines], [
> @@ -1603,10 +1603,10 @@ dnl daemon mode. All we have to do is ensure that each time we list database
>   dnl information, there is not an extra newline at the beginning of the output.
>   AT_CHECK([ovn-nbctl ls-add sw1], [0], [ignore])
>   AT_CHECK([ovn-nbctl --columns=name list logical_switch sw1], [0], [dnl
> -name                : "sw1"
> +name                : sw1
>   ])
>   AT_CHECK([ovn-nbctl --columns=name list logical_switch sw1], [0], [dnl
> -name                : "sw1"
> +name                : sw1
>   ])])
>   
>   OVN_NBCTL_TEST([ovn_nbctl_table_formatting], [table formatting], [
> diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
> index a679f40a8..c25d4d372 100644
> --- a/tests/ovn-sbctl.at
> +++ b/tests/ovn-sbctl.at
> @@ -79,11 +79,11 @@ AT_CHECK([ovn-nbctl --wait=sb sync])
>   AT_CHECK([ovn-sbctl lsp-bind vif0 ch0])
>   
>   AT_CHECK([ovn-sbctl show], [0], [dnl
> -Chassis "ch0"
> +Chassis ch0
>       Encap stt
>           ip: "1.2.3.5"
>           options: {csum="true"}
> -    Port_Binding "vif0"
> +    Port_Binding vif0
>   ])
>   
>   # adds another 'vif1'
> @@ -92,12 +92,12 @@ AT_CHECK([ovn-nbctl lsp-set-addresses vif1 f0:ab:cd:ef:01:03])
>   AT_CHECK([ovn-sbctl lsp-bind vif1 ch0])
>   
>   AT_CHECK([ovn-sbctl show | sed 's/vif[[0-9]]/vif/'], [0], [dnl
> -Chassis "ch0"
> +Chassis ch0
>       Encap stt
>           ip: "1.2.3.5"
>           options: {csum="true"}
> -    Port_Binding "vif"
> -    Port_Binding "vif"
> +    Port_Binding vif
> +    Port_Binding vif
>   ])
>   
>   # deletes 'vif1'
> @@ -105,16 +105,16 @@ AT_CHECK([ovn-nbctl lsp-del vif1])
>   AT_CHECK([ovn-nbctl --wait=sb sync])
>   
>   AT_CHECK([ovn-sbctl show], [0], [dnl
> -Chassis "ch0"
> +Chassis ch0
>       Encap stt
>           ip: "1.2.3.5"
>           options: {csum="true"}
> -    Port_Binding "vif0"
> +    Port_Binding vif0
>   ])
>   
>   uuid=$(ovn-sbctl --columns=_uuid list Chassis ch0 | cut -d ':' -f2 | tr -d ' ')
>   AT_CHECK_UNQUOTED([ovn-sbctl --columns=logical_port,mac,chassis list Port_Binding], [0], [dnl
> -logical_port        : "vif0"
> +logical_port        : vif0
>   mac                 : [["f0:ab:cd:ef:01:02"]]
>   chassis             : ${uuid}
>   ])
> @@ -126,10 +126,10 @@ AT_CHECK([ovn-nbctl lsp-set-options vtep0 vtep_physical_switch=p0 vtep_logical_s
>   
>   AT_CHECK([ovn-sbctl --timeout=10 wait-until Port_Binding vtep0 options!={}])
>   AT_CHECK([ovn-sbctl --columns=logical_port,mac,type,options list Port_Binding vtep0], [0], [dnl
> -logical_port        : "vtep0"
> +logical_port        : vtep0
>   mac                 : [[]]
>   type                : vtep
> -options             : {vtep_logical_switch="l0", vtep_physical_switch="p0"}
> +options             : {vtep_logical_switch=l0, vtep_physical_switch=p0}
>   ])
>   
>   OVN_SBCTL_TEST_STOP
> diff --git a/tests/ovn.at b/tests/ovn.at
> index 71eb39079..a54a8ca59 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -18,7 +18,7 @@ m4_divert_text([PREPARE_TESTS],
>        exp_text=$2
>        exp_n=`wc -l < "$exp_text"`
>        OVS_WAIT_UNTIL(
> -       [$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" $rcv_pcap > $rcv_text
> +       [$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $rcv_pcap > $rcv_text
>           rcv_n=`wc -l < "$rcv_text"`
>           echo "rcv_n=$rcv_n exp_n=$exp_n"
>           test $rcv_n -ge $exp_n])
> @@ -4607,7 +4607,7 @@ test_dhcp 1 f00000000001 01 $ciaddr $offer_ip $request_ip 0 ff1000000001 $server
>   # NXT_RESUMEs should be 1.
>   OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
>   cat 1.expected | cut -c -48 > expout
>   AT_CHECK([cat 1.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -4633,7 +4633,7 @@ test_dhcp 2 f00000000002 03 $ciaddr $offer_ip $request_ip 0 ff1000000001 $server
>   # NXT_RESUMEs should be 2.
>   OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -4657,7 +4657,7 @@ test_dhcp 2 f00000000002 03 $ciaddr $offer_ip $request_ip 0 ff1000000001 $server
>   # NXT_RESUMEs should be 3.
>   OVS_WAIT_UNTIL([test 3 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -4720,7 +4720,7 @@ test_dhcp 2 f00000000002 03 $ciaddr $offer_ip $request_ip 1 $src_ip $dst_ip ff10
>   # NXT_RESUMEs should be 5.
>   OVS_WAIT_UNTIL([test 5 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -4746,7 +4746,7 @@ test_dhcp 2 f00000000002 03 $ciaddr $offer_ip $request_ip 1 $src_ip $dst_ip ff10
>   # NXT_RESUMEs should be 6.
>   OVS_WAIT_UNTIL([test 6 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -4772,7 +4772,7 @@ test_dhcp 2 f00000000002 03 $ciaddr $offer_ip $request_ip 1 $src_ip $dst_ip ff10
>   # NXT_RESUMEs should be 7.
>   OVS_WAIT_UNTIL([test 7 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -4798,7 +4798,7 @@ test_dhcp 2 f00000000002 03 $ciaddr $offer_ip $request_ip 1 $src_ip $dst_ip ff10
>   # NXT_RESUMEs should be 8.
>   OVS_WAIT_UNTIL([test 8 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -5005,7 +5005,7 @@ test_dhcpv6 1 $src_mac $src_lla 01 $offer_ip
>   # NXT_RESUMEs should be 1.
>   OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap | trim_zeros > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap | trim_zeros > 1.packets
>   # cat 1.expected | trim_zeros > expout
>   cat 1.expected | cut -c -120 > expout
>   AT_CHECK([cat 1.packets | cut -c -120], [0], [expout])
> @@ -5035,11 +5035,11 @@ OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
>   # vif2-tx.pcap should not have received the DHCPv6 reply packet
>   rm 2.packets
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap | trim_zeros > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap | trim_zeros > 2.packets
>   AT_CHECK([cat 2.packets], [0], [])
>   
>   # vif1-tx.pcap should have received the DHCPv6 (invalid) request packet
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap | trim_zeros > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap | trim_zeros > 1.packets
>   cat 1.expected > expout
>   AT_CHECK([cat 1.packets], [0], [expout])
>   
> @@ -5055,11 +5055,11 @@ test_dhcpv6 3 $src_mac $src_lla 01 0 4
>   OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
>   # vif3-tx.pcap should not have received the DHCPv6 reply packet
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif3-tx.pcap | trim_zeros > 3.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif3-tx.pcap | trim_zeros > 3.packets
>   AT_CHECK([cat 3.packets], [0], [])
>   
>   # vif4-tx.pcap should have received the DHCPv6 request packet
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif4-tx.pcap | trim_zeros > 4.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif4-tx.pcap | trim_zeros > 4.packets
>   cat 4.expected > expout
>   AT_CHECK([cat 4.packets], [0], [expout])
>   
> @@ -5073,7 +5073,7 @@ test_dhcpv6 5 $src_mac $src_lla 01 1 5
>   # NXT_RESUMEs should be 3.
>   OVS_WAIT_UNTIL([test 3 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif5-tx.pcap | trim_zeros > 5.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif5-tx.pcap | trim_zeros > 5.packets
>   # Skipping the UDP checksum
>   cat 5.expected | cut -c 1-120,125- > expout
>   AT_CHECK([cat 5.packets | cut -c 1-120,125- ], [0], [expout])
> @@ -5089,7 +5089,7 @@ test_dhcpv6 5 $src_mac $src_lla 0b 1 5
>   # NXT_RESUMEs should be 4.
>   OVS_WAIT_UNTIL([test 4 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif5-tx.pcap |
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif5-tx.pcap |
>   trim_zeros > 5.packets
>   # Skipping the UDP checksum
>   cat 5.expected | cut -c 1-120,125- > expout
> @@ -5533,7 +5533,7 @@ AT_CHECK([ovs-ofctl dump-flows br-int | \
>   ])
>   
>   # Expected to drop the packet.
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" pbr-hv/vif2-tx.pcap > vif2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" pbr-hv/vif2-tx.pcap > vif2.packets
>   rcvd_packet=`cat vif2.packets`
>   AT_FAIL_IF([rcvd_packet = ""])
>   
> @@ -5719,7 +5719,7 @@ AT_CHECK([ovs-ofctl dump-flows br-int | \
>   ])
>   
>   # Expected to drop the packet.
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" pbr-hv/vif2-tx.pcap > vif2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" pbr-hv/vif2-tx.pcap > vif2.packets
>   rcvd_packet=`cat vif2.packets`
>   AT_FAIL_IF([rcvd_packet = ""])
>   
> @@ -6506,7 +6506,7 @@ src_ip=`ip_to_hex 192 168 1 2`
>   dst_ip=`ip_to_hex 192 168 1 3`
>   expected=${dst_mac}${src_mac}08004500001c0000000040110000${src_ip}${dst_ip}0035111100080000
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > received1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > received1.packets
>   echo $expected > expout
>   AT_CHECK([cat received1.packets], [0], [expout])
>   
> @@ -6517,7 +6517,7 @@ src_ip=`ip_to_hex 192 168 1 2`
>   dst_ip=`ip_to_hex 192 168 2 2`
>   expected=${dst_mac}${src_mac}08004500001c000000003f110100${src_ip}${dst_ip}0035111100080000
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif3-tx.pcap > received2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif3-tx.pcap > received2.packets
>   echo $expected > expout
>   AT_CHECK([cat received2.packets], [0], [expout])
>   
> @@ -6720,7 +6720,7 @@ trim_zeros() {
>   # ARP packet should be received with Target IP Address set to 192.168.1.254 and
>   # not 8.8.8.8
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ls2lp2-tx.pcap | trim_zeros > packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ls2lp2-tx.pcap | trim_zeros > packets
>   expected="fffffffffffff0000000000208060001080006040001f00000000002c0a80101000000000000c0a801fe"
>   echo $expected > expout
>   AT_CHECK([cat packets], [0], [expout])
> @@ -6771,7 +6771,7 @@ OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 50])
>   trim_zeros() {
>       sed 's/\(00\)\{1,\}$//'
>   }
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets
>   expected="fffffffffffff0000000000108060001080006040001f00000000001c0a80001000000000000c0a80001"
>   echo $expected > expout
>   expected="fffffffffffff0000000000108060001080006040001f00000000001c0a80002000000000000c0a80002"
> @@ -6836,7 +6836,7 @@ OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 50])
>   trim_zeros() {
>       sed 's/\(00\)\{1,\}$//'
>   }
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets
>   expected="fffffffffffff0000000000108060001080006040001f00000000001c0a80001000000000000c0a80001"
>   echo $expected > expout
>   expected="fffffffffffff0000000000108060001080006040001f00000000001c0a80002000000000000c0a80002"
> @@ -8245,7 +8245,7 @@ test_dns 1 f00000000001 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data $d
>   # NXT_RESUMEs should be 1.
>   OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
>   cat 1.expected | cut -c -48 > expout
>   AT_CHECK([cat 1.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -8266,7 +8266,7 @@ test_dns 2 f00000000002 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data $d
>   # NXT_RESUMEs should be 2.
>   OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -8290,7 +8290,7 @@ test_dns 1 f00000000001 f00000000002 $src_ip $dst_ip $dns_reply $dns_req_data
>   # NXT_RESUMEs should be 3.
>   OVS_WAIT_UNTIL([test 3 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
>   AT_CHECK([cat 1.packets], [0], [])
>   
>   reset_pcap_file hv1-vif1 hv1/vif1
> @@ -8312,7 +8312,7 @@ test_dns 2 f00000000002 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data
>   # NXT_RESUMEs should be 3 only.
>   OVS_WAIT_UNTIL([test 3 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   AT_CHECK([cat 2.packets], [0], [])
>   
>   reset_pcap_file hv1-vif1 hv1/vif1
> @@ -8333,7 +8333,7 @@ test_dns 2 f00000000002 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data $d
>   # NXT_RESUMEs should be 4.
>   OVS_WAIT_UNTIL([test 4 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -8355,7 +8355,7 @@ test_dns 2 f00000000002 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data $d
>   # NXT_RESUMEs should be 5.
>   OVS_WAIT_UNTIL([test 5 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   cat 2.expected | cut -c -48 > expout
>   AT_CHECK([cat 2.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -8377,7 +8377,7 @@ test_dns 2 f00000000002 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data
>   # NXT_RESUMEs should be 6.
>   OVS_WAIT_UNTIL([test 6 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   AT_CHECK([cat 2.packets], [0], [])
>   
>   reset_pcap_file hv1-vif1 hv1/vif1
> @@ -8395,7 +8395,7 @@ test_dns 2 f00000000002 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data
>   # NXT_RESUMEs should be 7.
>   OVS_WAIT_UNTIL([test 7 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   AT_CHECK([cat 2.packets], [0], [])
>   
>   reset_pcap_file hv1-vif1 hv1/vif1
> @@ -8415,7 +8415,7 @@ test_dns 1 f00000000001 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data $d
>   # NXT_RESUMEs should be 8.
>   OVS_WAIT_UNTIL([test 8 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
>   cat 1.expected | cut -c -48 > expout
>   AT_CHECK([cat 1.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -8437,7 +8437,7 @@ test_dns6 1 f00000000001 f000000000f0 $src_ip $dst_ip $dns_reply $dns_req_data $
>   # NXT_RESUMEs should be 9.
>   OVS_WAIT_UNTIL([test 9 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap > 1.packets
>   # Skipping the UDP checksum.
>   cat 1.expected | cut -c 1-120,125- > expout
>   AT_CHECK([cat 1.packets | cut -c 1-120,125-], [0], [expout])
> @@ -8623,7 +8623,7 @@ grep actions=mod_dl_dst:f0:00:00:01:02:04 | wc -l` -eq 1
>       sleep 1
>   
>       OVN_CHECK_PACKETS([ext1/vif1-tx.pcap], [ext1-vif1.expected])
> -    $PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" $active_gw/br-phys_n1-tx.pcap  > packets
> +    $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $active_gw/br-phys_n1-tx.pcap  > packets
>       cat packets | grep $expected > exp
>       # Its possible that $active_gw/br-phys_n1-tx.pcap may have received multiple
>       # garp packets. So consider only the first packet.
> @@ -8632,7 +8632,7 @@ grep actions=mod_dl_dst:f0:00:00:01:02:04 | wc -l` -eq 1
>       rm -f expout
>       if test $backup_vswitchd_dead != 1; then
>           # Check for backup gw only if vswitchd is alive
> -        $PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" $backup_gw/br-phys_n1-tx.pcap  > packets
> +        $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $backup_gw/br-phys_n1-tx.pcap  > packets
>           AT_CHECK([grep $expected packets | sort], [0], [])
>       fi
>   }
> @@ -8872,12 +8872,12 @@ grep actions=mod_dl_dst:f0:00:00:01:02:04 | wc -l` -eq 1
>       as hv1 ovs-appctl netdev-dummy/receive hv1-vif1 $packet
>   
>       OVN_CHECK_PACKETS([ext1/vif1-tx.pcap], [ext1-vif1.expected])
> -    $PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" $active_gw/br-phys_n1-tx.pcap  > packets
> +    $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $active_gw/br-phys_n1-tx.pcap  > packets
>       cat packets | grep $expected > exp
>       cat packets | grep $exp_gw_ip_garp | head -1 >> exp
>       AT_CHECK([cat exp], [0], [expout])
>   
> -    $PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" $backup_gw/br-phys_n1-tx.pcap  > packets
> +    $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $backup_gw/br-phys_n1-tx.pcap  > packets
>       AT_CHECK([grep $expected packets | sort], [0], [])
>   }
>   
> @@ -9302,7 +9302,7 @@ OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 100])
>   trim_zeros() {
>       sed 's/\(00\)\{1,\}$//'
>   }
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets
>   expected="fffffffffffff0000000000108060001080006040001f00000000001c0a80001000000000000c0a80001"
>   echo $expected > expout
>   expected="fffffffffffff0000000000108060001080006040001f00000000001c0a80002000000000000c0a80002"
> @@ -9350,7 +9350,7 @@ trim_zeros() {
>       sed 's/\(00\)\{1,\}$//'
>   }
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros > packets
>   garp_1="fffffffffffff0000000000308060001080006040001f00000000003c0a80003000000000000c0a80003"
>   echo $garp_1 > expout
>   garp_2="fffffffffffff0000000000408060001080006040001f00000000004c0a80004000000000000c0a80004"
> @@ -9615,12 +9615,12 @@ ip_packet() {
>   
>   # Check vlan tagged packet on the bridge connecting hv1 and hv2 with the
>   # foo1's mac.
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/br-ex_n2-tx.pcap | ip_packet | uniq > hv1-br-ex_n2
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/br-ex_n2-tx.pcap | ip_packet | uniq > hv1-br-ex_n2
>   cat hv1-br-ex_n2.expected > expout
>   AT_CHECK([sort hv1-br-ex_n2], [0], [expout])
>   
>   # Check expected packet on nexthop interface
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv3/vif1-tx.pcap | grep ${foo1_ip}${dst_ip} | uniq > hv3-vif1
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv3/vif1-tx.pcap | grep ${foo1_ip}${dst_ip} | uniq > hv3-vif1
>   cat hv3-vif1.expected > expout
>   AT_CHECK([sort hv3-vif1], [0], [expout])
>   
> @@ -9650,11 +9650,11 @@ sent_garp="ffffffffffff0000010102038100000208060001080006040001000001010203c0a80
>   
>   OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [foo1.expout])
>   # Wait until we receive atleast 1 packet
> -OVS_WAIT_UNTIL([test 1=`$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap | wc -l`])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap | head -1 > packets
> +OVS_WAIT_UNTIL([test 1=`$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap | wc -l`])
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap | head -1 > packets
>   echo $sent_garp > expout
>   AT_CHECK([cat packets], [0], [expout])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv4/br-ex_n2-tx.pcap > empty
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv4/br-ex_n2-tx.pcap > empty
>   AT_CHECK([cat empty], [0], [])
>   
>   # Make hv4 master
> @@ -9679,7 +9679,7 @@ OVN_CHECK_PACKETS([hv4/br-ex_n2-tx.pcap], [br-ex_n2.expout])
>   
>   sleep 2
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap > empty
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap > empty
>   AT_CHECK([cat empty], [0], [])
>   
>   OVN_CLEANUP([hv1],[hv2],[hv3], [hv4])
> @@ -9807,7 +9807,7 @@ test_ipv6_ra 1 $src_mac $src_lla $addr_mode 0 $default_prefix_option_config
>   # NXT_RESUME should be 1.
>   OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap  > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap  > 1.packets
>   
>   cat 1.expected | cut -c -112 > expout
>   AT_CHECK([cat 1.packets | cut -c -112], [0], [expout])
> @@ -9838,7 +9838,7 @@ test_ipv6_ra 2 $src_mac $src_lla $addr_mode $mtu $default_prefix_option_config
>   # NXT_RESUME should be 2.
>   OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap  > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap  > 2.packets
>   
>   cat 2.expected | cut -c -112 > expout
>   AT_CHECK([cat 2.packets | cut -c -112], [0], [expout])
> @@ -9868,7 +9868,7 @@ test_ipv6_ra 3 $src_mac $src_lla $addr_mode $mtu $default_prefix_option_config
>   # NXT_RESUME should be 3.
>   OVS_WAIT_UNTIL([test 3 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif3-tx.pcap  > 3.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif3-tx.pcap  > 3.packets
>   
>   cat 3.expected | cut -c -112 > expout
>   AT_CHECK([cat 3.packets | cut -c -112], [0], [expout])
> @@ -9898,7 +9898,7 @@ test_ipv6_ra 1 $src_mac $src_lla $addr_mode $mtu $default_prefix_option_config
>   # NXT_RESUME should be 4.
>   OVS_WAIT_UNTIL([test 4 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap  > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap  > 1.packets
>   
>   cat 1.expected | cut -c -112 > expout
>   AT_CHECK([cat 1.packets | cut -c -112], [0], [expout])
> @@ -9928,7 +9928,7 @@ test_ipv6_ra 1 $src_mac $src_lla $addr_mode $mtu $default_prefix_option_config
>   # NXT_RESUME should be 4 only.
>   OVS_WAIT_UNTIL([test 4 = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap  > 1.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap  > 1.packets
>   AT_CHECK([cat 1.packets], [0], [])
>   
>   OVN_CLEANUP([hv1])
> @@ -10790,15 +10790,15 @@ only_broadcast_from_lrp1() {
>   garp="fffffffffffff0000000000108060001080006040001f00000000001c0a80064000000000000c0a80064"
>   echo $garp > expout
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv1_snoop_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv1_snoop_tx
>   echo "packets on hv1-snoopvif:"
>   cat hv1_snoop_tx
>   AT_CHECK([sort hv1_snoop_tx], [0], [expout])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv2_br_phys_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv2_br_phys_tx
>   echo "packets on hv2 br-phys tx"
>   cat hv2_br_phys_tx
>   AT_CHECK([grep $garp hv2_br_phys_tx | sort], [0], [expout])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx
>   echo "packets on hv3 br-phys tx"
>   cat hv3_br_phys_tx
>   AT_CHECK([grep $garp hv3_br_phys_tx | sort], [0], [])
> @@ -10824,11 +10824,11 @@ trim_zeros() {
>       sed 's/\(00\)\{1,\}$//'
>   }
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq >  hv1_snoopvif_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq >  hv1_snoopvif_tx
>   AT_CHECK([sort hv1_snoopvif_tx], [0], [expout])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx
>   AT_CHECK([grep $garp hv3_br_phys_tx | sort], [0], [expout])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv2_br_phys_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv2_br_phys_tx
>   AT_CHECK([grep $garp hv2_br_phys_tx | sort], [0], [])
>   
>   # change localnet port tag.
> @@ -10869,11 +10869,11 @@ trim_zeros() {
>   garp="fffffffffffff00000000001810007de08060001080006040001f00000000001c0a80064000000000000c0a80064"
>   echo $garp > expout
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq >  hv1_snoopvif_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq >  hv1_snoopvif_tx
>   AT_CHECK([sort hv1_snoopvif_tx], [0], [expout])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx
>   AT_CHECK([grep $garp hv3_br_phys_tx | sort], [0], [expout])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv2_br_phys_tx
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv2_br_phys_tx
>   AT_CHECK([grep $garp hv2_br_phys_tx | sort], [0], [])
>   
>   OVN_CLEANUP([hv1],[hv2],[hv3])
> @@ -11086,9 +11086,9 @@ $mcast_node_ip $nd_target
>   OVS_WAIT_WHILE([test 24 = $(wc -c hv1/br-phys_n1-tx.pcap | cut -d " " -f1)])
>   OVS_WAIT_WHILE([test 24 = $(wc -c hv1/br-phys-tx.pcap | cut -d " " -f1)])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/br-phys_n1-tx.pcap | \
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/br-phys_n1-tx.pcap | \
>   trim_zeros > 1.packets
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/br-phys-tx.pcap | \
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/br-phys-tx.pcap | \
>   trim_zeros > 2.packets
>   
>   cat ipv6_ns.expected | cut -c -112 > expout
> @@ -11119,9 +11119,9 @@ $mcast_node_ip $nd_target
>   OVS_WAIT_WHILE([test 24 = $(wc -c hv1/br-phys_n1-tx.pcap | cut -d " " -f1)])
>   OVS_WAIT_WHILE([test 24 = $(wc -c hv1/br-phys-tx.pcap | cut -d " " -f1)])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/br-phys_n1-tx.pcap | \
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/br-phys_n1-tx.pcap | \
>   trim_zeros > 1.packets
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/br-phys-tx.pcap | \
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/br-phys-tx.pcap | \
>   trim_zeros > 2.packets
>   
>   cat ipv6_ns.expected | cut -c -112 > expout
> @@ -11366,7 +11366,7 @@ ra_test() {
>       for i in hv1 hv2 ; do
>           OVS_WAIT_WHILE([test 24 = $(wc -c $i/vif1-tx.pcap | cut -d " " -f1)])
>   
> -        $PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" $i/vif1-tx.pcap > packets
> +        $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $i/vif1-tx.pcap > packets
>   
>           cat expected | cut -c -112 > expout
>           AT_CHECK([cat packets | cut -c -112], [0], [expout])
> @@ -12217,7 +12217,7 @@ dip=`ip_to_hex 10 0 0 6`
>   test_ip 1 f00000000001 f00000000002 $sip $dip 2
>   
>   cat 2.expected > expout
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   AT_CHECK([cat 2.packets], [0], [expout])
>   
>   # There should be total of 12 flows present with conjunction action and 2 flows
> @@ -12256,7 +12256,7 @@ sip=`ip_to_hex 10 0 0 4`
>   dip=`ip_to_hex 10 0 0 7`
>   
>   test_ip 1 f00000000001 f00000000002 $sip $dip
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif2-tx.pcap > 2.packets
>   AT_CHECK([cat 2.packets], [0], [])
>   
>   AT_CLEANUP
> @@ -12973,7 +12973,7 @@ OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor0_hv1.log | grep -c NXT_RESUME`])
>   # NXT_RESUMEs should be 0 in hv2.
>   OVS_WAIT_UNTIL([test 0 = `cat ofctl_monitor0_hv2.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_v4.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_v4.packets
>   cat ext1_v4.expected | cut -c -48 > expout
>   AT_CHECK([cat ext1_v4.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -13000,7 +13000,7 @@ OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv1.log | grep -c NXT_RESUME`])
>   # NXT_RESUMEs should be 0 in hv2.
>   OVS_WAIT_UNTIL([test 0 = `cat ofctl_monitor0_hv2.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap | \
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap | \
>   sort > ext1_v6.packets
>   cat ext1_v6.expected | cut -c -120 > expout
>   AT_CHECK([cat ext1_v6.packets | cut -c -120], [0], [expout])
> @@ -13071,7 +13071,7 @@ OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv1.log | grep -c NXT_RESUME`])
>   # NXT_RESUMEs should be 1 in hv2.
>   OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor0_hv2.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_v4.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_v4.packets
>   cat ext1_v4.expected | cut -c -48 > expout
>   AT_CHECK([cat ext1_v4.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -13097,7 +13097,7 @@ OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv1.log | grep -c NXT_RESUME`])
>   # NXT_RESUMEs should be 2 in hv2.
>   OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv2.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap | \
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap | \
>   sort > ext1_v6.packets
>   cat ext1_v6.expected | cut -c -120 > expout
>   AT_CHECK([cat ext1_v6.packets | cut -c -120], [0], [expout])
> @@ -13131,11 +13131,11 @@ arp_request=ffffffffffff${ext1_mac}08060001080006040001${ext1_mac}${ext1_ip}0000
>   as hv1 ovs-appctl netdev-dummy/receive hv1-ext1 $arp_request
>   expected_response=${src_mac}${router_mac}08060001080006040002${router_mac}${router_ip}${ext1_mac}${ext1_ip}
>   echo $expected_response > expout
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_arp_resp
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_arp_resp
>   AT_CHECK([cat ext1_arp_resp], [0], [expout])
>   
>   # Verify that the response came from hv2
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap > ext1_arp_resp
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap > ext1_arp_resp
>   AT_CHECK([cat ext1_arp_resp], [0], [expout])
>   
>   # Now add 3 ha chassis to the ha chassis group
> @@ -13181,7 +13181,7 @@ OVS_WAIT_UNTIL([test 3 = `cat ofctl_monitor0_hv1.log | grep -c NXT_RESUME`])
>   # NXT_RESUMEs should be 2 in hv2.
>   OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv2.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_v4.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_v4.packets
>   cat ext1_v4.expected | cut -c -48 > expout
>   AT_CHECK([cat ext1_v4.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -13208,7 +13208,7 @@ OVS_WAIT_UNTIL([test 4 = `cat ofctl_monitor0_hv1.log | grep -c NXT_RESUME`])
>   # NXT_RESUMEs should be 2 in hv2.
>   OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv2.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap | \
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap | \
>   sort > ext1_v6.packets
>   cat ext1_v6.expected | cut -c -120 > expout
>   AT_CHECK([cat ext1_v6.packets | cut -c -120], [0], [expout])
> @@ -13264,7 +13264,7 @@ OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv2.log | grep -c NXT_RESUME`])
>   # NXT_RESUMEs should be 1 in hv3.
>   OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor0_hv3.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_v4.packets
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap > ext1_v4.packets
>   cat ext1_v4.expected | cut -c -48 > expout
>   AT_CHECK([cat ext1_v4.packets | cut -c -48], [0], [expout])
>   # Skipping the IPv4 checksum.
> @@ -13294,7 +13294,7 @@ OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv2.log | grep -c NXT_RESUME`])
>   # NXT_RESUMEs should be 2 in hv3.
>   OVS_WAIT_UNTIL([test 2 = `cat ofctl_monitor0_hv3.log | grep -c NXT_RESUME`])
>   
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/ext1-tx.pcap | \
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/ext1-tx.pcap | \
>   sort > ext1_v6.packets
>   cat ext1_v6.expected | cut -c -120 > expout
>   AT_CHECK([cat ext1_v6.packets | cut -c -120], [0], [expout])
> @@ -13665,14 +13665,14 @@ test_ip_packet_larger() {
>   
>       if test $icmp_pmtu_reply_expected = 0; then
>           OVN_CHECK_PACKETS([hv1/br-phys_n1-tx.pcap], [br_phys_n1.expected])
> -        $PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/vif1-tx.pcap  > pkts
> +        $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap  > pkts
>           # hv1/vif1-tx.pcap can receive the GARP packet generated by ovn-controller
>           # for the gateway router port. So ignore this packet.
>           cat pkts | grep -v $gw_ip_garp > packets
>           AT_CHECK([cat packets], [0], [])
>       else
>           OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [hv1-vif1.expected])
> -        $PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/br-phys_n1-tx.pcap  > \
> +        $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/br-phys_n1-tx.pcap  > \
>           pkts
>           # hv1/br-phys_n1-tx.pcap can receive the GARP packet generated by ovn-controller
>           # for the gateway router port. So ignore this packet.
> @@ -13947,8 +13947,8 @@ OVS_WAIT_UNTIL([test `ovn-sbctl find mac_binding logical_port="lr1-pub" ip="172.
>   # Check that the GARPs went also to the external physical network
>   # Wait until at least 4 packets have arrived and copy them to a separate file as
>   # more GARPs are expected in the capture in order to avoid race conditions.
> -OVS_WAIT_UNTIL([test `$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/br-phys-tx.pcap | wc -l` -gt 4])
> -$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" hv1/br-phys-tx.pcap | head -n4 > hv1/br-phys-tx4.pcap
> +OVS_WAIT_UNTIL([test `$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/br-phys-tx.pcap | wc -l` -gt 4])
> +$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/br-phys-tx.pcap | head -n4 > hv1/br-phys-tx4.pcap
>   
>   # GARP for lp0 172.24.4.100 on lr0-pub MAC (f0:00:00:00:00:01)
>   echo "fffffffffffff0000000000108060001080006040001f00000000001ac180464000000000000ac180464" > expout
> diff --git a/tests/ovsdb-macros.at b/tests/ovsdb-macros.at
> index 638894794..83e3df750 100644
> --- a/tests/ovsdb-macros.at
> +++ b/tests/ovsdb-macros.at
> @@ -3,7 +3,7 @@ dnl
>   dnl Creates an empty database named $1.
>   m4_define([OVSDB_INIT],
>     [AT_CHECK(
> -     [ovsdb-tool create $1 $abs_top_srcdir/vswitchd/vswitch.ovsschema],
> +     [ovsdb-tool create $1 $ovs_srcdir/vswitchd/vswitch.ovsschema],
>        [0], [stdout], [ignore])
>      AT_CHECK(
>        [[ovsdb-tool transact $1 \
> diff --git a/tutorial/automake.mk b/tutorial/automake.mk
> index b7ea10c98..13b3bee05 100644
> --- a/tutorial/automake.mk
> +++ b/tutorial/automake.mk
> @@ -9,4 +9,4 @@ EXTRA_DIST += \
>   	tutorial/ovn-setup.sh
>   sandbox: all
>   	cd $(srcdir)/tutorial && MAKE=$(MAKE) HAVE_OPENSSL=$(HAVE_OPENSSL) \
> -		./ovs-sandbox -b $(abs_builddir) $(SANDBOXFLAGS)
> +		./ovs-sandbox -b $(abs_builddir) --ovs-src $(ovs_srcdir) --ovs-build $(ovs_builddir) $(SANDBOXFLAGS)
> diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox
> index 7546d27ca..a19dea2f1 100755
> --- a/tutorial/ovs-sandbox
> +++ b/tutorial/ovs-sandbox
> @@ -63,7 +63,9 @@ gdb_ovn_controller_ex=false
>   gdb_ovn_controller_vtep=false
>   gdb_ovn_controller_vtep_ex=false
>   builddir=
> +ovsbuilddir=
>   srcdir=
> +ovssrcdir=
>   schema=
>   installed=false
>   built=false
> @@ -111,9 +113,11 @@ If you run ovs-sandbox from an OVS build directory, it uses the OVS that
>   you built.  Otherwise, if you have an installed Open vSwitch, it uses
>   the installed version.
>   
> -These options force ovs-sandbox to use a particular OVS build:
> -  -b, --builddir=DIR   specify Open vSwitch build directory
> -  -s, --srcdir=DIR     specify Open vSwitch source directory
> +These options force ovs-sandbox to use a particular OVN and OVS build:
> +  -b, --builddir=DIR   specify OVN build directory
> +  -s, --srcdir=DIR     specify OVN source directory
> +  --ovs-build, --ovsbuilddir=DIR specify Open vSwitch build directory
> +  --ovs-src, --ovssrcdir=DIR specify Open vSwitch source directory
>   These options force ovs-sandbox to use an installed Open vSwitch:
>     -i, --installed      use installed Open vSwitch
>   
> @@ -150,6 +154,18 @@ EOF
>               prev=builddir
>               built=:
>               ;;
> +        --ovs-build*=*)
> +            ovsbuilddir=$optarg
> +            ;;
> +        --ovs-build*)
> +            prev=ovsbuilddir
> +            ;;
> +        --ovs-src*=*)
> +            ovssrcdir=$optarg
> +            ;;
> +        --ovs-src*)
> +            prev=ovssrcdir
> +            ;;
>           --sr*=*)
>               srcdir=$optarg
>               built=false
> @@ -278,8 +294,8 @@ else
>   fi
>   
>   if $built; then
> -    if test ! -e "$builddir"/ovs/vswitchd/ovs-vswitchd; then
> -        echo "$builddir does not appear to be an OVS build directory" >&2
> +    if test ! -e "$builddir"/controller/ovn-controller; then
> +        echo "$builddir does not appear to be an OVN build directory" >&2
>           exit 1
>       fi
>       builddir=`cd $builddir && pwd`
> @@ -295,7 +311,7 @@ if $built; then
>           /*) ;;
>           *) srcdir=`pwd`/$srcdir ;;
>       esac
> -    schema=$srcdir/ovs/vswitchd/vswitch.ovsschema
> +    schema=$ovssrcdir/vswitchd/vswitch.ovsschema
>       if test ! -e "$schema"; then
>           echo >&2 'source directory not found, please use --srcdir'
>           exit 1
> @@ -311,7 +327,7 @@ if $built; then
>               echo >&2 'source directory not found, please use --srcdir'
>               exit 1
>           fi
> -        vtep_schema=$srcdir/ovs/vtep/vtep.ovsschema
> +        vtep_schema=$ovssrcdir/vtep/vtep.ovsschema
>           if test ! -e "$vtep_schema"; then
>               echo >&2 'source directory not found, please use --srcdir'
>               exit 1
> @@ -319,14 +335,12 @@ if $built; then
>       fi
>   
>       # Put built tools early in $PATH.
> -    if test ! -e $builddir/ovs/vswitchd/ovs-vswitchd; then
> +    if test ! -e $ovsbuilddir/vswitchd/ovs-vswitchd; then
>           echo >&2 'build not found, please change set $builddir or change directory'
>           exit 1
>       fi
> -    PATH=$builddir/ovs/ovsdb:$builddir/ovs/vswitchd:$builddir/ovs/utilities:$builddir/ovs/vtep:$PATH
> -    if $ovn; then
> -        PATH=$builddir/controller:$builddir/controller-vtep:$builddir/northd:$builddir/utilities:$PATH
> -    fi
> +    PATH=$ovsbuilddir/ovsdb:$ovsbuilddir/vswitchd:$ovsbuilddir/utilities:$ovsbuilddir/vtep:$PATH
> +    PATH=$builddir/controller:$builddir/controller-vtep:$builddir/northd:$builddir/utilities:$PATH
>       export PATH
>   else
>       case $schema in
> @@ -347,10 +361,8 @@ else
>           echo "can't find vswitch.ovsschema, please specify --schema" >&2
>           exit 1
>       fi
> -    if $ovn; then
> -        echo "running with ovn is only supported from the build dir." >&2
> -        exit 1
> -    fi
> +    echo "running with ovn is only supported from the build dir." >&2
> +    exit 1
>   fi
>   
>   # Create sandbox.
> @@ -378,109 +390,108 @@ trap 'kill `cat "$sandbox"/*.pid`' 0 1 2 3 13 14 15
>   touch "$sandbox"/.conf.db.~lock~
>   run ovsdb-tool create conf.db "$schema"
>   ovsdb_server_args=
> -if $ovn; then
> -    touch "$sandbox"/.ovnnb.db.~lock~
> -    run ovsdb-tool create ovnnb.db "$ovnnb_schema"
> -    run ovsdb-tool create vtep.db "$vtep_schema"
> -    ovsdb_server_args="vtep.db conf.db"
> -    ovsdb_nb_server_args="ovnnb.db"
> -
> -    if [ "$HAVE_OPENSSL" = yes ]; then
> -        OVS_PKI="run ovs-pki --dir=$sandbox/pki --log=$sandbox/ovs-pki.log"
> -        $OVS_PKI init
> -        $OVS_PKI req+sign ovnsb switch
> -        $OVS_PKI req+sign ovnnb switch
> -        for i in $(seq $n_controllers); do
> -            $OVS_PKI -u req+sign chassis-$i switch
> -        done
> -    fi
> +
> +touch "$sandbox"/.ovnnb.db.~lock~
> +run ovsdb-tool create ovnnb.db "$ovnnb_schema"
> +run ovsdb-tool create vtep.db "$vtep_schema"
> +ovsdb_server_args="vtep.db conf.db"
> +ovsdb_nb_server_args="ovnnb.db"
> +
> +if [ "$HAVE_OPENSSL" = yes ]; then
> +    OVS_PKI="run ovs-pki --dir=$sandbox/pki --log=$sandbox/ovs-pki.log"
> +    $OVS_PKI init
> +    $OVS_PKI req+sign ovnsb switch
> +    $OVS_PKI req+sign ovnnb switch
> +    for i in $(seq $n_controllers); do
> +        $OVS_PKI -u req+sign chassis-$i switch
> +    done
>   fi
> +
>   rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file -vsyslog:off \
>          --remote=punix:"$sandbox"/db.sock \
>          --remote=db:Open_vSwitch,Open_vSwitch,manager_options \
>          $ovsdb_server_args
> -if $ovn; then
> -    ovn_start_db() {
> -        local db=$1 model=$2 servers=$3 schema=$4
> -        local DB=$(echo $db | tr a-z A-Z)
> -        local schema_name=$(ovsdb-tool schema-name $schema)
> -
> -        case $model in
> -            standalone | backup) ;;
> -            clustered)
> -                case $servers in
> -                    [1-9] | [1-9][0-9]) ;;
> -                    *) echo "${db}db servers must be between 1 and 99" >&2
> -                       exit 1
> -                       ;;
> -                esac
> -                ;;
> -            *)
> -                echo "unknown ${db}db model \"$model\"" >&2
> -                exit 1
> -                ;;
> -        esac
> -
> -        ovn_start_ovsdb_server() {
> -            local i=$1; shift
> -            rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir \
> -                   --pidfile=$db$i.pid -vconsole:off --log-file=$db$i.log \
> -                   -vsyslog:off \
> -                   --remote=db:$schema_name,${DB}_Global,connections \
> -                   --private-key=db:$schema_name,SSL,private_key \
> -                   --certificate=db:$schema_name,SSL,certificate \
> -                   --ca-cert=db:$schema_name,SSL,ca_cert \
> -                   --ssl-protocols=db:$schema_name,SSL,ssl_protocols \
> -                   --ssl-ciphers=db:$schema_name,SSL,ssl_ciphers \
> -                   --unixctl=${db}$i --remote=punix:$db$i.ovsdb ${db}$i.db "$@"
> -        }
> -
> -        case $model in
> -            standalone)
> -                run ovsdb-tool create ${db}1.db "$schema"
> -                ovn_start_ovsdb_server 1
> -                remote=unix:${db}1.ovsdb
> -                ;;
> -            backup)
> -                for i in 1 2; do
> -                    run ovsdb-tool create $db$i.db "$schema"
> -                done
> -                ovn_start_ovsdb_server 1
> -                ovn_start_ovsdb_server 2 --sync-from=unix:${db}1.ovsdb
> -                remote=unix:${db}1.ovsdb
> -                backup_note="$backup_note
> +
> +ovn_start_db() {
> +    local db=$1 model=$2 servers=$3 schema=$4
> +    local DB=$(echo $db | tr a-z A-Z)
> +    local schema_name=$(ovsdb-tool schema-name $schema)
> +
> +    case $model in
> +        standalone | backup) ;;
> +        clustered)
> +            case $servers in
> +                [1-9] | [1-9][0-9]) ;;
> +                *) echo "${db}db servers must be between 1 and 99" >&2
> +                    exit 1
> +                    ;;
> +            esac
> +            ;;
> +        *)
> +            echo "unknown ${db}db model \"$model\"" >&2
> +            exit 1
> +            ;;
> +    esac
> +
> +    ovn_start_ovsdb_server() {
> +        local i=$1; shift
> +        rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir \
> +                --pidfile=$db$i.pid -vconsole:off --log-file=$db$i.log \
> +                -vsyslog:off \
> +                --remote=db:$schema_name,${DB}_Global,connections \
> +                --private-key=db:$schema_name,SSL,private_key \
> +                --certificate=db:$schema_name,SSL,certificate \
> +                --ca-cert=db:$schema_name,SSL,ca_cert \
> +                --ssl-protocols=db:$schema_name,SSL,ssl_protocols \
> +                --ssl-ciphers=db:$schema_name,SSL,ssl_ciphers \
> +                --unixctl=${db}$i --remote=punix:$db$i.ovsdb ${db}$i.db "$@"
> +    }
> +
> +    case $model in
> +        standalone)
> +            run ovsdb-tool create ${db}1.db "$schema"
> +            ovn_start_ovsdb_server 1
> +            remote=unix:${db}1.ovsdb
> +            ;;
> +        backup)
> +            for i in 1 2; do
> +                run ovsdb-tool create $db$i.db "$schema"
> +            done
> +            ovn_start_ovsdb_server 1
> +            ovn_start_ovsdb_server 2 --sync-from=unix:${db}1.ovsdb
> +            remote=unix:${db}1.ovsdb
> +            backup_note="$backup_note
>   The backup server of OVN $DB can be accessed by:
>   * ovn-${db}ctl --db=unix:`pwd`/sandbox/${db}2.ovsdb
>   * ovs-appctl -t `pwd`/sandbox/${db}2
>   The backup database file is sandbox/${db}2.db
>   "
> -                ;;
> -            clustered)
> -                for i in $(seq $servers); do
> -                    if test $i = 1; then
> -                        run ovsdb-tool create-cluster ${db}1.db "$schema" unix:${db}1.raft;
> -                    else
> -                        run ovsdb-tool join-cluster $db$i.db $schema_name unix:$db$i.raft unix:${db}1.raft
> -                    fi
> -                    ovn_start_ovsdb_server $i
> -                done
> -                remote=unix:${db}1.ovsdb
> -                for i in `seq 2 $servers`; do
> -                    remote=$remote,unix:$db$i.ovsdb
> -                done
> -                for i in $(seq $servers); do
> -                    run ovsdb-client wait unix:$db$i.ovsdb $schema_name connected
> -                done
> -                ;;
> -        esac
> -        eval OVN_${DB}_DB=\$remote
> -        eval export OVN_${DB}_DB
> -    }
> +            ;;
> +        clustered)
> +            for i in $(seq $servers); do
> +                if test $i = 1; then
> +                    run ovsdb-tool create-cluster ${db}1.db "$schema" unix:${db}1.raft;
> +                else
> +                    run ovsdb-tool join-cluster $db$i.db $schema_name unix:$db$i.raft unix:${db}1.raft
> +                fi
> +                ovn_start_ovsdb_server $i
> +            done
> +            remote=unix:${db}1.ovsdb
> +            for i in `seq 2 $servers`; do
> +                remote=$remote,unix:$db$i.ovsdb
> +            done
> +            for i in $(seq $servers); do
> +                run ovsdb-client wait unix:$db$i.ovsdb $schema_name connected
> +            done
> +            ;;
> +    esac
> +    eval OVN_${DB}_DB=\$remote
> +    eval export OVN_${DB}_DB
> +}
>   
> -    backup_note=
> -    ovn_start_db nb "$nbdb_model" "$nbdb_servers" "$ovnnb_schema"
> -    ovn_start_db sb "$sbdb_model" "$sbdb_servers" "$ovnsb_schema"
> -fi
> +backup_note=
> +ovn_start_db nb "$nbdb_model" "$nbdb_servers" "$ovnnb_schema"
> +ovn_start_db sb "$sbdb_model" "$sbdb_servers" "$ovnsb_schema"
>   
>   #Add a small delay to allow ovsdb-server to launch.
>   sleep 0.1
> @@ -501,49 +512,47 @@ run ovs-vsctl --no-wait -- init
>   rungdb $gdb_vswitchd $gdb_vswitchd_ex ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off --log-file -vsyslog:off \
>       --enable-dummy=$dummy -vvconn -vnetdev_dummy
>   
> -if $ovn; then
> -    ovn-nbctl init
> -    ovn-sbctl init
> -
> -    ovs-vsctl set open . external-ids:system-id=chassis-1
> -    ovs-vsctl set open . external-ids:hostname=sandbox
> -    ovs-vsctl set open . external-ids:ovn-encap-type=geneve
> -    ovs-vsctl set open . external-ids:ovn-encap-ip=127.0.0.1
> -
> -    if [ "$HAVE_OPENSSL" = yes ]; then
> -        ovn-nbctl set-ssl $sandbox/ovnnb-privkey.pem  $sandbox/ovnnb-cert.pem $sandbox/pki/switchca/cacert.pem
> -        ovn-nbctl set-connection pssl:6641
> -        ovn-sbctl set-ssl $sandbox/ovnsb-privkey.pem  $sandbox/ovnsb-cert.pem $sandbox/pki/switchca/cacert.pem
> -        if $ovn_rbac; then
> -            ovn-sbctl set-connection role=ovn-controller pssl:6642
> -        else
> -            ovn-sbctl set-connection pssl:6642
> -        fi
> -        ovs-vsctl set open . external-ids:ovn-remote=ssl:127.0.0.1:6642
> -        OVN_CTRLR_PKI="-p $sandbox/chassis-1-privkey.pem -c $sandbox/chassis-1-cert.pem -C $sandbox/pki/switchca/cacert.pem"
> +ovn-nbctl init
> +ovn-sbctl init
> +
> +ovs-vsctl set open . external-ids:system-id=chassis-1
> +ovs-vsctl set open . external-ids:hostname=sandbox
> +ovs-vsctl set open . external-ids:ovn-encap-type=geneve
> +ovs-vsctl set open . external-ids:ovn-encap-ip=127.0.0.1
> +
> +if [ "$HAVE_OPENSSL" = yes ]; then
> +    ovn-nbctl set-ssl $sandbox/ovnnb-privkey.pem  $sandbox/ovnnb-cert.pem $sandbox/pki/switchca/cacert.pem
> +    ovn-nbctl set-connection pssl:6641
> +    ovn-sbctl set-ssl $sandbox/ovnsb-privkey.pem  $sandbox/ovnsb-cert.pem $sandbox/pki/switchca/cacert.pem
> +    if $ovn_rbac; then
> +        ovn-sbctl set-connection role=ovn-controller pssl:6642
>       else
> -        ovs-vsctl set open . external-ids:ovn-remote=$OVN_SB_DB
> -        OVN_CTRLR_PKI=""
> +        ovn-sbctl set-connection pssl:6642
>       fi
> -    for i in $(seq $n_northds); do
> -        if [ $i -eq 1 ]; then inst=""; else inst=$i; fi
> -        rungdb $gdb_ovn_northd $gdb_ovn_northd_ex ovn-northd --detach \
> -               --no-chdir --pidfile=ovn-northd${inst}.pid -vconsole:off \
> -               --log-file=ovn-northd${inst}.log -vsyslog:off \
> -               --ovnsb-db="$OVN_SB_DB" --ovnnb-db="$OVN_NB_DB"
> -    done
> -    for i in $(seq $n_controllers); do
> -        if [ $i -eq 1 ]; then inst=""; else inst=$i; fi
> -        rungdb $gdb_ovn_controller $gdb_ovn_controller_ex ovn-controller \
> -               $OVN_CTRLR_PKI --detach --no-chdir -vsyslog:off \
> -               --log-file=ovn-controller${inst}.log \
> -               --pidfile=ovn-controller${inst}.pid -vconsole:off
> -    done
> -    rungdb $gdb_ovn_controller_vtep $gdb_ovn_controller_vtep_ex \
> -        ovn-controller-vtep --detach --no-chdir --pidfile -vconsole:off \
> -        $OVN_CTRLR_PKI --log-file -vsyslog:off \
> -        --ovnsb-db=unix:"$sandbox"/ovnsb_db.sock
> +    ovs-vsctl set open . external-ids:ovn-remote=ssl:127.0.0.1:6642
> +    OVN_CTRLR_PKI="-p $sandbox/chassis-1-privkey.pem -c $sandbox/chassis-1-cert.pem -C $sandbox/pki/switchca/cacert.pem"
> +else
> +    ovs-vsctl set open . external-ids:ovn-remote=$OVN_SB_DB
> +    OVN_CTRLR_PKI=""
>   fi
> +for i in $(seq $n_northds); do
> +    if [ $i -eq 1 ]; then inst=""; else inst=$i; fi
> +    rungdb $gdb_ovn_northd $gdb_ovn_northd_ex ovn-northd --detach \
> +            --no-chdir --pidfile=ovn-northd${inst}.pid -vconsole:off \
> +            --log-file=ovn-northd${inst}.log -vsyslog:off \
> +            --ovnsb-db="$OVN_SB_DB" --ovnnb-db="$OVN_NB_DB"
> +done
> +for i in $(seq $n_controllers); do
> +    if [ $i -eq 1 ]; then inst=""; else inst=$i; fi
> +    rungdb $gdb_ovn_controller $gdb_ovn_controller_ex ovn-controller \
> +            $OVN_CTRLR_PKI --detach --no-chdir -vsyslog:off \
> +            --log-file=ovn-controller${inst}.log \
> +            --pidfile=ovn-controller${inst}.pid -vconsole:off
> +done
> +rungdb $gdb_ovn_controller_vtep $gdb_ovn_controller_vtep_ex \
> +    ovn-controller-vtep --detach --no-chdir --pidfile -vconsole:off \
> +    $OVN_CTRLR_PKI --log-file -vsyslog:off \
> +    --ovnsb-db=unix:"$sandbox"/ovnsb_db.sock
>   
>   cat <<EOF
>   
> @@ -554,13 +563,10 @@ You are running in a dummy Open vSwitch environment.  You can use
>   ovs-vsctl, ovs-ofctl, ovs-appctl, and other tools to work with the
>   dummy switch.
>   
> -EOF
> -if $ovn; then cat << EOF
>   This environment also has the OVN daemons and databases enabled.
>   You can use ovn-nbctl and ovn-sbctl to interact with the OVN databases.
>   $backup_note
>   EOF
> -fi
>   cat <<EOF
>   Log files, pidfiles, and the configuration database are in the
>   "sandbox" subdirectory.
> 



More information about the dev mailing list