]> git.proxmox.com Git - ovs.git/commitdiff
Require Python 3 and remove support for Python 2.
authorBen Pfaff <blp@ovn.org>
Fri, 20 Sep 2019 15:30:42 +0000 (08:30 -0700)
committerBen Pfaff <blp@ovn.org>
Fri, 27 Sep 2019 16:23:50 +0000 (09:23 -0700)
Python 2 reaches end-of-life on January 1, 2020, which is only
a few months away.  This means that OVS needs to stop depending
on in the next release that should occur roughly that same time.
Therefore, this commit removes all support for Python 2.  It
also makes Python 3 a mandatory build dependency.

Some of the interesting consequences:

- HAVE_PYTHON, HAVE_PYTHON2, and HAVE_PYTHON3 conditionals have
  been removed, since we now know that Python3 is available.

- $PYTHON and $PYTHON2 are removed, and $PYTHON3 is always
  available.

- Many tests for Python 2 support have been removed, and the ones
  that depended on Python 3 now run unconditionally.  This allowed
  several macros in the testsuite to be removed, making the code
  clearer.  This does make some of the changes to the testsuite
  files large due to indentation level changes.

- #! lines for Python now use /usr/bin/python3 instead of
  /usr/bin/python.

- Packaging depends on Python 3 packages.

Acked-by: Numan Siddique <nusiddiq@redhat.com>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
80 files changed:
.cirrus.yml
.travis/osx-prepare.sh
Documentation/intro/install/fedora.rst
Documentation/intro/install/general.rst
Documentation/intro/install/netbsd.rst
Documentation/intro/install/rhel.rst
Documentation/intro/install/windows.rst
Documentation/intro/install/xenserver.rst
Makefile.am
Vagrantfile
Vagrantfile-FreeBSD
appveyor.yml
build-aux/check-structs
build-aux/extract-ofp-actions
build-aux/extract-ofp-errors
build-aux/extract-ofp-fields
build-aux/extract-ofp-msgs
build-aux/sodepends.py
build-aux/soexpand.py
build-aux/text2c
build-aux/xml2nroff
configure.ac
debian/.gitignore
debian/automake.mk
debian/control
debian/openvswitch-test.install
debian/python-openvswitch.dirs [deleted file]
debian/python-openvswitch.install [deleted file]
debian/python3-openvswitch.dirs [new file with mode: 0644]
debian/python3-openvswitch.install [new file with mode: 0644]
debian/rules
include/openflow/automake.mk
ipsec/ovs-monitor-ipsec.in
m4/openvswitch.m4
manpages.mk
ovsdb/ovsdb-dot.in
ovsdb/ovsdb-idlc.in
python/automake.mk
rhel/openvswitch-fedora.spec.in
tests/atlocal.in
tests/automake.mk
tests/check-structs.at
tests/checkpatch.at
tests/daemon-py.at
tests/flowgen.py
tests/interface-reconfigure.at
tests/json.at
tests/jsonrpc-py.at
tests/library.at
tests/ofproto-dpif.at
tests/ofproto.at
tests/ovs-macros.at
tests/ovs-xapi-sync.at
tests/ovsdb-data.at
tests/ovsdb-idl.at
tests/ovsdb-macros.at
tests/ovsdb-monitor.at
tests/reconnect.at
tests/system-common-macros.at
tests/system-kmod-macros.at
tests/system-traffic.at
tests/system-userspace-macros.at
tests/unixctl-py.at
tests/vlog.at
utilities/automake.mk
utilities/bugtool/automake.mk
utilities/bugtool/ovs-bugtool.in
utilities/checkpatch.py
utilities/ovs-check-dead-ifs.in
utilities/ovs-dpctl-top.in
utilities/ovs-l3ping.in
utilities/ovs-parse-backtrace.in
utilities/ovs-pcap.in
utilities/ovs-tcpdump.in
utilities/ovs-tcpundump.in
utilities/ovs-test.in
utilities/ovs-vlan-test.in
vswitchd/automake.mk
vtep/automake.mk
vtep/ovs-vtep.in

index eb6af0a719c885cff0aba84a1c25d06fbd5f87f7..bae5a089b2480849a2ba22af57a57cbce4c00024 100644 (file)
@@ -9,8 +9,7 @@ freebsd_build_task:
 
   env:
     DEPENDENCIES: automake libtool gmake gcc wget openssl
-                  python py27-six py27-sphinx py27-openssl
-                  python3 py36-six py36-openssl
+                  python3 py36-six py36-openssl p36-sphinx
     matrix:
       COMPILER: gcc
       COMPILER: clang
index 58ccb67cddbdc9290071c94313f1e0af7c00c760..78d5bb57921770f67c9522e725d8163d0a100ab4 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/bash
 set -ev
-pip2 install --user six
-pip2 install --user --upgrade docutils
+pip3 install --user six
+pip3 install --user --upgrade docutils
index f11d05a01041da134e992ea27dcd0d52a5f21048..6fe1fb5b24684a027907132d969fd6d93411fcc7 100644 (file)
@@ -102,7 +102,7 @@ in which `./configure` was executed:
 
     $ make rpm-fedora
 
-This will create the RPMs `openvswitch`, `python-openvswitch`,
+This will create the RPMs `openvswitch`, `python3-openvswitch`,
 `openvswitch-test`, `openvswitch-devel` and `openvswitch-debuginfo`.
 
 To enable DPDK support in the openvswitch package, the ``--with dpdk`` option
@@ -151,7 +151,7 @@ Refer to the :doc:`/faq/index` for more information about the various Open
 vSwitch datapath options.
 
 In most cases only the `openvswitch` RPM will need to be installed. The
-`python-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
+`python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
 `openvswitch-debuginfo` RPMs are optional unless required for a specific
 purpose.
 
index b03d70f6fa6eb550e861aea2c4997fd6d67a0c6b..e62501be7fc191c80af92217e0e7d8d7c4a979b4 100644 (file)
@@ -90,8 +90,8 @@ need the following software:
   If libcap-ng is installed, then Open vSwitch will automatically build with
   support for it.
 
-- Python 2.7. You must also have the Python ``six`` library version 1.4.0
-  or later.
+- Python 3.4 or later. You must also have the Python ``six`` library
+  version 1.4.0 or later.
 
 - Unbound library, from http://www.unbound.net, is optional but recommended if
   you want to enable ovs-vswitchd and other utilities to use DNS names when
@@ -203,8 +203,8 @@ simply install and run Open vSwitch you require the following software:
   from iproute2 (part of all major distributions and available at
   https://wiki.linuxfoundation.org/networking/iproute2).
 
-- Python 2.7. You must also have the Python six library version 1.4.0
-  or later.
+- Python 3.4 or later. You must also have the Python six library
+  version 1.4.0 or later.
 
 On Linux you should ensure that ``/dev/urandom`` exists. To support TAP
 devices, you must also ensure that ``/dev/net/tun`` exists.
index 7eb7f0cebbafd1439c88a794db7d2f51825be053..4f60dad869b68f8db06c36c56bb86e0e55b37e08 100644 (file)
@@ -31,20 +31,18 @@ you need at least the following packages.
 - automake
 - libtool-base
 - gmake
-- python27
-- py27-six
-- py27-xml
+- python37
+- py37-six
 
 Some components have additional requirements. Refer to :doc:`general` for more
 information.
 
-Assuming you are running NetBSD/amd64 6.1.2, you can download and install
+Assuming you are running NetBSD/amd64 7.0.2, you can download and install
 pre-built binary packages as the following::
 
     $ PKG_PATH=http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/7.0.2/All/
     $ export PKG_PATH
-    $ pkg_add automake libtool-base gmake python27 py27-six py27-xml \
-        pkg_alternatives
+    $ pkg_add automake libtool-base gmake python37 py37-six pkg_alternatives
 
 .. note::
   You might get some warnings about minor version mismatch. These can be safely
index 0e5ca2743ef517c1c64f3891071298f0a82c92e8..17b3bc26f11d7dfe2e9e0ae94acacb14891f3f44 100644 (file)
@@ -92,7 +92,7 @@ Once that is completed, remove the file ``/tmp/ovs.spec``.
 If python3-sphinx package is not available in your version of RHEL, you can
 install it via pip with 'pip install sphinx'.
 
-Open vSwitch requires python 2.7 or newer which is not available in older
+Open vSwitch requires python 3.4 or newer which is not available in older
 distributions. In the case of RHEL 6.x and its derivatives, one option is
 to install python34 and python34-six from `EPEL`_.
 
index f696d2c9b621c79224addba3ce9f74abbaaa4371..019e83e644252368424cfb523fa0a81dc5d06f53 100644 (file)
@@ -56,9 +56,9 @@ The following explains the steps in some detail.
 
       'C:/MinGW /mingw'.
 
-- Python
+- Python 3.4 or later.
 
-  Install the latest Python 2.x from python.org and verify that its path is
+  Install the latest Python 3.x from python.org and verify that its path is
   part of Windows' PATH environment variable.
   We require that you have Python six and pypiwin32 libraries installed.
   The libraries can be installed via pip command:
index c0f5e3156697f91111029fbafb38aba67c917d82..366e11ac27adbcddee219c4998a4005db32e4158 100644 (file)
@@ -30,8 +30,8 @@ XenServer host.  If you want to install Open vSwitch on a generic Linux or BSD
 host, refer to :doc:`general` instead.
 
 Open vSwitch should work with XenServer 5.6.100 and later.  However, Open
-vSwitch requires Python 2.7 or later, so using Open vSwitch with XenServer 6.5
-or earlier requires installing Python 2.7.
+vSwitch requires Python 3.4 or later, so using Open vSwitch with XenServer 6.5
+or earlier requires installing Python 3.x.
 
 Building
 --------
index ff1f94b4841ffb7b70866eafe704ef4b6333b0ee..6030cdb495d6dd6cf44f2fa1900733779472b286 100644 (file)
@@ -60,7 +60,7 @@ endif
 # foo/__init__.pyc will cause Python to ignore foo.py.
 run_python = \
        PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \
-       PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
+       PYTHONDONTWRITEBYTECODE=yes $(PYTHON3)
 
 ALL_LOCAL =
 BUILT_SOURCES =
@@ -147,13 +147,13 @@ ro_shell = printf '\043 Generated automatically -- do not modify!    -*- buffer-
 
 SUFFIXES += .in
 .in:
-       $(AM_V_GEN)PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON) $(srcdir)/build-aux/soexpand.py -I$(srcdir) < $< | \
-         $(PYTHON) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \
+       $(AM_V_GEN)PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON3) $(srcdir)/build-aux/soexpand.py -I$(srcdir) < $< | \
+         $(PYTHON3) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \
          sed \
            -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
            -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
            -e 's,[@]DBDIR[@],$(DBDIR),g' \
-           -e 's,[@]PYTHON[@],$(PYTHON),g' \
+           -e 's,[@]PYTHON3[@],$(PYTHON3),g' \
            -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
            -e 's,[@]VERSION[@],$(VERSION),g' \
            -e 's,[@]localstatedir[@],$(localstatedir),g' \
@@ -177,7 +177,7 @@ SUFFIXES += .xml
          PKIDIR='$(PKIDIR)' \
          LOGDIR='$(LOGDIR)' \
          DBDIR='$(DBDIR)' \
-         PYTHON='$(PYTHON)' \
+         PYTHON3='$(PYTHON3)' \
          RUNDIR='$(RUNDIR)' \
          VERSION='$(VERSION)' \
          localstatedir='$(localstatedir)' \
@@ -414,7 +414,7 @@ CLEANFILES += flake8-check
 
 include $(srcdir)/manpages.mk
 $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.py python/build/soutil.py
-       @PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
+       @PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON3) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
        @if cmp -s $(@F).tmp $@; then \
          touch $@; \
          rm -f $(@F).tmp; \
index fbd772a1bec52ea2235c23533946d0bd01a8880f..236e3a7bdcb767284508eec98df5aab3d98bf01f 100644 (file)
@@ -8,12 +8,14 @@ Vagrant.require_version ">=1.7.0"
 $bootstrap_fedora = <<SCRIPT
 dnf -y update
 dnf -y install autoconf automake openssl-devel libtool \
-               python-devel python3-devel \
-               python-twisted python-zope-interface \
+               python3-devel \
+               python3-twisted python3-zope-interface \
                desktop-file-utils groff graphviz rpmdevtools nc curl \
-               wget python-six pyftpdlib checkpolicy selinux-policy-devel \
-               libcap-ng-devel kernel-devel-`uname -r` ethtool python-tftpy \
+               wget python3-six python3-pyftpdlib checkpolicy \
+               selinux-policy-devel \
+               libcap-ng-devel kernel-devel-`uname -r` ethtool python3-pip \
                lftp
+pip-3 install tftpy             # Not yet available for Python3 via dnf.
 echo "search extra update built-in" >/etc/depmod.d/search_path.conf
 SCRIPT
 
@@ -24,21 +26,23 @@ aptitude -y install -R \
                 build-essential dpkg-dev lintian devscripts fakeroot \
                 debhelper dh-autoreconf uuid-runtime \
                 autoconf automake libtool \
-                python-all python-twisted-core python-twisted-conch \
+                python3-all python3-twisted-core python3-twisted-conch \
                 xdg-utils groff graphviz netcat curl \
-                wget python-six ethtool \
-                libcap-ng-dev libssl-dev python-dev openssl \
-                python-pyftpdlib python-flake8 python-tftpy \
+                wget python3-six ethtool \
+                libcap-ng-dev libssl-dev python3-dev openssl \
+                python3-pyftpdlib python3-flake8 \
                 linux-headers-`uname -r` \
                 lftp
+pip-3 install tftpy             # Not yet available for Python3 via apt.
 SCRIPT
 
 $bootstrap_centos = <<SCRIPT
 yum -y update
 yum -y install autoconf automake openssl-devel libtool \
-               python-twisted-core python-zope-interface \
+               python3-twisted-core python3-zope-interface \
                desktop-file-utils groff graphviz rpmdevtools nc curl \
-               wget python-six pyftpdlib checkpolicy selinux-policy-devel \
+               wget python3-six python3-pyftpdlib checkpolicy \
+               selinux-policy-devel \
                libcap-ng-devel kernel-devel-`uname -r` ethtool net-tools \
                lftp
 SCRIPT
index 52599eefaebef19a96b5d4dd03facfee01428562..d978faa1c2feec0ba6273e07b6ac06f63df2b4b0 100644 (file)
@@ -12,7 +12,7 @@ Vagrant.require_version ">=1.7.0"
 $bootstrap_freebsd = <<SCRIPT
 sed  -e 's/\#DEFAULT_ALWAYS_YES = false/DEFAULT_ALWAYS_YES = true/g' -e 's/\#ASSUME_ALWAYS_YES = false/ASSUME_ALWAYS_YES = true/g' /usr/local/etc/pkg.conf > /tmp/pkg.conf
 mv -f /tmp/pkg.conf /usr/local/etc/pkg.conf
-pkg install automake libtool wget python py27-six gmake lftp
+pkg install automake libtool wget py37 py37-six gmake lftp
 SCRIPT
 
 $configure_ovs = <<SCRIPT
index 2e5c37a37adcea970b08b009c7af3c51f08c45af..b301227445d0fb5f53192cf7d71870299c7c0062 100644 (file)
@@ -33,7 +33,7 @@ init:
 
     cd C:\openvswitch
 
-    python -m pip install six pypiwin32 --disable-pip-version-check
+    python3 -m pip install six pypiwin32 --disable-pip-version-check
 
 build_script:
 - '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd"'
index 37ffa06b3ab379e30cfdf92c7795f62180a6b195..2c088b446943f9bddf2b2995f1aa4c162cfc9b5d 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 
 import os.path
 import sys
index 64de0f31f4a0e7ba05e99fb3b83c5fedf6104a97..2d1dbe70973f220529bc894467dae79143e8da64 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 
 import getopt
 import sys
index 03f40ea3e4c228ab33cc06110bc7d6c60b48cead..2c3fbfc881b1ee9c5d7211a681c7babd5603a082 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 
 import sys
 import os.path
index 7a4e8e1701714f5e72a399380a8f5ea2f15cf56c..8766995d9ab11bfc3074eed7881fc9be7533bada 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 
 import getopt
 import sys
index 3d50724aebd395c4d83dccabeca1591978ddf940..6b3295cf64c2e45d65f56eea7aa5b44a896e9404 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 
 import sys
 import os.path
index 90cfaa0f7fb407e95f0dc5fc46b12b48f0c1be3c..45812bcbd70098315f96dd57ae35df2e6e5846a2 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 
 # Copyright (c) 2008, 2011, 2017 Nicira, Inc.
 #
index 53ca640739fe4e712acb629830dbe12404098fe1..00adcf47a356c2db1f15aff1ef1545c42ff9ebe9 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 
 # Copyright (c) 2008, 2017 Nicira, Inc.
 #
index cb1f256f177511bad3c5d2b32bd1d8620716cc5c..dca58648b90ca0a260aaf6eafbc24ec135ecd4d7 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 
 import re
 import sys
index bd4e87928e4f4d53b699979388bcb4c6df558123..ee5553f4564e6808324ccdd1605e4354d966e89d 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 
 # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
 #
index 1d45c4fdd1531327e15b6d857490e2d3311a5a42..afd1e83450eb1cc47002a884023af85186b3a57e 100644 (file)
@@ -92,9 +92,8 @@ OVS_CHECK_NETLINK
 OVS_CHECK_OPENSSL
 OVS_CHECK_LIBCAPNG
 OVS_CHECK_LOGDIR
-OVS_CHECK_PYTHON2
 OVS_CHECK_PYTHON3
-OVS_CHECK_PYTHON
+OVS_CHECK_SIX
 OVS_CHECK_FLAKE8
 OVS_CHECK_SPHINX
 OVS_CHECK_DOT
index 441a8ffb702dd21233d69996b9d6c35aad9e67c9..d02526b21fa7739a4375743f1bce26964800c5df 100644 (file)
@@ -23,4 +23,5 @@
 /openvswitch-testcontroller
 /openvswitch-vtep
 /python-openvswitch
+/python3-openvswitch
 /tmp
index 03a1d68c26357ee8f0f0fdc373c92d317d7e9b68..37b1a243390c1bc02dfc42e6ec7bb588bafb30e1 100644 (file)
@@ -52,8 +52,8 @@ EXTRA_DIST += \
        debian/openvswitch-vtep.init \
        debian/openvswitch-vtep.install \
        debian/openvswitch-vtep.manpages \
-       debian/python-openvswitch.dirs \
-       debian/python-openvswitch.install \
+       debian/python3-openvswitch.dirs \
+       debian/python3-openvswitch.install \
        debian/rules \
        debian/rules.modules \
        debian/ifupdown.sh \
index 2ad35f2cea6fdcac1300b5f594f00875fab12f14..ad4b187860f36a3de087374d36e77617086db33f 100644 (file)
@@ -13,10 +13,10 @@ Build-Depends: graphviz,
                libtool,
                openssl,
                procps,
-               python-all (>= 2.7),
-               python-twisted-conch,
-               python-zopeinterface,
-               python-six,
+               python3-all,
+               python3-twisted-conch,
+               python3-zopeinterface,
+               python3-six,
                libunbound-dev
 Standards-Version: 3.9.3
 Homepage: http://openvswitch.org/
@@ -41,7 +41,7 @@ Description: Open vSwitch datapath module source - module-assistant version
 
 Package: openvswitch-datapath-dkms
 Architecture: all
-Depends: dkms (>= 1.95), libc6-dev, libelf-dev, make, ${misc:Depends}, ${python:Depends}
+Depends: dkms (>= 1.95), libc6-dev, libelf-dev, make, ${misc:Depends}, ${python3:Depends}
 Description: Open vSwitch datapath module source - DKMS version
  Open vSwitch is a production quality, multilayer, software-based,
  Ethernet virtual switch. It is designed to enable massive network
@@ -58,8 +58,8 @@ Description: Open vSwitch datapath module source - DKMS version
 Package: openvswitch-common
 Architecture: linux-any
 Multi-Arch: foreign
-Depends: python (>= 2.7),
-         python-six,
+Depends: python3,
+         python3-six,
          libopenvswitch (= ${binary:Version}),
          ${misc:Depends},
          ${shlibs:Depends}
@@ -102,10 +102,9 @@ Depends: kmod | module-init-tools,
          netbase,
          openvswitch-common (= ${binary:Version}),
          procps,
-         python-argparse,
          uuid-runtime,
          ${misc:Depends},
-         ${python:Depends},
+         ${python3:Depends},
          ${shlibs:Depends}
 Description: Open vSwitch switch implementations
  Open vSwitch is a production quality, multilayer, software-based,
@@ -171,10 +170,10 @@ Description: Debug symbols for Open vSwitch packages
  packages.  Install it to debug one of them or to examine a core dump
  produced by one of them.
 
-Package: python-openvswitch
+Package: python3-openvswitch
 Architecture: all
 Section: python
-Depends: ${misc:Depends}, ${python:Depends}, python-six
+Depends: ${misc:Depends}, ${python3:Depends}, python3-six
 Description: Python bindings for Open vSwitch
  Open vSwitch is a production quality, multilayer, software-based,
  Ethernet virtual switch. It is designed to enable massive network
@@ -188,10 +187,10 @@ Description: Python bindings for Open vSwitch
 
 Package: openvswitch-test
 Architecture: all
-Depends: python (>= 2.7) | python-argparse,
-         python-twisted-web,
+Depends: python3,
+         python3-twisted-web,
          ${misc:Depends},
-         ${python:Depends}
+         ${python3:Depends}
 Description: Open vSwitch test package
  Open vSwitch is a production quality, multilayer, software-based,
  Ethernet virtual switch. It is designed to enable massive network
@@ -208,8 +207,8 @@ Package: openvswitch-vtep
 Architecture: linux-any
 Depends: openvswitch-common (>= ${binary:Version}),
          openvswitch-switch (>= ${binary:Version}),
-         python,
-         python-openvswitch (>= ${source:Version}),
+         python3,
+         python3-openvswitch (>= ${source:Version}),
          ${misc:Depends},
          ${shlibs:Depends}
 Description: Open vSwitch VTEP utilities
@@ -250,8 +249,8 @@ Architecture: linux-any
 Depends: iproute2,
          openvswitch-common (= ${binary:Version}),
          openvswitch-switch (= ${binary:Version}),
-         python,
-         python-openvswitch (= ${source:Version}),
+         python3,
+         python3-openvswitch (= ${source:Version}),
          strongswan,
          ${misc:Depends},
          ${shlibs:Depends}
index 8a01a51259b724f438d966a2f0dfa0794d85a1f4..cb371c906d9428c3495540d6b7fb0132c84f45c2 100644 (file)
@@ -1,3 +1,3 @@
 usr/bin/ovs-l3ping
 usr/bin/ovs-test
-usr/share/openvswitch/python/ovstest usr/lib/python2.7/dist-packages/
+usr/share/openvswitch/python/ovstest usr/lib/python3.7/dist-packages/
diff --git a/debian/python-openvswitch.dirs b/debian/python-openvswitch.dirs
deleted file mode 100644 (file)
index cbf0de3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/share/pyshared/ovs/
-usr/share/pyshared/ovs/db/
diff --git a/debian/python-openvswitch.install b/debian/python-openvswitch.install
deleted file mode 100644 (file)
index 0472d41..0000000
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/openvswitch/python/ovs usr/lib/python2.7/dist-packages/
diff --git a/debian/python3-openvswitch.dirs b/debian/python3-openvswitch.dirs
new file mode 100644 (file)
index 0000000..cbf0de3
--- /dev/null
@@ -0,0 +1,2 @@
+usr/share/pyshared/ovs/
+usr/share/pyshared/ovs/db/
diff --git a/debian/python3-openvswitch.install b/debian/python3-openvswitch.install
new file mode 100644 (file)
index 0000000..7ba956e
--- /dev/null
@@ -0,0 +1 @@
+usr/share/openvswitch/python/ovs usr/lib/python3.7/dist-packages/
index 77f3a19841e56c115139de67275a9f57e0d1d4e9..4dc05c39ba6cf3e40abcb799f5c92cf22bea6d4d 100755 (executable)
@@ -22,7 +22,7 @@ PARALLEL =
 endif
 
 %:
-       dh $@ --with autoreconf,python2 --parallel
+       dh $@ --with autoreconf,python3 --parallel
 
 # use --as-needed only if supported by dh-autoreconf (to simplify backporting)
 DH_AS_NEEDED=$(shell dpkg --compare-versions $$(dpkg --status dh-autoreconf | grep Version | cut -d' ' -f2) ge 6 && echo --as-needed)
index 18cc649899f8c6b36ee585e3214d6ca110a9f228..a1d75756c9d7ed74a35fd54b90fc23e98e1eb43a 100644 (file)
@@ -12,7 +12,6 @@ openflowinclude_HEADERS = \
        include/openflow/openflow-common.h \
        include/openflow/openflow.h
 
-if HAVE_PYTHON
 SUFFIXES += .h .hstamp
 
 .h.hstamp:
@@ -23,7 +22,6 @@ HSTAMP_FILES = $(openflowinclude_HEADERS:.h=.hstamp)
 CLEANFILES += $(HSTAMP_FILES)
 ALL_LOCAL += $(HSTAMP_FILES)
 $(HSTAMP_FILES): build-aux/check-structs $(openflowinclude_HEADERS)
-endif
 
 EXTRA_DIST += build-aux/check-structs
 
index 4710be039ac714a7a753b6bd462bd49cd5f654bf..37e370324562426f648f17c63b134983dd74a5b9 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 # Copyright (c) 2017 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
index ba912e58780a0dee3d12e44119d7b7313aba5a1f..78d70fb4e17eb3cd43d14ac2dc2efb9f18810d99 100644 (file)
@@ -354,57 +354,16 @@ dnl Checks for valgrind/valgrind.h.
 AC_DEFUN([OVS_CHECK_VALGRIND],
   [AC_CHECK_HEADERS([valgrind/valgrind.h])])
 
-dnl Checks for Python 2.x, x >= 7.
-AC_DEFUN([OVS_CHECK_PYTHON2],
-  [AC_CACHE_CHECK(
-     [for Python 2.x for x >= 7],
-     [ovs_cv_python2],
-     [if test -n "$PYTHON2"; then
-        ovs_cv_python2=$PYTHON2
-      else
-        ovs_cv_python2=no
-        for binary in python2 python2.7 python; do
-          ovs_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-          for dir in $PATH; do
-            IFS=$ovs_save_IFS
-            test -z "$dir" && dir=.
-            if test -x "$dir"/"$binary" && "$dir"/"$binary" -c 'import sys
-if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
-    sys.exit(0)
-else:
-    sys.exit(1)'; then
-              ovs_cv_python2=$dir/$binary
-              break 2
-            fi
-          done
-        done
-        if test "$ovs_cv_python2" != no && test -x "$ovs_cv_python2"; then
-          if ! "$ovs_cv_python2" -c 'import six ; six.moves.range' >&AS_MESSAGE_LOG_FD 2>&1; then
-            ovs_cv_python2=no
-            AC_MSG_WARN([Missing Python six library or version too old.])
-          fi
-        fi
-      fi])
-   AC_SUBST([HAVE_PYTHON2])
-   AM_MISSING_PROG([PYTHON2], [python2])
-   if test "$ovs_cv_python2" != no; then
-     PYTHON2=$ovs_cv_python2
-     HAVE_PYTHON2=yes
-   else
-     HAVE_PYTHON2=no
-   fi
-   AM_CONDITIONAL([HAVE_PYTHON2], [test "$HAVE_PYTHON2" = yes])])
-
-dnl Checks for Python 3.x, x >= 4.
+dnl Checks for Python 3.4 or later.
 AC_DEFUN([OVS_CHECK_PYTHON3],
   [AC_CACHE_CHECK(
-     [for Python 3.x for x >= 4],
+     [for Python 3 (version 3.4 or later)],
      [ovs_cv_python3],
      [if test -n "$PYTHON3"; then
         ovs_cv_python3=$PYTHON3
       else
         ovs_cv_python3=no
-        for binary in python3 python3.4; do
+        for binary in python3 python3.4 python3.5 python3.6 python3.7; do
           ovs_save_IFS=$IFS; IFS=$PATH_SEPARATOR
           for dir in $PATH; do
             IFS=$ovs_save_IFS
@@ -419,46 +378,24 @@ else:
             fi
           done
         done
-        if test "$ovs_cv_python3" != no; then
-          if test -x "$ovs_cv_python3" && ! "$ovs_cv_python3" -c 'import six' >/dev/null 2>&1; then
-            ovs_cv_python3=no
-            AC_MSG_WARN([Missing Python six library.])
-          fi
-        fi
       fi])
-   AC_SUBST([HAVE_PYTHON3])
-   AM_MISSING_PROG([PYTHON3], [python3])
-   if test "$ovs_cv_python3" != no; then
-     PYTHON3=$ovs_cv_python3
-     HAVE_PYTHON3=yes
-   else
-     HAVE_PYTHON3=no
+   if test "$ovs_cv_python3" = no; then
+     AC_MSG_ERROR([Python 3.4 or later is required but not found in $PATH, please install it or set $PYTHON3 to point to it])
    fi
-   AM_CONDITIONAL([HAVE_PYTHON3], [test "$HAVE_PYTHON3" = yes])])
-
-dnl Checks if you have any compatible Python version installed.
-dnl Python 2.7+ has the preference to 3.4+
-AC_DEFUN([OVS_CHECK_PYTHON],
-  [AC_CACHE_CHECK(
-     [for Python 2 or 3],
-     [ovs_cv_python],
-     [if test -n "$PYTHON"; then
-        ovs_cv_python=$PYTHON
+   AC_ARG_VAR([PYTHON3])
+   PYTHON3=$ovs_cv_python3])
+
+dnl Checks for python six library.
+AC_DEFUN([OVS_CHECK_SIX],
+  [AC_REQUIRE([OVS_CHECK_PYTHON3])
+   AC_CACHE_CHECK(
+     [where Python six library is available],
+     [ovs_cv_six],
+     [if $PYTHON3 -c 'import six' >/dev/null 2>&1; then
+        ovs_cv_six=yes
       else
-        ovs_cv_python=no
-        if test "$ovs_cv_python2" != no; then
-          ovs_cv_python=$ovs_cv_python2
-        elif test "$ovs_cv_python3" != no; then
-          ovs_cv_python=$ovs_cv_python3
-        else
-          AC_MSG_ERROR([Missing Python.])
-        fi
-      fi])
-    AC_SUBST([PYTHON])
-    PYTHON=$ovs_cv_python
-    AC_SUBST([HAVE_PYTHON])
-    HAVE_PYTHON=yes
-    AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])])
+        AC_MSG_ERROR([Missing Python six library.])
+      fi])])
 
 dnl Checks for flake8.
 AC_DEFUN([OVS_CHECK_FLAKE8],
index a66d109e347fcbb55999b41e1db060bc3022de7f..b43deaef1ae570be540b162a8b16d74c9c649e43 100644 (file)
@@ -116,12 +116,6 @@ lib/vlog-syn.man:
 lib/vlog.man:
 ovsdb/ovsdb-schemas.man:
 
-utilities/bugtool/ovs-bugtool.8: \
-       utilities/bugtool/ovs-bugtool.8.in \
-       lib/ovs.tmac
-utilities/bugtool/ovs-bugtool.8.in:
-lib/ovs.tmac:
-
 utilities/ovs-appctl.8: \
        utilities/ovs-appctl.8.in \
        lib/common.man \
index 8eea6172455dda9e5e86a0084c99adc89837b878..41b986c0ac7fb73f27984b728a2289f94b405328 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 
 from datetime import date
 import ovs.db.error
index 22d0a4e22ed7d116d691d275fa3dd71c69b1d2b0..c285ee4b3c100b28ce4fa20aa9697ac5ade0d6bf 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 
 from __future__ import print_function
 import getopt
index 5a1e1da8a79a8eba1e07092f9e891ecd14f5775a..2f08c77014845ed27a6dd8f9e9d775b26bea41dd 100644 (file)
@@ -69,7 +69,6 @@ FLAKE8_PYFILES += \
        python/build/nroff.py \
        python/ovs/dirs.py.template
 
-if HAVE_PYTHON
 nobase_pkgdata_DATA = $(ovs_pyfiles) $(ovstest_pyfiles)
 ovs-install-data-local:
        $(MKDIR_P) python/ovs
@@ -88,14 +87,10 @@ ovs-install-data-local:
        rm python/ovs/dirs.py.tmp
 
 python-sdist: $(srcdir)/python/ovs/version.py $(ovs_pyfiles) python/ovs/dirs.py
-       (cd python/ && $(PYTHON) setup.py sdist)
+       (cd python/ && $(PYTHON3) setup.py sdist)
 
 pypi-upload: $(srcdir)/python/ovs/version.py $(ovs_pyfiles) python/ovs/dirs.py
-       (cd python/ && $(PYTHON) setup.py sdist upload)
-else
-ovs-install-data-local:
-       @:
-endif
+       (cd python/ && $(PYTHON3) setup.py sdist upload)
 install-data-local: ovs-install-data-local
 
 UNINSTALL_LOCAL += ovs-uninstall-local
index 614c5f9f08ea8811dd59efb56520bfce85dd5fac..fc113c9f1642a65b3774a45ec6b7274182647042 100644 (file)
 %define _rundir /run
 %endif
 
-# define the python package prefix based on distribution version so that we can
-# simultaneously support RHEL-based and later Fedora versions in this spec file.
-%if 0%{?fedora} >= 25
-%define _py2 python2
-%endif
-
-%if 0%{?rhel} || 0%{?fedora} < 25
-%define _py2 python
-%endif
-
-
 Name: openvswitch
 Summary: Open vSwitch
 Group: System Environment/Daemons
@@ -72,7 +61,6 @@ Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
 BuildRequires: gcc gcc-c++
 BuildRequires: autoconf automake libtool
 BuildRequires: systemd-units openssl openssl-devel
-BuildRequires: %{_py2}-devel
 %if 0%{?fedora} > 22 || %{with build_python3}
 BuildRequires: python3-devel
 %endif
@@ -81,7 +69,6 @@ BuildRequires: groff graphviz
 BuildRequires: checkpolicy, selinux-policy-devel
 BuildRequires: /usr/bin/sphinx-build-3
 # make check dependencies
-BuildRequires: %{_py2}-twisted%{?rhel:-core} %{_py2}-zope-interface %{_py2}-six
 BuildRequires: procps-ng
 %if %{with libcapng}
 BuildRequires: libcap-ng libcap-ng-devel
@@ -122,16 +109,6 @@ Requires: selinux-policy-targeted
 %description selinux-policy
 Tailored Open vSwitch SELinux policy
 
-%package -n %{_py2}-openvswitch
-Summary: Open vSwitch python2 bindings
-License: ASL 2.0
-BuildArch: noarch
-Requires: %{_py2}
-Requires: %{_py2}-six
-%{?python_provide:%python_provide python2-openvswitch = %{version}-%{release}}
-%description -n %{_py2}-openvswitch
-Python bindings for the Open vSwitch database
-
 %if 0%{?fedora} > 22 || %{with build_python3}
 %package -n python3-openvswitch
 Summary: Open vSwitch python3 bindings
@@ -149,8 +126,6 @@ Python bindings for the Open vSwitch database
 Summary: Open vSwitch testing utilities
 License: ASL 2.0
 BuildArch: noarch
-Requires: %{_py2}-openvswitch = %{version}-%{release}
-Requires: %{_py2} %{_py2}-netifaces %{_py2}-twisted
 
 %description test
 Utilities that are useful to diagnose performance and connectivity
@@ -179,7 +154,7 @@ service.
 %package ipsec
 Summary: Open vSwitch IPsec tunneling support
 License: ASL 2.0
-Requires: openvswitch %{_py2}-openvswitch libreswan
+Requires: openvswitch python3-openvswitch libreswan
 
 %description ipsec
 This package provides IPsec tunneling support for OVS tunnels.
@@ -201,12 +176,7 @@ This package provides IPsec tunneling support for OVS tunnels.
         --disable-static \
         --enable-shared \
         --with-pkidir=%{_sharedstatedir}/openvswitch/pki \
-%if 0%{?fedora} > 22 || %{with build_python3}
-        PYTHON3=%{__python3} \
-        PYTHON=%{__python2}
-%else
-        PYTHON=%{__python}
-%endif
+        PYTHON3=%{__python3}
 
 build-aux/dpdkstrip.py \
 %if %{with dpdk}
@@ -274,13 +244,9 @@ install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
         $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
 
-install -d -m 0755 $RPM_BUILD_ROOT%{python2_sitelib}
-cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
-   $RPM_BUILD_ROOT%{python2_sitelib}
-
 %if 0%{?fedora} > 22 || %{with build_python3}
 install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib}
-cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ovs \
+cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
    $RPM_BUILD_ROOT%{python3_sitelib}
 %endif
 
@@ -435,9 +401,6 @@ fi
 %defattr(-,root,root)
 %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp
 
-%files -n %{_py2}-openvswitch
-%{python2_sitelib}/ovs
-
 %if 0%{?fedora} > 22 || %{with build_python3}
 %files -n python3-openvswitch
 %{python3_sitelib}/ovs
@@ -456,7 +419,7 @@ fi
 %{_mandir}/man1/ovs-pcap.1*
 %{_mandir}/man8/ovs-tcpdump.8*
 %{_mandir}/man1/ovs-tcpundump.1*
-%{python2_sitelib}/ovstest
+%{python3_sitelib}/ovstest
 
 %files devel
 %{_libdir}/lib*.so
index 556f8681cf12cd94a9bd99c61ce67603b38c5190..1dc7cd5d087af9fc5ee42461365b1af11171b1ac 100644 (file)
@@ -1,28 +1,14 @@
 # -*- shell-script -*-
 HAVE_OPENSSL='@HAVE_OPENSSL@'
 OPENSSL_SUPPORTS_SNI='@OPENSSL_SUPPORTS_SNI@'
-HAVE_PYTHON='@HAVE_PYTHON@'
-HAVE_PYTHON2='@HAVE_PYTHON2@'
-HAVE_PYTHON3='@HAVE_PYTHON3@'
 HAVE_UNBOUND='@HAVE_UNBOUND@'
 EGREP='@EGREP@'
+PYTHON3='@PYTHON3@'
 
-if test x"$PYTHON" = x; then
-    PYTHON='@PYTHON@'
-fi
-
-if test x"$PYTHON2" = x; then
-    PYTHON2='@PYTHON2@'
-fi
-
-if test x"$PYTHON3" = x; then
-    PYTHON3='@PYTHON3@'
-
-    # PYTHONCOERCECLOCALE=0 disables the Unicode compatibility warning on
-    # stderr that breaks almost any Python3 test (PEP 0538)
-    PYTHONCOERCECLOCALE=0
-    export PYTHONCOERCECLOCALE
-fi
+# PYTHONCOERCECLOCALE=0 disables the Unicode compatibility warning on
+# stderr that breaks almost any Python3 test (PEP 0538)
+PYTHONCOERCECLOCALE=0
+export PYTHONCOERCECLOCALE
 
 PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH
 export PYTHONPATH
@@ -63,7 +49,7 @@ Linux)
     # in particular the patch attached there, which was applied to glibc CVS as
     # "Restore locking in free_check." between 1.11 and 1.11.1.
     vswitchd=$abs_top_builddir/vswitchd/ovs-vswitchd
-    glibc=`ldd $vswitchd | sed -n 's/^ libc\.[^ ]* => \([^ ]*\) .*/\1/p'`
+    glibc=`ldd $vswitchd | sed -n 's/^  libc\.[^ ]* => \([^ ]*\) .*/\1/p'`
     glibc_version=`$glibc | sed -n '1s/.*version \([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/p'`
     case $glibc_version in
         2.[0-9] | 2.1[01]) mcheck=disabled ;;
@@ -116,7 +102,7 @@ FreeBSD|NetBSD)
     ;;
 esac
 
-if test x"$PYTHON3" != x && test "$IS_WIN32" = yes; then
+if test "$IS_WIN32" = yes; then
     # enables legacy windows unicode printing needed for Python3 compatibility
     # with the Python2 tests
     PYTHONLEGACYWINDOWSFSENCODING=true
@@ -126,7 +112,7 @@ if test x"$PYTHON3" != x && test "$IS_WIN32" = yes; then
 fi
 
 # Check whether to run IPv6 tests.
-$PYTHON -c '
+$PYTHON3 -c '
 import errno
 import socket
 import sys
@@ -140,7 +126,7 @@ except socket.error as e:
 case $? in
     0) HAVE_IPV6=yes ;;
     2) HAVE_IPV6=no ;;
-    *) echo "$0: unexpected error probing $PYTHON for IPv6 support" >&2 ;;
+    *) echo "$0: unexpected error probing $PYTHON3 for IPv6 support" >&2 ;;
 esac
 
 # Look for a python L7 library 'LIB' in the system. If it is found, defines
@@ -149,13 +135,9 @@ find_l7_lib()
 {
     set +x
     var=HAVE_`echo "$1" | tr '[a-z]' '[A-Z]'`
-    if test "$HAVE_PYTHON" = "yes"; then
-        result=$($PYTHON $abs_top_srcdir/tests/test-l7.py --help | grep "$1")
-        if test "x${result}" != x; then
-            eval ${var}="yes"
-        else
-            eval ${var}="no"
-        fi
+    result=$($PYTHON3 $abs_top_srcdir/tests/test-l7.py --help | grep "$1")
+    if test "x${result}" != x; then
+        eval ${var}="yes"
     else
         eval ${var}="no"
     fi
index 0b4f29486bc7a8f93346ab3b988e5c1ecca3d920..0442334ecb783e6ed240e1943109decd5d7f6d8d 100644 (file)
@@ -199,7 +199,7 @@ check-local:
 COVERAGE = coverage
 COVERAGE_FILE='$(abs_srcdir)/.coverage'
 check-pycov: all clean-pycov
-       PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
+       PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON3='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
        @cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate
        @echo
        @echo '----------------------------------------------------------------------'
index 4163c30d6dbe03d6c60de4cce218284f42192446..15ca536112e6bbc6f28ab2c054ab1013dc6bf622 100644 (file)
@@ -3,10 +3,9 @@ AT_BANNER([struct alignment checker unit tests])
 m4_define([check_structs], [$top_srcdir/build-aux/check-structs])
 m4_define([RUN_STRUCT_CHECKER], 
   [AT_KEYWORDS([check-structs])
-   AT_SKIP_IF([test $HAVE_PYTHON = no])
    AT_DATA([test.h], [$1
 ])
-   AT_CHECK_UNQUOTED([$PYTHON check_structs test.h], [$2], [$3], [$4])])
+   AT_CHECK_UNQUOTED([$PYTHON3 check_structs test.h], [$2], [$3], [$4])])
 
 AT_SETUP([check struct tail padding])
 RUN_STRUCT_CHECKER(
index fe21acdf2d222968db6a46921f535ddd1da31853..6c739477227051146a1b4bc1849555eb13267811 100755 (executable)
@@ -3,10 +3,9 @@ AT_BANNER([checkpatch])
 OVS_START_SHELL_HELPERS
 # try_checkpatch PATCH [ERRORS]
 #
-# Runs checkpatch under Python 2 and Python 3, if installed, on the given
-# PATCH, expecting the specified set of ERRORS (and warnings).
+# Runs checkpatch, if installed, on the given PATCH, expecting the
+# specified set of ERRORS (and warnings).
 try_checkpatch() {
-    AT_SKIP_IF([test $HAVE_PYTHON2 = no && test $HAVE_PYTHON3 = no])
     # Take the patch to test from $1.  Remove an initial four-space indent
     # from it and, if it is just headers with no body, add a null body.
     echo "$1" | sed 's/^    //' > test.patch
@@ -22,18 +21,12 @@ try_checkpatch() {
         : > expout
     fi
 
-    try_checkpatch__ "$HAVE_PYTHON2" "$PYTHON2"
-    try_checkpatch__ "$HAVE_PYTHON3" "$PYTHON3"
-}
-try_checkpatch__() {
-    if test $1 = no; then
-        :
-    elif test -s expout; then
-        AT_CHECK([$2 $top_srcdir/utilities/checkpatch.py -q test.patch],
+    if test -s expout; then
+        AT_CHECK([$PYTHON3 $top_srcdir/utilities/checkpatch.py -q test.patch],
                  [1], [stdout])
         AT_CHECK([sed '/^Lines checked:/,$d' stdout], [0], [expout])
     else
-        AT_CHECK([$2 $top_srcdir/utilities/checkpatch.py -q test.patch])
+        AT_CHECK([$PYTHON3 $top_srcdir/utilities/checkpatch.py -q test.patch])
     fi
 }
 OVS_END_SHELL_HELPERS
index 6adea3c85dfc4ba62a65912b8f1f97346beb20dc..883e45a5ac213394f2462b6894a31d15e6bd8a7c 100644 (file)
-AT_BANNER([daemon unit tests - Python])
-
-m4_define([DAEMON_PYN],
-  [AT_SETUP([daemon - $1])
-   AT_SKIP_IF([test $2 = no])
-   # Skip this test for Windows, echo $! gives shell pid instead of parent process
-   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-   AT_KEYWORDS([python daemon])
-
-   on_exit 'kill $(cat *.pid)'
-   pidfile=test-daemon.py.pid
-
-   # Start the daemon and wait for the pidfile to get created
-   # and that its contents are the correct pid.
-   AT_CHECK([$3 $srcdir/test-daemon.py --pidfile & echo $!], [0], [stdout])
-   pid=$(cat stdout)
-
-   OVS_WAIT_UNTIL([test -s $pidfile], [kill $pid])
-   AT_CHECK([test $pid = $(cat $pidfile)])
-   AT_CHECK([kill -0 $pid])
-
-   # Kill the daemon and make sure that the pidfile gets deleted.
-   kill $pid
-   OVS_WAIT_WHILE([kill -0 $pid])
-   AT_CHECK([test ! -e $pidfile])
-   AT_CLEANUP])
-
-DAEMON_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([DAEMON_MONITOR_PYN],
-  [AT_SETUP([daemon --monitor - $1])
-   AT_SKIP_IF([test $2 = no])
-
-   # Skip this test for Windows, echo $! gives shell pid instead of parent process
-   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-
-   on_exit 'kill $(cat *.pid)'
-   pidfile=test-daemon.py.pid
-
-   # Start the daemon and wait for the pidfile to get created.
-   AT_CHECK([$3 $srcdir/test-daemon.py --pidfile --monitor & echo $!], [0], [stdout])
-   monitor=$(cat stdout)
-   OVS_WAIT_UNTIL([test -s $pidfile])
-   child=$(cat $pidfile)
-
-   # Check that the pidfile names a running process,
-   # and that the parent process of that process is our child process.
-   check_ancestors $child $monitor
-
-   # Kill the daemon process, making it look like a segfault,
-   # and wait for a new child process to get spawned.
-   AT_CHECK([kill -SEGV $child])
-   OVS_WAIT_WHILE([kill -0 $child])
-   OVS_WAIT_UNTIL([test -s $pidfile && test $(cat $pidfile) != $child])
-   child2=$(cat $pidfile)
-
-   # Check that the pidfile names a running process,
-   # and that the parent process of that process is our child process.
-   check_ancestors $child2 $monitor
-
-   # Kill the daemon process with SIGTERM, and wait for the daemon
-   # and the monitor processes to go away and the pidfile to get deleted.
-   AT_CHECK([kill $child2])
-   OVS_WAIT_WHILE([kill -0 $monitor || kill -0 $child2 || test -e $pidfile])
-   AT_CLEANUP])
-
-DAEMON_MONITOR_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_MONITOR_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([DAEMON_MONITOR_RESTART_PYN],
-  [AT_SETUP([daemon --monitor restart exit code - $1])
-   AT_SKIP_IF([test $2 = no])
-   # Skip this test for Windows, echo $! gives shell pid instead of parent process
-   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-
-   on_exit 'kill $(cat *.pid)'
-   pidfile=test-daemon.py.pid
-
-   # Start the daemon and wait for the pidfile to get created.
-   AT_CHECK([$3 $srcdir/test-daemon.py --pidfile --monitor & echo $!], [0], [stdout])
-   monitor=$(cat stdout)
-   OVS_WAIT_UNTIL([test -s $pidfile])
-   child=$(cat $pidfile)
-
-   # Check that the pidfile names a running process,
-   # and that the parent process of that process is our child process.
-   check_ancestors $child $monitor
-
-   # HUP the daemon process causing it to throw an exception,
-   # and wait for a new child process to get spawned.
-   AT_CHECK([kill -HUP $child])
-   OVS_WAIT_WHILE([kill -0 $child])
-   OVS_WAIT_UNTIL([test -s $pidfile && test $child != $(cat $pidfile)])
-   child2=$(cat $pidfile)
-
-   # Check that the pidfile names a running process,
-   # and that the parent process of that process is our child process.
-   check_ancestors $child2 $monitor
-
-   # Kill the daemon process with SIGTERM, and wait for the daemon
-   # and the monitor processes to go away and the pidfile to get deleted.
-   AT_CHECK([kill $child2])
-   OVS_WAIT_WHILE([kill -0 $monitor || kill -0 $child2 || test -e $pidfile])
-   AT_CLEANUP])
-
-DAEMON_MONITOR_RESTART_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_MONITOR_RESTART_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([DAEMON_DETACH_PYN],
-  [AT_SETUP([daemon --detach - $1])
-   AT_SKIP_IF([test $2 = no])
-
-   # Skip this test for Windows, the pid file not removed if the daemon is killed
-   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-
-   on_exit 'kill $(cat *.pid)'
-   pidfile=test-daemon.py.pid
-
-   # Start the daemon and make sure that the pidfile exists immediately.
-   # We don't wait for the pidfile to get created because the daemon is
-   # supposed to do so before the parent exits.
-   AT_CHECK([$3 $srcdir/test-daemon.py --pidfile --detach --no-chdir], [0])
-   AT_CHECK([test -s $pidfile])
-   pid=$(cat $pidfile)
-   check_ancestors $pid 1
-
-   # Kill the daemon and make sure that the pidfile gets deleted.
-   AT_CHECK([kill $pid])
-   OVS_WAIT_WHILE([kill -0 $pid])
-   AT_CHECK([test ! -e $pidfile])
-   AT_CLEANUP])
-
-DAEMON_DETACH_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_DETACH_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([DAEMON_DETACH_MONITOR_PYN],
-  [AT_SETUP([daemon --detach --monitor - $1])
-   AT_SKIP_IF([test $2 = no])
-
-   # Skip this test for Windows, uses Linux specific kill signal
-   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-
-   on_exit 'kill $(cat *.pid)'
-   pidfile=test-daemon.py.pid
-
-   # Start the daemon and make sure that the pidfile exists immediately.
-   # We don't wait for the pidfile to get created because the daemon is
-   # supposed to do so before the parent exits.
-   AT_CHECK([$3 $srcdir/test-daemon.py --pidfile --detach --no-chdir --monitor], [0])
-   AT_CHECK([test -s $pidfile])
-   child=$(cat $pidfile)
-   AT_CHECK([parent_pid $child], [0], [stdout])
-   monitor=$(cat stdout)
-
-   # Check that the pidfile names a running process,
-   # and that the parent process of that process is a running process,
-   # and that the parent process of that process is init.
-   check_ancestors $child $monitor 1
-
-   # Kill the daemon process, making it look like a segfault,
-   # and wait for a new daemon process to get spawned.
-   AT_CHECK([kill -SEGV $child])
-   OVS_WAIT_WHILE([kill -0 $child])
-   OVS_WAIT_UNTIL([test -s $pidfile && test $(cat $pidfile) != $child])
-   child2=$(cat $pidfile)
-
-   # Check that the pidfile names a running process,
-   # and that the parent process of that process is our child process.
-   check_ancestors $child2 $monitor 1
-
-   # Kill the daemon process with SIGTERM, and wait for the daemon
-   # and the monitor processes to go away and the pidfile to get deleted.
-   AT_CHECK([kill $child2])
-   OVS_WAIT_WHILE([kill -0 $child2 || kill -0 $monitor || test -e $pidfile])
-   AT_CLEANUP])
-
-DAEMON_DETACH_MONITOR_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_DETACH_MONITOR_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([DAEMON_DETACH_ERRORS_PYN],
-  [AT_SETUP([daemon --detach startup errors - $1])
-   AT_SKIP_IF([test $2 = no])
-   AT_CHECK([$3 $srcdir/test-daemon.py --pidfile --detach --no-chdir --bail], [1], [], [stderr])
-   AT_CHECK([grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr],
-     [0], [ignore])
-   AT_CHECK([test ! -s test-daemon.py.pid])
-   AT_CLEANUP])
-
-DAEMON_DETACH_ERRORS_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_DETACH_ERRORS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([DAEMON_DETACH_MONITOR_ERRORS_PYN],
-  [AT_SETUP([daemon --detach --monitor startup errors - $1])
-   AT_SKIP_IF([test $2 = no])
-   AT_CAPTURE_FILE([pid])
-   AT_CHECK([$3 $srcdir/test-daemon.py --pidfile --detach --no-chdir --monitor --bail], [1], [], [stderr])
-   AT_CHECK([grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr],
-     [0], [ignore])
-   AT_CHECK([test ! -s test-daemon.py.pid])
-   AT_CLEANUP])
-
-DAEMON_DETACH_MONITOR_ERRORS_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_DETACH_MONITOR_ERRORS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([DAEMON_DETACH_CLOSES_FDS_PYN],
-  [AT_SETUP([daemon --detach closes standard fds - $1])
-   AT_SKIP_IF([test $2 = no])
-
-   # Skip this test for Windows, uses Linux specific kill signal
-   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-
-   AT_CHECK([(yes 2>stderr; echo $? > status) | $3 $srcdir/test-daemon.py --pidfile --detach --no-chdir])
-   AT_CHECK([kill $(cat test-daemon.py.pid)])
-   AT_CHECK([test -s status])
-   if grep '[[bB]]roken pipe' stderr >/dev/null 2>&1; then
-     # Something in the environment caused SIGPIPE to be ignored, but
-     # 'yes' at least told us that it got EPIPE.  Good enough; we know
-     # that stdout was closed.
-     :
-   else
-     # Otherwise make sure that 'yes' died from SIGPIPE.
-     AT_CHECK([kill -l `cat status`], [0], [PIPE
+AT_BANNER([daemon unit tests - Python3])
+
+AT_SETUP([daemon - Python3])
+# Skip this test for Windows, echo $! gives shell pid instead of parent process
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+AT_KEYWORDS([python daemon])
+
+on_exit 'kill $(cat *.pid)'
+pidfile=test-daemon.py.pid
+
+# Start the daemon and wait for the pidfile to get created
+# and that its contents are the correct pid.
+AT_CHECK([$PYTHON3 $srcdir/test-daemon.py --pidfile & echo $!], [0], [stdout])
+pid=$(cat stdout)
+
+OVS_WAIT_UNTIL([test -s $pidfile], [kill $pid])
+AT_CHECK([test $pid = $(cat $pidfile)])
+AT_CHECK([kill -0 $pid])
+
+# Kill the daemon and make sure that the pidfile gets deleted.
+kill $pid
+OVS_WAIT_WHILE([kill -0 $pid])
+AT_CHECK([test ! -e $pidfile])
+AT_CLEANUP
+
+AT_SETUP([daemon --monitor - Python3])
+# Skip this test for Windows, echo $! gives shell pid instead of parent process
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+
+on_exit 'kill $(cat *.pid)'
+pidfile=test-daemon.py.pid
+
+# Start the daemon and wait for the pidfile to get created.
+AT_CHECK([$PYTHON3 $srcdir/test-daemon.py --pidfile --monitor & echo $!], [0], [stdout])
+monitor=$(cat stdout)
+OVS_WAIT_UNTIL([test -s $pidfile])
+child=$(cat $pidfile)
+
+# Check that the pidfile names a running process,
+# and that the parent process of that process is our child process.
+check_ancestors $child $monitor
+
+# Kill the daemon process, making it look like a segfault,
+# and wait for a new child process to get spawned.
+AT_CHECK([kill -SEGV $child])
+OVS_WAIT_WHILE([kill -0 $child])
+OVS_WAIT_UNTIL([test -s $pidfile && test $(cat $pidfile) != $child])
+child2=$(cat $pidfile)
+
+# Check that the pidfile names a running process,
+# and that the parent process of that process is our child process.
+check_ancestors $child2 $monitor
+
+# Kill the daemon process with SIGTERM, and wait for the daemon
+# and the monitor processes to go away and the pidfile to get deleted.
+AT_CHECK([kill $child2])
+OVS_WAIT_WHILE([kill -0 $monitor || kill -0 $child2 || test -e $pidfile])
+AT_CLEANUP
+
+AT_SETUP([daemon --monitor restart exit code - Python3])
+# Skip this test for Windows, echo $! gives shell pid instead of parent process
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+
+on_exit 'kill $(cat *.pid)'
+pidfile=test-daemon.py.pid
+
+# Start the daemon and wait for the pidfile to get created.
+AT_CHECK([$PYTHON3 $srcdir/test-daemon.py --pidfile --monitor & echo $!], [0], [stdout])
+monitor=$(cat stdout)
+OVS_WAIT_UNTIL([test -s $pidfile])
+child=$(cat $pidfile)
+
+# Check that the pidfile names a running process,
+# and that the parent process of that process is our child process.
+check_ancestors $child $monitor
+
+# HUP the daemon process causing it to throw an exception,
+# and wait for a new child process to get spawned.
+AT_CHECK([kill -HUP $child])
+OVS_WAIT_WHILE([kill -0 $child])
+OVS_WAIT_UNTIL([test -s $pidfile && test $child != $(cat $pidfile)])
+child2=$(cat $pidfile)
+
+# Check that the pidfile names a running process,
+# and that the parent process of that process is our child process.
+check_ancestors $child2 $monitor
+
+# Kill the daemon process with SIGTERM, and wait for the daemon
+# and the monitor processes to go away and the pidfile to get deleted.
+AT_CHECK([kill $child2])
+OVS_WAIT_WHILE([kill -0 $monitor || kill -0 $child2 || test -e $pidfile])
+AT_CLEANUP
+
+AT_SETUP([daemon --detach - Python3])
+
+# Skip this test for Windows, the pid file not removed if the daemon is killed
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+
+on_exit 'kill $(cat *.pid)'
+pidfile=test-daemon.py.pid
+
+# Start the daemon and make sure that the pidfile exists immediately.
+# We don't wait for the pidfile to get created because the daemon is
+# supposed to do so before the parent exits.
+AT_CHECK([$PYTHON3 $srcdir/test-daemon.py --pidfile --detach --no-chdir], [0])
+AT_CHECK([test -s $pidfile])
+pid=$(cat $pidfile)
+check_ancestors $pid 1
+
+# Kill the daemon and make sure that the pidfile gets deleted.
+AT_CHECK([kill $pid])
+OVS_WAIT_WHILE([kill -0 $pid])
+AT_CHECK([test ! -e $pidfile])
+AT_CLEANUP
+
+AT_SETUP([daemon --detach --monitor - Python3])
+
+# Skip this test for Windows, uses Linux specific kill signal
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+
+on_exit 'kill $(cat *.pid)'
+pidfile=test-daemon.py.pid
+
+# Start the daemon and make sure that the pidfile exists immediately.
+# We don't wait for the pidfile to get created because the daemon is
+# supposed to do so before the parent exits.
+AT_CHECK([$PYTHON3 $srcdir/test-daemon.py --pidfile --detach --no-chdir --monitor], [0])
+AT_CHECK([test -s $pidfile])
+child=$(cat $pidfile)
+AT_CHECK([parent_pid $child], [0], [stdout])
+monitor=$(cat stdout)
+
+# Check that the pidfile names a running process,
+# and that the parent process of that process is a running process,
+# and that the parent process of that process is init.
+check_ancestors $child $monitor 1
+
+# Kill the daemon process, making it look like a segfault,
+# and wait for a new daemon process to get spawned.
+AT_CHECK([kill -SEGV $child])
+OVS_WAIT_WHILE([kill -0 $child])
+OVS_WAIT_UNTIL([test -s $pidfile && test $(cat $pidfile) != $child])
+child2=$(cat $pidfile)
+
+# Check that the pidfile names a running process,
+# and that the parent process of that process is our child process.
+check_ancestors $child2 $monitor 1
+
+# Kill the daemon process with SIGTERM, and wait for the daemon
+# and the monitor processes to go away and the pidfile to get deleted.
+AT_CHECK([kill $child2])
+OVS_WAIT_WHILE([kill -0 $child2 || kill -0 $monitor || test -e $pidfile])
+AT_CLEANUP
+
+AT_SETUP([daemon --detach startup errors - Python3])
+AT_CHECK([$PYTHON3 $srcdir/test-daemon.py --pidfile --detach --no-chdir --bail], [1], [], [stderr])
+AT_CHECK([grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr],
+  [0], [ignore])
+AT_CHECK([test ! -s test-daemon.py.pid])
+AT_CLEANUP
+
+AT_SETUP([daemon --detach --monitor startup errors - Python3])
+AT_CAPTURE_FILE([pid])
+AT_CHECK([$PYTHON3 $srcdir/test-daemon.py --pidfile --detach --no-chdir --monitor --bail], [1], [], [stderr])
+AT_CHECK([grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr],
+  [0], [ignore])
+AT_CHECK([test ! -s test-daemon.py.pid])
+AT_CLEANUP
+
+AT_SETUP([daemon --detach closes standard fds - Python3])
+# Skip this test for Windows, uses Linux specific kill signal
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+
+AT_CHECK([(yes 2>stderr; echo $? > status) | $PYTHON3 $srcdir/test-daemon.py --pidfile --detach --no-chdir])
+AT_CHECK([kill $(cat test-daemon.py.pid)])
+AT_CHECK([test -s status])
+if grep '[[bB]]roken pipe' stderr >/dev/null 2>&1; then
+  # Something in the environment caused SIGPIPE to be ignored, but
+  # 'yes' at least told us that it got EPIPE.  Good enough; we know
+  # that stdout was closed.
+  :
+else
+  # Otherwise make sure that 'yes' died from SIGPIPE.
+  AT_CHECK([kill -l `cat status`], [0], [PIPE
 ])
-   fi
-   AT_CLEANUP])
-
-DAEMON_DETACH_CLOSES_FDS_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_DETACH_CLOSES_FDS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([DAEMON_DETACH_MONITOR_CLOSES_FDS_PYN],
-  [AT_SETUP([daemon --detach --monitor closes standard fds - $1])
-   AT_SKIP_IF([test $2 = no])
-   # Skip this test for Windows, uses Linux specific kill signal
-   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-   AT_CHECK([(yes 2>stderr; echo $? > status) | $3 $srcdir/test-daemon.py --pidfile --detach --no-chdir], [0], [], [])
-   AT_CHECK([kill $(cat test-daemon.py.pid)])
-   AT_CHECK([test -s status])
-   if grep '[[bB]]roken pipe' stderr >/dev/null 2>&1; then
-     # Something in the environment caused SIGPIPE to be ignored, but
-     # 'yes' at least told us that it got EPIPE.  Good enough; we know
-     # that stdout was closed.
-     :
-   else
-     # Otherwise make sure that 'yes' died from SIGPIPE.
-     AT_CHECK([kill -l `cat status`], [0], [PIPE
+fi
+AT_CLEANUP
+
+AT_SETUP([daemon --detach --monitor closes standard fds - Python3])
+# Skip this test for Windows, uses Linux specific kill signal
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+AT_CHECK([(yes 2>stderr; echo $? > status) | $PYTHON3 $srcdir/test-daemon.py --pidfile --detach --no-chdir], [0], [], [])
+AT_CHECK([kill $(cat test-daemon.py.pid)])
+AT_CHECK([test -s status])
+if grep '[[bB]]roken pipe' stderr >/dev/null 2>&1; then
+  # Something in the environment caused SIGPIPE to be ignored, but
+  # 'yes' at least told us that it got EPIPE.  Good enough; we know
+  # that stdout was closed.
+  :
+else
+  # Otherwise make sure that 'yes' died from SIGPIPE.
+  AT_CHECK([kill -l `cat status`], [0], [PIPE
 ])
-   fi
-   AT_CLEANUP])
-
-DAEMON_DETACH_MONITOR_CLOSES_FDS_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-DAEMON_DETACH_MONITOR_CLOSES_FDS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+fi
+AT_CLEANUP
index 976fe7a97c98ea4232f2a15510c9c5320b7811ff..7ef32d13cb405a69b6bb3d4974a800e66405d3f3 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 
 # Copyright (c) 2009, 2010, 2011, 2012, 2015, 2017 Nicira, Inc.
 #
index 035b0095642aa386c82bee39605a2c299e005863..f4ceb284af4d48ba1031b800f2dc0f70f2d42790 100644 (file)
@@ -681,7 +681,7 @@ EOF
 }
 
 ifr_run () {
-    $PYTHON ./interface-reconfigure --root-prefix="`pwd`" --no-syslog "$@"
+    $PYTHON3 ./interface-reconfigure --root-prefix="`pwd`" --no-syslog "$@"
 }
 
 ifr_filter () {
index bfe0f1967c4a6b7fed61aa4e76f2169473fc8d54..527ce8e6403305109d5d70cf1568e68c3063d6f4 100644 (file)
@@ -8,45 +8,21 @@ m4_define([JSON_CHECK_POSITIVE_C],
 ])
    AT_CLEANUP])
 
-# JSON_CHECK_POSITIVE_PY(TITLE, INPUT, OUTPUT, TEST-JSON-ARGS,
-#                        PYTHON-CHCEK, PYTHON-BIN)
+# JSON_CHECK_POSITIVE_PY(TITLE, INPUT, OUTPUT, TEST-JSON-ARGS)
 #
 m4_define([JSON_CHECK_POSITIVE_PY],
   [AT_SETUP([$1])
    AT_KEYWORDS([json positive Python])
-   AT_SKIP_IF([test $5 = no])
    AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
    AT_CAPTURE_FILE([input])
-   AT_CHECK([$6 $srcdir/test-json.py $4 input], [0], [stdout], [])
-   AT_CHECK([cat stdout], [0], [$3
-])
-   AT_CLEANUP])
-
-m4_define([JSON_CHECK_POSITIVE_UCS4PY],
-  [AT_SETUP([$1])
-   AT_KEYWORDS([json positive Python])
-   AT_SKIP_IF([test $HAVE_PYTHON2 = no])
-   AT_XFAIL_IF([test $HAVE_PYTHON2 = yes &&
-                $PYTHON2 -c "exit(len(u'\U00010800'))"; test $? -ne 1])
-   AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
-   AT_CAPTURE_FILE([input])
-   AT_CHECK([$PYTHON2 $srcdir/test-json.py $4 input], [0], [stdout], [])
+   AT_CHECK([$PYTHON3 $srcdir/test-json.py $4 input], [0], [stdout], [])
    AT_CHECK([cat stdout], [0], [$3
 ])
    AT_CLEANUP])
 
 m4_define([JSON_CHECK_POSITIVE],
   [JSON_CHECK_POSITIVE_C([$1 - C], [$2], [$3], [$4])
-   JSON_CHECK_POSITIVE_PY([$1 - Python2], [$2], [$3], [$4],
-                          [$HAVE_PYTHON2], [$PYTHON2])
-   JSON_CHECK_POSITIVE_PY([$1 - Python3], [$2], [$3], [$4],
-                          [$HAVE_PYTHON3], [$PYTHON3])])
-
-m4_define([JSON_CHECK_POSITIVE_PY23],
-  [JSON_CHECK_POSITIVE_PY([$1 - Python2], [$2], [$3], [$4],
-                          [$HAVE_PYTHON2], [$PYTHON2])
-   JSON_CHECK_POSITIVE_PY([$1 - Python3], [$2], [$3], [$4],
-                          [$HAVE_PYTHON3], [$PYTHON3])])
+   JSON_CHECK_POSITIVE_PY([$1 - Python3], [$2], [$3], [$4])])
 
 m4_define([JSON_CHECK_NEGATIVE_C],
   [AT_SETUP([$1])
@@ -58,26 +34,21 @@ m4_define([JSON_CHECK_NEGATIVE_C],
 ])
    AT_CLEANUP])
 
-# JSON_CHECK_NEGATIVE_PY(TITLE, INPUT, OUTPUT, TEST-JSON-ARGS,
-#                        PYTHON-CHCEK, PYTHON-BIN)
+# JSON_CHECK_NEGATIVE_PY(TITLE, INPUT, OUTPUT, TEST-JSON-ARGS)
 #
 m4_define([JSON_CHECK_NEGATIVE_PY], 
   [AT_SETUP([$1])
    AT_KEYWORDS([json negative Python])
-   AT_SKIP_IF([test $5 = no])
    AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
    AT_CAPTURE_FILE([input])
-   AT_CHECK([$6 $srcdir/test-json.py $4 input], [1], [stdout], [])
+   AT_CHECK([$PYTHON3 $srcdir/test-json.py $4 input], [1], [stdout], [])
    AT_CHECK([[sed 's/^error: [^:]*:/error:/' < stdout]], [0], [$3
 ])
    AT_CLEANUP])
 
 m4_define([JSON_CHECK_NEGATIVE],
   [JSON_CHECK_NEGATIVE_C([$1 - C], [$2], [$3], [$4])
-   JSON_CHECK_NEGATIVE_PY([$1 - Python2], [$2], [$3], [$4],
-                          [$HAVE_PYTHON2], [$PYTHON2])
-   JSON_CHECK_NEGATIVE_PY([$1 - Python3], [$2], [$3], [$4],
-                          [$HAVE_PYTHON3], [$PYTHON3])])
+   JSON_CHECK_NEGATIVE_PY([$1 - Python3], [$2], [$3], [$4])])
 
 AT_BANNER([JSON -- arrays])
 
@@ -109,9 +80,6 @@ JSON_CHECK_POSITIVE([Unicode escape sequences],
 JSON_CHECK_POSITIVE_C([surrogate pairs - C],
   [[["\ud834\udd1e"]]],
   [[["𝄞"]]])
-JSON_CHECK_POSITIVE_UCS4PY([surrogate pairs - Python],
-  [[["\ud834\udd1e"]]],
-  [[["𝄞"]]])
 JSON_CHECK_NEGATIVE([a string by itself is not valid JSON], ["xxx"],
                     [error: syntax error at beginning of input])
 JSON_CHECK_NEGATIVE([end of line in quoted string],
@@ -154,15 +122,6 @@ AT_CHECK([printf '"xxx' | ovstest test-json -], [1],
 ])
 AT_CLEANUP
 
-AT_SETUP([end of input in quoted string - Python])
-AT_KEYWORDS([json negative Python])
-AT_SKIP_IF([test $HAVE_PYTHON2 = no])
-AT_CHECK([printf '"xxx' > input
-$PYTHON2 $srcdir/test-json.py input], [1],
-  [error: line 0, column 4, byte 4: unexpected end of input in quoted string
-])
-AT_CLEANUP
-
 AT_BANNER([JSON -- objects])
 
 JSON_CHECK_POSITIVE([empty object], [[{ }]], [[{}]])
@@ -227,7 +186,7 @@ JSON_CHECK_POSITIVE_C(
   [C - large integers that overflow to reals],
   [[[9223372036854775807000, -92233720368547758080000]]],
   [[[9.22337203685478e+21,-9.22337203685478e+22]]])
-JSON_CHECK_POSITIVE_PY23(
+JSON_CHECK_POSITIVE_PY(
   [large integers that overflow to reals],
   [[[9223372036854775807000, -92233720368547758080000]]],
   [[[9.223372036854776e+21,-9.223372036854776e+22]]])
@@ -252,7 +211,7 @@ JSON_CHECK_POSITIVE_C(
   [C - +/- DBL_MAX],
   [[[1.7976931348623157e+308, -1.7976931348623157e+308]]],
   [[[1.79769313486232e+308,-1.79769313486232e+308]]])
-JSON_CHECK_POSITIVE_PY23(
+JSON_CHECK_POSITIVE_PY(
   [+/- DBL_MAX],
   [[[1.7976931348623157e+308, -1.7976931348623157e+308]]],
   [[[1.7976931348623157e+308,-1.7976931348623157e+308]]])
index e75ac45510069c7039839a1554238e018f91dcb1..3a304dad8551d08eeda5f6d6aa75c7dd791aae12 100644 (file)
@@ -1,46 +1,31 @@
-AT_BANNER([JSON-RPC - Python])
+AT_BANNER([JSON-RPC - Python3])
 
-m4_define([JSONRPC_REQ_REPLY_SUCCESS_PYN],
-  [AT_SETUP([JSON-RPC request and successful reply - $1])
-   AT_SKIP_IF([test $2 = no])
-   AT_KEYWORDS([python jsonrpc])
-   AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket])
-   on_exit 'kill `cat test-jsonrpc.py.pid`'
-   AT_CHECK(
-     [[$3 $srcdir/test-jsonrpc.py request unix:socket echo '[{"a": "b", "x": null}]']], [0],
-     [[{"error":null,"id":0,"result":[{"a":"b","x":null}]}
+AT_SETUP([JSON-RPC request and successful reply - Python3])
+AT_KEYWORDS([python jsonrpc])
+AT_CHECK([$PYTHON3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket])
+on_exit 'kill `cat test-jsonrpc.py.pid`'
+AT_CHECK(
+  [[$PYTHON3 $srcdir/test-jsonrpc.py request unix:socket echo '[{"a": "b", "x": null}]']], [0],
+  [[{"error":null,"id":0,"result":[{"a":"b","x":null}]}
 ]])
-   AT_CLEANUP])
+AT_CLEANUP
 
-JSONRPC_REQ_REPLY_SUCCESS_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-JSONRPC_REQ_REPLY_SUCCESS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([JSONRPC_REQ_REPLY_ERROR_PYN],
-  [AT_SETUP([JSON-RPC request and error reply - $1])
-   AT_SKIP_IF([test $2 = no])
-   AT_KEYWORDS([python jsonrpc])
-   AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket])
-   on_exit 'kill `cat test-jsonrpc.py.pid`'
-   AT_CHECK(
-     [[$3 $srcdir/test-jsonrpc.py request unix:socket bad-request '[]']], [0],
-     [[{"error":{"error":"unknown method"},"id":0,"result":null}
+AT_SETUP([JSON-RPC request and error reply - Python3])
+AT_KEYWORDS([python jsonrpc])
+AT_CHECK([$PYTHON3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket])
+on_exit 'kill `cat test-jsonrpc.py.pid`'
+AT_CHECK(
+  [[$PYTHON3 $srcdir/test-jsonrpc.py request unix:socket bad-request '[]']], [0],
+  [[{"error":{"error":"unknown method"},"id":0,"result":null}
 ]])
-   AT_CLEANUP])
-
-JSONRPC_REQ_REPLY_ERROR_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-JSONRPC_REQ_REPLY_ERROR_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([JSONRPC_NOTIFICATION_PYN],
-  [AT_SETUP([JSON-RPC notification - $1])
-   AT_SKIP_IF([test $2 = no])
-   AT_KEYWORDS([python jsonrpc])
-   AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket])
-   on_exit 'kill `cat test-jsonrpc.py.pid`'
-   AT_CHECK([test -e test-jsonrpc.py.pid])
-   AT_CHECK([[$3 $srcdir/test-jsonrpc.py notify unix:socket shutdown '[]']])
-   # Wait for test-jsonrpc to die, based on its pidfile disappearing
-   OVS_WAIT_WHILE([test -e test-jsonrpc.py.pid])
-   AT_CLEANUP])
+AT_CLEANUP
 
-JSONRPC_NOTIFICATION_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-JSONRPC_NOTIFICATION_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_SETUP([JSON-RPC notification - Python3])
+AT_KEYWORDS([python jsonrpc])
+AT_CHECK([$PYTHON3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket])
+on_exit 'kill `cat test-jsonrpc.py.pid`'
+AT_CHECK([test -e test-jsonrpc.py.pid])
+AT_CHECK([[$PYTHON3 $srcdir/test-jsonrpc.py notify unix:socket shutdown '[]']])
+# Wait for test-jsonrpc to die, based on its pidfile disappearing
+OVS_WAIT_WHILE([test -e test-jsonrpc.py.pid])
+AT_CLEANUP
index ecb9268d40df3f465ab6967a6fea8c7c1f022457..ac4ea4abf28151afb5b4218650d64a82597f3a29 100644 (file)
@@ -1,7 +1,7 @@
 AT_BANNER([library unit tests])
 
 AT_SETUP([flow extractor])
-AT_CHECK([$PYTHON $srcdir/flowgen.py >/dev/null])
+AT_CHECK([$PYTHON3 $srcdir/flowgen.py >/dev/null])
 AT_CHECK([ovstest test-flows flows pcap], [0], [checked 247 packets, 0 errors
 ])
 AT_CLEANUP
@@ -176,37 +176,29 @@ AT_CHECK([mkdir $longname || exit 77])
 AT_CHECK([cd $longname && ovstest test-unix-socket ../$longname/socket socket])
 AT_CLEANUP
 
-m4_define([UNIX_SOCKET_SHORT_PATHNAME_PYN],
-  [AT_SETUP([unix socket, short pathname - $1])
-   AT_SKIP_IF([test $2 = no || test "$IS_WIN32" = "yes"])
-   AT_KEYWORDS([python unixsocket])
-   AT_CHECK([$3 $srcdir/test-unix-socket.py x])
-   AT_CLEANUP])
-
-UNIX_SOCKET_SHORT_PATHNAME_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-UNIX_SOCKET_SHORT_PATHNAME_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_SETUP([unix socket, short pathname - Python3])
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+AT_KEYWORDS([python unixsocket])
+AT_CHECK([$PYTHON3 $srcdir/test-unix-socket.py x])
+AT_CLEANUP
 
 dnl Unix sockets with long names are problematic because the name has to
 dnl go in a fixed-length field in struct sockaddr_un.  Generally the limit
 dnl is about 100 bytes.  On Linux, we work around this by indirecting through
 dnl a directory fd using /proc/self/fd/<dirfd>.  We do not have a workaround
 dnl for other platforms, so we skip the test there.
-m4_define([UNIX_SOCKET_LONG_PATHNAME_PYN],
-  [AT_SETUP([unix socket, long pathname - $1])
-   AT_SKIP_IF([test $2 = no || test "$IS_WIN32" = "yes"])
-   AT_KEYWORDS([python unixsocket])
-   dnl Linux sockaddr_un has a 108-byte limit, so this needs to be longer.
-   dnl Linux "ecryptfs" has a 143-byte limit, so we use that many bytes.
-   longname=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
-
-   dnl Skip the test if the directory can't be created (presumably the file
-   dnl system doesn't support such long names).
-   AT_CHECK([mkdir $longname || exit 77])
-   AT_CHECK([cd $longname && $3 $abs_srcdir/test-unix-socket.py ../$longname/socket socket])
-   AT_CLEANUP])
+AT_SETUP([unix socket, long pathname - Python3])
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+AT_KEYWORDS([python unixsocket])
+dnl Linux sockaddr_un has a 108-byte limit, so this needs to be longer.
+dnl Linux "ecryptfs" has a 143-byte limit, so we use that many bytes.
+longname=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
 
-UNIX_SOCKET_LONG_PATHNAME_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-UNIX_SOCKET_LONG_PATHNAME_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+dnl Skip the test if the directory can't be created (presumably the file
+dnl system doesn't support such long names).
+AT_CHECK([mkdir $longname || exit 77])
+AT_CHECK([cd $longname && $PYTHON3 $abs_srcdir/test-unix-socket.py ../$longname/socket socket])
+AT_CLEANUP
 
 AT_SETUP([ovs_assert])
 if test "$IS_WIN32" = "yes"; then
index b530d5782e96479e975f6a5a81e65725473880c1..8d99088580fd6c7443b282de918ec34329d821b5 100644 (file)
@@ -5394,7 +5394,7 @@ AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=
 ])
 
 # The packet should be received by port 2
-AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
+AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
@@ -5429,7 +5429,7 @@ AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=
 ])
 
 # The packet should be received by port 2
-AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
+AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
@@ -5470,7 +5470,7 @@ AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=
 ])
 
 # The packet should be received by port 1
-AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p1-tx.pcap | wc -l`])
+AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p1-tx.pcap | wc -l`])
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
@@ -5506,8 +5506,8 @@ ovs-vsctl show
 ovs-ofctl dump-flows br0
 
 # The packet should be received by port 2 and not port 3
-AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
-AT_CHECK([test 0 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p3-tx.pcap | wc -l`])
+AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
+AT_CHECK([test 0 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p3-tx.pcap | wc -l`])
 
 # NXT_RESUMEs should be 1 and reg1 should be set to 0x5.
 OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor*.log | grep NXT_RESUME | grep -c reg1=0x5`])
index a810dd6042fd361abe079ff12c6d22466393ce78..c81409d9d17cd455b3a9852837110d0a40c0a1ac 100644 (file)
@@ -4769,7 +4769,7 @@ m4_divert_push([PREPARE_TESTS])
 # past the nearest line that does not start with a space.
 [
 multiline_sort () {
-    $PYTHON -c '
+    $PYTHON3 -c '
 import sys
 
 buffer = []
@@ -5056,7 +5056,7 @@ ovs-appctl -t ovs-ofctl ofctl/block
 
 # Add $n_msgs flows.
 (echo "in_port=2,actions=output:2"
-$PYTHON -c '
+$PYTHON3 -c '
 for i in range('$n_msgs'):
     print("cookie=1,reg1=%d,actions=drop" % i)
 ') > flows.txt
index b6add7fda5e15551bde9bd5644be64765880161f..e07c4b908e0a294c00172a8d2b75bda35e58ac41 100644 (file)
@@ -184,7 +184,7 @@ wc () {
 }
 
 uuidfilt () {
-    $PYTHON "$top_srcdir"/tests/uuidfilt.py "$@"
+    $PYTHON3 "$top_srcdir"/tests/uuidfilt.py "$@"
 }
 
 # run_as PROGRAM_NAME COMMAND [ARG...]
index 2f00704ba9a85570e2cdd074cf6e16bf8b0715a1..ab96c4d53e23a4ce3a40ff242678a3cce0c943b7 100644 (file)
@@ -1,7 +1,6 @@
 AT_BANNER([ovs-xapi-sync])
 
 AT_SETUP([ovs-xapi-sync])
-AT_SKIP_IF([test $HAVE_PYTHON = no])
 
 # Mock up the XenAPI.
 cp "$top_srcdir/tests/MockXenAPI.py" XenAPI.py
@@ -26,7 +25,7 @@ ovs_vsctl () {
 OVS_VSCTL_SETUP
 
 # Start ovs-xapi-sync.
-AT_CHECK([$PYTHON ./ovs-xapi-sync "--pidfile=ovs-xapi-sync.pid" \
+AT_CHECK([$PYTHON3 ./ovs-xapi-sync "--pidfile=ovs-xapi-sync.pid" \
                   "--root-prefix=`pwd`" unix:db.sock >log 2>&1 &])
 AT_CAPTURE_FILE([log])
 
index 8c40bcfbfc2779644a39dcacf49f48a17b545a0c..8cd2a26cb3ff5bdd35a527e58a4ee4445141609a 100644 (file)
@@ -260,7 +260,7 @@ dnl
 dnl <C0> is not allowed anywhere in a UTF-8 string.
 dnl (<ED A0 80> is not allowed in UTF-8 but Python doesn't care.)
 dnl <ED 80 7F> is not allowed in UTF-8.
-OVSDB_CHECK_POSITIVE_PY([no invalid UTF-8 sequences in strings - Python],
+OVSDB_CHECK_POSITIVE_PY3([no invalid UTF-8 sequences in strings - Python],
   [parse-atoms '[["string"]]' \
      '@<:@"m4_esyscmd([printf "\300"])"@:>@' \
      '@<:@"m4_esyscmd([printf "\355\200\177"])"@:>@' \
@@ -533,12 +533,7 @@ OVSDB_CHECK_POSITIVE_CPY([strings at least 2 characters long],
 constraint violation: "a" length 1 is less than minimum allowed length 2
 "ab"
 "abc"
-constraint violation: "𝄞" length 1 is less than minimum allowed length 2]],
-  [],
-  [],
-  [dnl This test requires a wide build of Python.
-   AT_CHECK([$PYTHON -c 'unichr(0x10000)' || exit 77],
-            [0], [ignore], [ignore])])
+constraint violation: "𝄞" length 1 is less than minimum allowed length 2]])
 
 OVSDB_CHECK_POSITIVE_CPY([strings no more than 2 characters long],
   [[parse-atoms '{"type": "string", "maxLength": 2}' \
index 7c937f74276b5d31449a2e681eb31b41474b5f91..cc38d69c106ce7882b57a2dc7e07c55d41a38749 100644 (file)
@@ -112,74 +112,52 @@ m4_define([OVSDB_CHECK_IDL_TCP6_C],
    AT_CLEANUP])
 
 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation.
-m4_define([OVSDB_CHECK_IDL_PYN],
-  [AT_SETUP([$1])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_PY],
+  [AT_SETUP([$1 - Python3])
    AT_KEYWORDS([ovsdb server idl positive Python $5])
    AT_CHECK([ovsdb_start_idltest])
    m4_if([$2], [], [],
      [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
             [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
             [0], [$4])
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_PY],
-   [OVSDB_CHECK_IDL_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
-m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN],
-  [AT_SETUP([$1 - register_columns])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY],
+  [AT_SETUP([$1 - Python3 - register_columns])
    AT_KEYWORDS([ovsdb server idl positive Python register_columns $5])
    AT_CHECK([ovsdb_start_idltest])
    m4_if([$2], [], [],
      [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?link1:i,k,ka,l2?link2:i,l1?singleton:name $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?link1:i,k,ka,l2?link2:i,l1?singleton:name $3],
             [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
             [0], [$4])
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY],
-   [OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
-m4_define([OVSDB_CHECK_IDL_TCP_PYN],
-  [AT_SETUP([$1 - tcp])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_TCP_PY],
+  [AT_SETUP([$1 - Python3 - tcp])
    AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
    AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
    PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
 
    m4_if([$2], [], [],
      [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore])])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
             [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
             [0], [$4])
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_TCP_PY],
-   [OVSDB_CHECK_IDL_TCP_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_TCP_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
 # with multiple remotes with only one remote reachable
-m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN],
-  [AT_SETUP([$1 - tcp])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PY],
+  [AT_SETUP([$1 - Python3 (multiple remotes) - tcp])
    AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
    AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
    PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
@@ -188,23 +166,16 @@ m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN],
    remote=tcp:127.0.0.1:$WRONG_PORT_1,tcp:127.0.0.1:$TCP_PORT,tcp:127.0.0.1:$WRONG_PORT_2
    m4_if([$2], [], [],
      [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore])])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t20 idl $srcdir/idltest.ovsschema $remote $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t20 idl $srcdir/idltest.ovsschema $remote $3],
             [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
             [0], [$4])
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PY],
-   [OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN([$1 - Python2 (multiple remotes)], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON], [$PYTHON])
-    OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN([$1 - Python3 (multiple remotes)], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp6
-m4_define([OVSDB_CHECK_IDL_TCP6_PYN],
-  [AT_SETUP([$1 - tcp6])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_TCP6_PY],
+  [AT_SETUP([$1 - Python3 - tcp6])
    AT_SKIP_IF([test "$IS_WIN32" = "yes"])
    AT_SKIP_IF([test $HAVE_IPV6 = no])
    AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
@@ -214,22 +185,15 @@ m4_define([OVSDB_CHECK_IDL_TCP6_PYN],
 
    m4_if([$2], [], [],
      [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore])])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
             [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
             [0], [$4])
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_TCP6_PY],
-   [OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
-m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN],
-  [AT_SETUP([$1 - tcp6])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY],
+  [AT_SETUP([$1 - Python3 - tcp6])
    AT_SKIP_IF([test "$IS_WIN32" = "yes"])
    AT_SKIP_IF([test $HAVE_IPV6 = no])
    AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
@@ -240,25 +204,18 @@ m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN],
    remote="tcp:[[::1]]:$WRONG_PORT_1,tcp:[[::1]]:$TCP_PORT,tcp:[[::1]]:$WRONG_PORT_2"
    m4_if([$2], [], [],
      [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore])])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t20 idl $srcdir/idltest.ovsschema $remote $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t20 idl $srcdir/idltest.ovsschema $remote $3],
             [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
             [0], [$4])
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY],
-   [OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN([$1 - Python2 (multiple remotes)], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON], [$PYTHON])
-    OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN([$1 - Python3 (multiple remotes)], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with SSL
-m4_define([OVSDB_CHECK_IDL_SSL_PYN],
-  [AT_SETUP([$1 - SSL])
+m4_define([OVSDB_CHECK_IDL_SSL_PY],
+  [AT_SETUP([$1 - Python3 - SSL])
    AT_SKIP_IF([test "$HAVE_OPENSSL" = no])
-   AT_SKIP_IF([test $7 = no])
-   $8 -c "import OpenSSL.SSL"
+   $PYTHON3 -c "import OpenSSL.SSL"
    SSL_PRESENT=$?
    AT_SKIP_IF([test $SSL_PRESENT != 0])
    AT_KEYWORDS([ovsdb server idl positive Python with ssl socket $5])
@@ -279,7 +236,7 @@ m4_define([OVSDB_CHECK_IDL_SSL_PYN],
                 --certificate=$PKIDIR/testpki-cert2.pem \
                 --ca-cert=$PKIDIR/testpki-cacert.pem \
                 transact "ssl:127.0.0.1:$TCP_PORT" $2], [0], [ignore], [ignore])])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema \
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema \
              ssl:127.0.0.1:$TCP_PORT $PKIDIR/testpki-privkey.pem \
              $PKIDIR/testpki-cert.pem $PKIDIR/testpki-cacert.pem $3],
             [0], [stdout], [ignore])
@@ -288,12 +245,6 @@ m4_define([OVSDB_CHECK_IDL_SSL_PYN],
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_SSL_PY],
-   [OVSDB_CHECK_IDL_SSL_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON], [$PYTHON])
-    OVSDB_CHECK_IDL_SSL_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
 m4_define([OVSDB_CHECK_IDL],
   [OVSDB_CHECK_IDL_C($@)
    OVSDB_CHECK_IDL_TCP_C($@)
@@ -307,9 +258,8 @@ m4_define([OVSDB_CHECK_IDL],
    OVSDB_CHECK_IDL_SSL_PY($@)])
 
 # This test uses the Python IDL implementation with passive tcp
-m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PYN],
-  [AT_SETUP([$1 ptcp])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY],
+  [AT_SETUP([$1 - Python3 - ptcp])
    AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
    # find free TCP port
    AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
@@ -319,7 +269,7 @@ m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PYN],
 
    # start OVSDB server in passive mode
    AT_CHECK([ovsdb_start_idltest "tcp:127.0.0.1:$TCP_PORT"])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3],
       [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
             [0], [$4])
@@ -327,12 +277,6 @@ m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PYN],
    AT_CLEANUP
    ])
 
-m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY],
-    [OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
 OVSDB_CHECK_IDL_PASSIVE_TCP_PY([simple passive idl, initially empty, select empty],
   [],
   [['["idltest",{"op":"select","table":"link1","where":[]}]']],
@@ -501,14 +445,13 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode],
 003: done
 ]])
 
-m4_define([OVSDB_CHECK_IDL_PYN_WITH_EXPOUT],
-  [AT_SETUP([$1])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_PY_WITH_EXPOUT],
+  [AT_SETUP([$1 - Python3])
    AT_KEYWORDS([ovsdb server idl positive Python $5])
    AT_CHECK([ovsdb_start_idltest])
    m4_if([$2], [], [],
      [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
             [0], [stdout], [ignore])
    echo "$4" > expout
    AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
@@ -516,12 +459,6 @@ m4_define([OVSDB_CHECK_IDL_PYN_WITH_EXPOUT],
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_PY_WITH_EXPOUT],
-   [OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
-                                    [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
-                                    [$HAVE_PYTHON3], [$PYTHON3])])
-
 OVSDB_CHECK_IDL_PY_WITH_EXPOUT([simple idl, writing large data via IDL with unicode],
   [['["idltest",
       {"op": "insert",
@@ -1036,26 +973,19 @@ AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"ua"'], [0], [1
 OVSDB_SERVER_SHUTDOWN
 AT_CLEANUP
 
-m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN],
-  [AT_SETUP([$1 fetch])
-   AT_SKIP_IF([test $8 = no])
+m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY],
+  [AT_SETUP([$1 - Python3 - fetch])
    AT_KEYWORDS([ovsdb server idl positive Python increment fetch $6])
    AT_CHECK([ovsdb_start_idltest])
    m4_if([$2], [], [],
      [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
-   AT_CHECK([$9 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4],
             [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$7],,, [[| $7]]),
             [0], [$5])
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY],
-    [OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6], [$7],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6], [$7],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
 m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS],
    [OVSDB_CHECK_IDL_FETCH_COLUMNS_PY($@)])
 
@@ -1087,26 +1017,18 @@ OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated],
 003: done
 ]])
 
-m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN],
-  [AT_SETUP([$1])
-   AT_SKIP_IF([test $6 = no])
+m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY],
+  [AT_SETUP([$1 - Python3])
    AT_KEYWORDS([ovsdb server idl Python monitor $4])
    AT_CHECK([ovsdb_start_idltest])
    AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/disable-monitor-cond])
-   AT_CHECK([$7 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
             [0], [stdout], [ignore])
    AT_CHECK([sort stdout | uuidfilt]m4_if([$5],,, [[| $5]]),
             [0], [$3])
    OVSDB_SERVER_SHUTDOWN
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY],
-    [OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
-
 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND],
    [OVSDB_CHECK_IDL_WO_MONITOR_COND_PY($@)])
 
@@ -1426,28 +1348,9 @@ OVSDB_CHECK_IDL_PY([partial-set idl],
 015: done
 ]])
 
-m4_define([OVSDB_CHECK_IDL_NOTIFY_PYN],
-  [OVSDB_CHECK_IDL_PYN([$1], [], [$2], [$3], [notify $4], [$5], [$6], [$7])])
-
-m4_define([OVSDB_CHECK_IDL_NOTIFY_PY],
-    [OVSDB_CHECK_IDL_NOTIFY_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_NOTIFY_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
-# This test uses the Python IDL implementation with ssl
-m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PYN],
-  [OVSDB_CHECK_IDL_SSL_PYN([$1], [], [$2], [$3], [notify $4], [$5], [$6], [$7])])
-
-m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PY],
-    [OVSDB_CHECK_IDL_NOTIFY_SSL_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
-                        [$HAVE_PYTHON2], [$PYTHON2])
-    OVSDB_CHECK_IDL_NOTIFY_SSL_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
-                        [$HAVE_PYTHON3], [$PYTHON3])])
-
 m4_define([OVSDB_CHECK_IDL_NOTIFY],
-   [OVSDB_CHECK_IDL_NOTIFY_PY($@)
-    OVSDB_CHECK_IDL_NOTIFY_SSL_PY($@)])
+   [OVSDB_CHECK_IDL_PY([$1], [], [$2], [$3], [notify $4], [$5])
+    OVSDB_CHECK_IDL_SSL_PY([$1], [], [$2], [$3], [notify $4], [$5])])
 
 OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify],
   [['track-notify' \
@@ -1878,8 +1781,7 @@ CHECK_STREAM_OPEN_BLOCK([tcp], [127.0.0.1])
 CHECK_STREAM_OPEN_BLOCK([tcp6], [[[::1]]])
 
 m4_define([CHECK_STREAM_OPEN_BLOCK_PY],
-  [AT_SETUP([$1])
-   AT_SKIP_IF([test $2 = no])
+  [AT_SETUP([$1 - Python3])
    AT_KEYWORDS([Check PY Stream open block - $3])
    AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
    PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
@@ -1890,14 +1792,10 @@ m4_define([CHECK_STREAM_OPEN_BLOCK_PY],
    AT_CHECK([$3 $srcdir/test-stream.py tcp:127.0.0.1:$TCP_PORT], [1], [ignore])
    AT_CLEANUP])
 
-CHECK_STREAM_OPEN_BLOCK_PY([Check PY2 Stream open block], [$HAVE_PYTHON2], [$PYTHON2])
-CHECK_STREAM_OPEN_BLOCK_PY([Check PY3 Stream open block], [$HAVE_PYTHON3], [$PYTHON3])
-
 # same as OVSDB_CHECK_IDL but uses Python IDL implementation with tcp
 # with multiple remotes to assert the idl connects to the leader of the Raft cluster
-m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PYN],
-  [AT_SETUP([$1])
-   AT_SKIP_IF([test $7 = no])
+m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY],
+  [AT_SETUP([$1 - Python3 (leader only)])
    AT_KEYWORDS([ovsdb server idl Python leader_only with tcp socket])
    m4_define([LPBK],[127.0.0.1])
    AT_CHECK([ovsdb_cluster_start_idltest $2 "ptcp:0:"LPBK])
@@ -1907,18 +1805,12 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PYN],
    remotes=tcp:LPBK:$TCP_PORT_1,tcp:LPBK:$TCP_PORT_2,tcp:LPBK:$TCP_PORT_3
    pids=$(cat s2.pid s3.pid s1.pid | tr '\n' ',')
    echo $pids
-   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t30 idl-cluster $srcdir/idltest.ovsschema $remotes $pids $3],
+   AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py  -t30 idl-cluster $srcdir/idltest.ovsschema $remotes $pids $3],
         [0], [stdout], [ignore])
    remote=$(ovsdb_cluster_leader $remotes "idltest")
    leader=$(echo $remote | cut -d'|' -f 1)
    AT_CHECK([grep -F -- "${leader}" stdout], [0], [ignore])
    AT_CLEANUP])
 
-m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY],
-   [OVSDB_CHECK_IDL_LEADER_ONLY_PYN([$1 - Python2 (leader only)], [$2], [$3], [$4], [$5], [$6],
-                 [$HAVE_PYTHON], [$PYTHON])
-    OVSDB_CHECK_IDL_LEADER_ONLY_PYN([$1 - Python3 (leader only)], [$2], [$3], [$4], [$5], [$6],
-                 [$HAVE_PYTHON3], [$PYTHON3])])
-
 OVSDB_CHECK_IDL_LEADER_ONLY_PY([Check Python IDL connects to leader], 3, ['remote'])
 OVSDB_CHECK_IDL_LEADER_ONLY_PY([Check Python IDL reconnects to leader], 3, ['remote' '+remotestop' 'remote'])
index 6388947948289d0f8aa0e96365a7e00e755c681a..1613642d5a2aa831b6270e1251403990a833c3a4 100644 (file)
@@ -27,25 +27,6 @@ m4_define([OVSDB_CHECK_POSITIVE],
    AT_CLEANUP])
 
 # OVSDB_CHECK_POSITIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ],
-#                         [PY-CHECK])
-#
-# Runs "test-ovsdb.py TEST-OVSDB-ARGS" and checks that it exits with
-# status 0 and prints OUTPUT on stdout.
-#
-# PY-CHECK is expanded before the check.  It can check for features of the
-# Python implementation that are required for the test to pass.
-#
-# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
-m4_define([OVSDB_CHECK_POSITIVE_PY],
-  [AT_SETUP([$1])
-   AT_SKIP_IF([test $HAVE_PYTHON2 = no])
-   $6
-   AT_KEYWORDS([ovsdb positive Python $4])
-   AT_CHECK([$PYTHON2 $srcdir/test-ovsdb.py $2], [0], [$3
-], [])
-   AT_CLEANUP])
-
-# OVSDB_CHECK_POSITIVE_PY3(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ],
 #                          [PY-CHECK])
 #
 # Runs "test-ovsdb.py TEST-OVSDB-ARGS" and checks that it exits with
@@ -55,9 +36,8 @@ m4_define([OVSDB_CHECK_POSITIVE_PY],
 # Python implementation that are required for the test to pass.
 #
 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
-m4_define([OVSDB_CHECK_POSITIVE_PY3],
+m4_define([OVSDB_CHECK_POSITIVE_PY],
   [AT_SETUP([$1])
-   AT_SKIP_IF([test $HAVE_PYTHON3 = no])
    $6
    AT_KEYWORDS([ovsdb positive Python $4])
    AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py $2], [0], [$3
@@ -65,13 +45,12 @@ m4_define([OVSDB_CHECK_POSITIVE_PY3],
    AT_CLEANUP])
 
 # OVSDB_CHECK_POSITIVE_CPY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS],
-#                          [PREREQ], [PY2-CHECK], [PY3-CHECK])
+#                          [PREREQ], [PY3-CHECK])
 #
 # Runs identical C and Python tests, as specified.
 m4_define([OVSDB_CHECK_POSITIVE_CPY],
   [OVSDB_CHECK_POSITIVE([$1 - C], [$2], [$3], [$4], [$5])
-   OVSDB_CHECK_POSITIVE_PY([$1 - Python2], [$2], [$3], [$4], [$5], [$6])
-   OVSDB_CHECK_POSITIVE_PY3([$1 - Python3], [$2], [$3], [$4], [$5], [$7])])
+   OVSDB_CHECK_POSITIVE_PY([$1 - Python3], [$2], [$3], [$4], [$5], [$7])])
 
 # OVSDB_CHECK_NEGATIVE(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ])
 #
@@ -100,28 +79,6 @@ m4_define([OVSDB_CHECK_NEGATIVE],
 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
 m4_define([OVSDB_CHECK_NEGATIVE_PY],
   [AT_SETUP([$1])
-   AT_SKIP_IF([test $HAVE_PYTHON2 = no])
-   AT_KEYWORDS([ovsdb negative $4])
-   AT_CHECK([$PYTHON2 $srcdir/test-ovsdb.py $2], [1], [], [stderr])
-   m4_assert(m4_len([$3]))
-   AT_CHECK(
-     [if grep -F -e "AS_ESCAPE([$3])" stderr
-      then
-        :
-      else
-        exit 99
-      fi],
-            [0], [ignore], [ignore])
-   AT_CLEANUP])
-
-# OVSDB_CHECK_NEGATIVE_PY3(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ])
-#
-# Runs "test-ovsdb TEST-OVSDB-ARGS" and checks that it exits with
-# status 1 and that its output on stdout contains substring OUTPUT.
-# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
-m4_define([OVSDB_CHECK_NEGATIVE_PY],
-  [AT_SETUP([$1])
-   AT_SKIP_IF([test $HAVE_PYTHON3 = no])
    AT_KEYWORDS([ovsdb negative $4])
    AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py $2], [1], [], [stderr])
    m4_assert(m4_len([$3]))
@@ -141,8 +98,7 @@ m4_define([OVSDB_CHECK_NEGATIVE_PY],
 # Runs identical C and Python tests, as specified.
 m4_define([OVSDB_CHECK_NEGATIVE_CPY],
   [OVSDB_CHECK_NEGATIVE([$1 - C], [$2], [$3], [$4], [$5])
-   OVSDB_CHECK_NEGATIVE_PY([$1 - Python2], [$2], [$3], [$4], [$5])
-   OVSDB_CHECK_NEGATIVE_PY3([$1 - Python3], [$2], [$3], [$4], [$5])])
+   OVSDB_CHECK_NEGATIVE_PY([$1 - Python3], [$2], [$3], [$4], [$5])])
 
 OVS_START_SHELL_HELPERS
 ovsdb_client_wait() {
index eb437092c918bc7e66b144e4566eee088f48b291..3b622b3ec0598769c477f56d23e88ad09313d5db 100644 (file)
@@ -30,7 +30,7 @@ ovsdb_check_monitor () {
     done
     OVS_APP_EXIT_AND_WAIT_BY_TARGET([ovsdb-server], [ovsdb-server.pid])
     OVS_WAIT_UNTIL([test ! -e ovsdb-client.pid])
-    AT_CHECK_UNQUOTED([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [$output], [ignore])
+    AT_CHECK_UNQUOTED([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [$output], [ignore])
 }
 OVS_END_SHELL_HELPERS
 
@@ -105,7 +105,7 @@ m4_define([OVSDB_CHECK_MONITOR_COND],
             [ignore], [ignore])
    AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
    OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
-   AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [$7], [ignore])
+   AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [$7], [ignore])
    AT_CLEANUP])
 
 OVSDB_CHECK_MONITOR([monitor insert into empty table],
@@ -649,7 +649,7 @@ AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
          [ignore], [ignore])
 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
-AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [[row,action,name
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [[row,action,name
 <0>,insert,"""ten"""
 
 row,action,name
@@ -701,7 +701,7 @@ AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
          [ignore], [ignore])
 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
-AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
          [[found: false, last_id: <0>
 row,action,name,number,_version
 <1>,initial,"""one""",1,"[""uuid"",""<2>""]"
@@ -770,7 +770,7 @@ AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
          [ignore], [ignore])
 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
-AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
          [[found: true, last_id: <0>
 row,action,name,number,_version
 <1>,insert,"""ten""",10,"[""uuid"",""<2>""]"
@@ -814,7 +814,7 @@ AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
          [ignore], [ignore])
 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
-AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
          [[found: true, last_id: <0>
 ]], [ignore])
 AT_CLEANUP
@@ -837,7 +837,7 @@ AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
          [ignore], [ignore])
 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
-AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
          [[found: false, last_id: <0>
 ]], [ignore])
 AT_CLEANUP
@@ -876,7 +876,7 @@ AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
          [ignore], [ignore])
 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
-AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
          [[found: false, last_id: <0>
 row,action,name,number,_version
 <1>,initial,"""one""",1,"[""uuid"",""<2>""]"
@@ -945,7 +945,7 @@ OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
 
 # Transaction shouldn't be found, and last_id returned should always
 # be the same (all zero uuid)
-AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
          [[found: false, last_id: <0>
 row,action,name,number,_version
 <1>,initial,"""one""",1,"[""uuid"",""<2>""]"
@@ -1000,7 +1000,7 @@ OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
 
 # Transaction shouldn't be found, and last_id returned should always
 # be the same (all zero uuid)
-AT_CHECK([$PYTHON $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
          [[found: false, last_id: <0>
 row,action,name,number,_version
 <1>,initial,"""one""",1,"[""uuid"",""<2>""]"
index ecd76cbc582dd041a4c218f20c6464e9f9d1d4d0..2631658be08a9cbf9e37430de617641634b6772a 100644 (file)
@@ -2,28 +2,19 @@ AT_BANNER([reconnect library])
 
 m4_define([__RECONNECT_CHECK],
   [AT_SETUP([$1])
-   $2
    AT_KEYWORDS([reconnect])
-   AT_DATA([input], [$3])
-   AT_CHECK([$4], [0], [$5])
+   AT_DATA([input], [$2])
+   AT_CHECK([$3], [0], [$4])
    AT_CLEANUP])
 
 m4_define([RECONNECT_CHECK],
   [__RECONNECT_CHECK(
      [$1 - C],
-     [],
      [$2],
      [ovstest test-reconnect < input],
      [$3])
-   __RECONNECT_CHECK(
-     [$1 - Python2],
-     [AT_SKIP_IF([test $HAVE_PYTHON2 = no])],
-     [$2],
-     [$PYTHON2 $srcdir/test-reconnect.py < input],
-     [$3])
    __RECONNECT_CHECK(
      [$1 - Python3],
-     [AT_SKIP_IF([test $HAVE_PYTHON3 = no])],
      [$2],
      [$PYTHON3 $srcdir/test-reconnect.py < input],
      [$3])])
index 64bf5ec63ab414eeb23d3edf274eb6d1bd24cef5..68c8774d1ac646ae96c741f648882281f32da97a 100644 (file)
@@ -267,7 +267,7 @@ m4_define([OVS_CHECK_FIREWALL],
 #
 m4_define([OVS_START_L7],
    [PIDFILE=$(mktemp $2XXX.pid)
-    NETNS_DAEMONIZE([$1], [[$PYTHON $srcdir/test-l7.py $2]], [$PIDFILE])
+    NETNS_DAEMONIZE([$1], [[$PYTHON3 $srcdir/test-l7.py $2]], [$PIDFILE])
 
     dnl netstat doesn't print http over IPv6 as "http6"; drop the number.
     PROTO=$(echo $2 | sed -e 's/\([[a-zA-Z]]*\).*/\1/')
index 75b59ae66ba7a9253c273f9ea3197b764cc625b8..283898f8153c32c268eff9bb72c86a1d40da7ed0 100644 (file)
@@ -59,8 +59,7 @@ m4_define([CONFIGURE_VETH_OFFLOADS],
 # kernel conntrack tables when the test is finished.
 #
 m4_define([CHECK_CONNTRACK],
-    [AT_SKIP_IF([test $HAVE_PYTHON = no])
-     m4_foreach([mod], [[nf_conntrack_ipv4], [nf_conntrack_ipv6], [nf_nat_ftp],
+    [m4_foreach([mod], [[nf_conntrack_ipv4], [nf_conntrack_ipv6], [nf_nat_ftp],
                         [nf_nat_tftp]],
                 [modprobe mod || echo "Module mod not loaded."
                  on_exit 'modprobe -r mod'
index bfc6bb5b47c79f15602600770adc645e5fe5b8d2..146d671fb3d130816db0f269acfb07630a1ac5de 100644 (file)
@@ -3590,8 +3590,8 @@ table=0,action=normal
 
 AT_CHECK([ovs-ofctl --bundle replace-flows br0 flows.txt])
 
-NETNS_DAEMONIZE([at_ns0], [[$PYTHON $srcdir/test-l7.py ftp]], [ftp1.pid])
-NETNS_DAEMONIZE([at_ns1], [[$PYTHON $srcdir/test-l7.py ftp]], [ftp0.pid])
+NETNS_DAEMONIZE([at_ns0], [[$PYTHON3 $srcdir/test-l7.py ftp]], [ftp1.pid])
+NETNS_DAEMONIZE([at_ns1], [[$PYTHON3 $srcdir/test-l7.py ftp]], [ftp0.pid])
 OVS_WAIT_UNTIL([ip netns exec at_ns1 netstat -l | grep ftp])
 
 dnl FTP requests from p0->p1 should work fine.
@@ -5357,7 +5357,7 @@ dnl waiting, we get occasional failures due to the following error:
 dnl "connect: Cannot assign requested address"
 OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 1 fc00::2 >/dev/null])
 
-NETNS_DAEMONIZE([at_ns1], [[$PYTHON $srcdir/test-l7.py ftp]], [ftp0.pid])
+NETNS_DAEMONIZE([at_ns1], [[$PYTHON3 $srcdir/test-l7.py ftp]], [ftp0.pid])
 OVS_WAIT_UNTIL([ip netns exec at_ns1 netstat -l | grep ftp])
 
 dnl FTP requests from p0->p1 should work fine.
@@ -6008,7 +6008,7 @@ sleep 1
 dnl The hex dump is a TCP syn packet. pkt=eth/ip/tcp
 dnl The packet is sent from p0(at_ns0) interface directed to
 dnl p1(at_ns1) interface
-NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
+NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
 
 dnl Check the expected nsh encapsulated packet on the egress interface
 OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *0fc6" 2>&1 1>/dev/null])
@@ -6040,7 +6040,7 @@ sleep 1
 dnl The hex dump is NSH packet with TCP syn payload. pkt=eth/nsh/eth/ip/tcp
 dnl The packet is sent from p0(at_ns0) interface directed to
 dnl p1(at_ns1) interface
-NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 00 64 03 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
+NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 00 64 03 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
 
 dnl Check the expected de-capsulated TCP packet on the egress interface
 OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *f200 *0000 *0002 *f200 *0000 *0001 *0800 *4500" 2>&1 1>/dev/null])
@@ -6073,7 +6073,7 @@ dnl The hex dump is NSH packet with TCP syn payload. pkt=eth/nsh/eth/ip/tcp
 dnl The nsh_ttl is 8, nsh_spi is 0x100 and nsh_si is 3
 dnl The packet is sent from p0(at_ns0) interface directed to
 dnl p1(at_ns1) interface
-NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 01 00 03 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
+NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 01 00 03 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
 
 dnl Check the expected NSH packet with new fields in the header
 OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *f2ff *0000 *0002 *f2ff *0000* 0001 *894f *01c6" 2>&1 1>/dev/null])
@@ -6107,7 +6107,7 @@ NS_CHECK_EXEC([at_ns2], [tcpdump -l -n -xx -U -i p2 > p2.pcap &])
 sleep 1
 
 dnl First send packet from at_ns0 --> OVS with SPI=0x100 and SI=2
-NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 01 00 02 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
+NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 01 00 02 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
 
 dnl Check for the above packet on p1 interface
 OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *0206" 2>&1 1>/dev/null])
@@ -6118,7 +6118,7 @@ OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800
 OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null])
 
 dnl Send the second packet from at_ns1 --> OVS with SPI=0x100 and SI=1
-NS_CHECK_EXEC([at_ns1], [$PYTHON $srcdir/sendpkt.py p1 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 01 c6 01 03 00 01 00 01 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
+NS_CHECK_EXEC([at_ns1], [$PYTHON3 $srcdir/sendpkt.py p1 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 01 c6 01 03 00 01 00 01 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null])
 
 dnl Check for the above packet on p2 interface
 OVS_WAIT_UNTIL([cat p2.pcap | egrep "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *01c6" 2>&1 1>/dev/null])
index 0a21db88a998ed97ec72a5d9471e3e320b58396d..5d3b8b8e09c538a16b7d0f577623e07ec0c63a0a 100644 (file)
@@ -64,9 +64,7 @@ m4_define([CONFIGURE_VETH_OFFLOADS],
 #
 # Perform requirements checks for running conntrack tests.
 #
-m4_define([CHECK_CONNTRACK],
-    [AT_SKIP_IF([test $HAVE_PYTHON = no])]
-)
+m4_define([CHECK_CONNTRACK], [])
 
 # CHECK_CONNTRACK_ALG()
 #
index 5c28e2c01df2de0e3148e474dc3b104d8d79f9e9..72400611822de959e2edc90a00b74e03424fc3d7 100644 (file)
 AT_BANNER([unixctl])
 
 m4_define([APPCTL], [ovs-appctl --timeout 20])
-m4_define([PYAPPCTL_PYN], [$1 $srcdir/appctl.py --timeout 20])
+m4_define([PYAPPCTL_PY], [$PYTHON3 $srcdir/appctl.py --timeout 20])
 
-m4_define([UNIXCTL_EXIT_PYN],
-  [AT_SETUP([unixctl ovs-vswitchd exit - $1])
-   AT_SKIP_IF([test $2 = no])
-   AT_KEYWORDS([python unixctl])
-   OVS_VSWITCHD_START
+AT_SETUP([unixctl ovs-vswitchd exit - Python3])
+AT_KEYWORDS([python unixctl])
+OVS_VSWITCHD_START
 
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t ovs-vswitchd exit], [0], [])
-   OVS_WAIT_WHILE([test -s ovs-vswitchd.pid])
+AT_CHECK([PYAPPCTL_PY -t ovs-vswitchd exit], [0], [])
+OVS_WAIT_WHILE([test -s ovs-vswitchd.pid])
 
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t ovsdb-server exit], [0], [])
-   OVS_WAIT_WHILE([test -s ovsdb-server.pid])
-   AT_CLEANUP])
+AT_CHECK([PYAPPCTL_PY -t ovsdb-server exit], [0], [])
+OVS_WAIT_WHILE([test -s ovsdb-server.pid])
+AT_CLEANUP
 
-UNIXCTL_EXIT_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-UNIXCTL_EXIT_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_SETUP([unixctl ovs-vswitchd list-commands - Python3])
+OVS_VSWITCHD_START
 
-m4_define([UNIXCTL_LIST_COMMANDS_PYN],
-  [AT_SETUP([unixctl ovs-vswitchd list-commands - $1])
-   AT_SKIP_IF([test $2 = no])
-   OVS_VSWITCHD_START
-
-   AT_CHECK([APPCTL list-commands], [0], [stdout])
-   AT_CHECK([head -1 stdout], [0], [dnl
+AT_CHECK([APPCTL list-commands], [0], [stdout])
+AT_CHECK([head -1 stdout], [0], [dnl
 The available commands are:
 ])
-   mv stdout expout
-   AT_CHECK([PYAPPCTL_PYN([$3]) list-commands], [0], [expout])
-
-   OVS_VSWITCHD_STOP
-   AT_CLEANUP])
+mv stdout expout
+AT_CHECK([PYAPPCTL_PY list-commands], [0], [expout])
 
-UNIXCTL_LIST_COMMANDS_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-UNIXCTL_LIST_COMMANDS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+OVS_VSWITCHD_STOP
+AT_CLEANUP]
 
-m4_define([UNIXCTL_ARGS_PYN],
-  [AT_SETUP([unixctl ovs-vswitchd arguments - $1])
-   AT_SKIP_IF([test $2 = no])
-   OVS_VSWITCHD_START
+AT_SETUP([unixctl ovs-vswitchd arguments - Python3])
+OVS_VSWITCHD_START
 
-   AT_CHECK([APPCTL bond/hash], [2], [], [stderr])
-   AT_CHECK([head -1 stderr], [0], [dnl
+AT_CHECK([APPCTL bond/hash], [2], [], [stderr])
+AT_CHECK([head -1 stderr], [0], [dnl
 "bond/hash" command requires at least 1 arguments
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) bond/hash], [2], [], [experr])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY bond/hash], [2], [], [experr])
 
-   AT_CHECK([APPCTL bond/hash mac], [2], [], [stderr])
-   AT_CHECK([head -1 stderr], [0], [dnl
+AT_CHECK([APPCTL bond/hash mac], [2], [], [stderr])
+AT_CHECK([head -1 stderr], [0], [dnl
 invalid mac
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) bond/hash mac], [2], [], [experr])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY bond/hash mac], [2], [], [experr])
 
-   AT_CHECK([APPCTL bond/hash mac vlan], [2], [], [stderr])
-   AT_CHECK([head -1 stderr], [0], [dnl
+AT_CHECK([APPCTL bond/hash mac vlan], [2], [], [stderr])
+AT_CHECK([head -1 stderr], [0], [dnl
 invalid vlan
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) bond/hash mac vlan], [2], [], [experr])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY bond/hash mac vlan], [2], [], [experr])
 
-   AT_CHECK([APPCTL bond/hash mac vlan basis], [2], [], [stderr])
-   AT_CHECK([head -1 stderr], [0], [dnl
+AT_CHECK([APPCTL bond/hash mac vlan basis], [2], [], [stderr])
+AT_CHECK([head -1 stderr], [0], [dnl
 invalid vlan
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) bond/hash vlan basis], [2], [], [experr])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY bond/hash vlan basis], [2], [], [experr])
 
-   AT_CHECK([APPCTL bond/hash mac vlan basis extra], [2], [], [stderr])
-   AT_CHECK([head -1 stderr], [0], [dnl
+AT_CHECK([APPCTL bond/hash mac vlan basis extra], [2], [], [stderr])
+AT_CHECK([head -1 stderr], [0], [dnl
 "bond/hash" command takes at most 3 arguments
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) bond/hash mac vlan basis extra], [2], [], [experr])
-
-   OVS_VSWITCHD_STOP
-   AT_CLEANUP])
-
-UNIXCTL_ARGS_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-UNIXCTL_ARGS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY bond/hash mac vlan basis extra], [2], [], [experr])
 
-m4_define([UNIXCTL_BAD_TARGET_PYN],
-  [AT_SETUP([unixctl bad target - $1])
-   AT_SKIP_IF([test $2 = no])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
 
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t bogus doit], [1], [], [stderr])
-   AT_CHECK_UNQUOTED([tail -1 stderr], [0], [dnl
+AT_SETUP([unixctl bad target - Python3])
+AT_CHECK([PYAPPCTL_PY -t bogus doit], [1], [], [stderr])
+AT_CHECK_UNQUOTED([tail -1 stderr], [0], [dnl
 appctl.py: cannot read pidfile "`pwd`/bogus.pid" (No such file or directory)
 ])
-   if test "$IS_WIN32" = "no"; then
-     AT_CHECK([PYAPPCTL_PYN([$3]) -t /bogus/path.pid doit], [1], [], [stderr])
-     AT_CHECK([tail -1 stderr], [0], [dnl
+if test "$IS_WIN32" = "no"; then
+  AT_CHECK([PYAPPCTL_PY -t /bogus/path.pid doit], [1], [], [stderr])
+  AT_CHECK([tail -1 stderr], [0], [dnl
 appctl.py: cannot connect to "/bogus/path.pid" (No such file or directory)
 ])
-   else
-     AT_CHECK([PYAPPCTL_PYN([$3]) -t c:/bogus/path.pid doit], [1], [], [stderr])
-     AT_CHECK([tail -1 stderr], [0], [dnl
+else
+  AT_CHECK([PYAPPCTL_PY -t c:/bogus/path.pid doit], [1], [], [stderr])
+  AT_CHECK([tail -1 stderr], [0], [dnl
 appctl.py: cannot connect to "c:/bogus/path.pid" (No such file or directory)
 ])
-   fi
+fi
+AT_CLEANUP
 
-   AT_CLEANUP])
+AT_SETUP([unixctl server - Python3])
+on_exit 'kill `cat test-unixctl.py.pid`'
+AT_CAPTURE_FILE([`pwd`/test-unixctl.py.log])
+AT_CHECK([$PYTHON3 $srcdir/test-unixctl.py --log-file --pidfile --detach --no-chdir])
 
-UNIXCTL_BAD_TARGET_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-UNIXCTL_BAD_TARGET_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
-
-m4_define([UNIXCTL_SERVER_PYN],
-  [AT_SETUP([unixctl server - $1])
-   AT_SKIP_IF([test $2 = no])
-   on_exit 'kill `cat test-unixctl.py.pid`'
-   AT_CAPTURE_FILE([`pwd`/test-unixctl.py.log])
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file --pidfile --detach --no-chdir])
-
-   AT_CHECK([APPCTL -t test-unixctl.py help], [0], [stdout])
-   AT_CHECK([cat stdout], [0], [dnl
+AT_CHECK([APPCTL -t test-unixctl.py help], [0], [stdout])
+AT_CHECK([cat stdout], [0], [dnl
 The available commands are:
   block
   echo                    [[arg ...]]
@@ -130,63 +106,55 @@ The available commands are:
   vlog/reopen
   vlog/set                spec
 ])
-   mv stdout expout
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t test-unixctl.py help], [0], [expout])
+mv stdout expout
+AT_CHECK([PYAPPCTL_PY -t test-unixctl.py help], [0], [expout])
 
-   AT_CHECK([ovs-vsctl --version | sed 's/ovs-vsctl/test-unixctl.py/' | head -1 > expout])
-   AT_CHECK([APPCTL -t test-unixctl.py version], [0], [expout])
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t test-unixctl.py version], [0], [expout])
+AT_CHECK([ovs-vsctl --version | sed 's/ovs-vsctl/test-unixctl.py/' | head -1 > expout])
+AT_CHECK([APPCTL -t test-unixctl.py version], [0], [expout])
+AT_CHECK([PYAPPCTL_PY -t test-unixctl.py version], [0], [expout])
 
-   AT_CHECK([APPCTL -t test-unixctl.py echo robot ninja], [0], [stdout])
-   AT_CHECK([cat stdout | sed -e "s/u'/'/g"], [0], [dnl
+AT_CHECK([APPCTL -t test-unixctl.py echo robot ninja], [0], [stdout])
+AT_CHECK([cat stdout | sed -e "s/u'/'/g"], [0], [dnl
 [['robot', 'ninja']]
 ])
-   mv stdout expout
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t test-unixctl.py echo robot ninja], [0], [expout])
+mv stdout expout
+AT_CHECK([PYAPPCTL_PY -t test-unixctl.py echo robot ninja], [0], [expout])
 
-   AT_CHECK([APPCTL -t test-unixctl.py echo_error robot ninja], [2], [], [stderr])
-   AT_CHECK([cat stderr | sed -e "s/u'/'/g"], [0], [dnl
+AT_CHECK([APPCTL -t test-unixctl.py echo_error robot ninja], [2], [], [stderr])
+AT_CHECK([cat stderr | sed -e "s/u'/'/g"], [0], [dnl
 [['robot', 'ninja']]
 ovs-appctl: test-unixctl.py: server returned an error
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t test-unixctl.py echo_error robot ninja], [2], [], [experr])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY -t test-unixctl.py echo_error robot ninja], [2], [], [experr])
 
-   AT_CHECK([APPCTL -t test-unixctl.py echo], [2], [], [stderr])
-   AT_CHECK([cat stderr], [0], [dnl
+AT_CHECK([APPCTL -t test-unixctl.py echo], [2], [], [stderr])
+AT_CHECK([cat stderr], [0], [dnl
 "echo" command requires at least 1 arguments
 ovs-appctl: test-unixctl.py: server returned an error
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t test-unixctl.py echo], [2], [], [experr])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY -t test-unixctl.py echo], [2], [], [experr])
 
-   AT_CHECK([APPCTL -t test-unixctl.py echo robot ninja pirates], [2], [], [stderr])
-   AT_CHECK([cat stderr], [0], [dnl
+AT_CHECK([APPCTL -t test-unixctl.py echo robot ninja pirates], [2], [], [stderr])
+AT_CHECK([cat stderr], [0], [dnl
 "echo" command takes at most 2 arguments
 ovs-appctl: test-unixctl.py: server returned an error
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t test-unixctl.py echo robot ninja pirates], [2], [], [experr])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY -t test-unixctl.py echo robot ninja pirates], [2], [], [experr])
 
-   AT_CHECK([APPCTL -t test-unixctl.py bogus], [2], [], [stderr])
-   AT_CHECK([cat stderr], [0], [dnl
+AT_CHECK([APPCTL -t test-unixctl.py bogus], [2], [], [stderr])
+AT_CHECK([cat stderr], [0], [dnl
 "bogus" is not a valid command
 ovs-appctl: test-unixctl.py: server returned an error
 ])
-   sed 's/ovs-appctl/appctl.py/' stderr > experr
-   AT_CHECK([PYAPPCTL_PYN([$3]) -t test-unixctl.py bogus], [2], [], [experr])
-
-   AT_CHECK([APPCTL -t test-unixctl.py exit])
-   AT_CLEANUP])
-
-UNIXCTL_SERVER_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-UNIXCTL_SERVER_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+sed 's/ovs-appctl/appctl.py/' stderr > experr
+AT_CHECK([PYAPPCTL_PY -t test-unixctl.py bogus], [2], [], [experr])
 
-m4_define([UNIXCTL_SERVER_ERRORS_PYN],
-  [AT_SETUP([unixctl server errors - $1])
-   AT_SKIP_IF([test $2 = no])
-   AT_CHECK($3 $srcdir/test-unixctl.py --unixctl "`pwd`"/bogus/path, [1], [], [ignore])
-   AT_CLEANUP])
+AT_CHECK([APPCTL -t test-unixctl.py exit])
+AT_CLEANUP
 
-UNIXCTL_SERVER_ERRORS_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-UNIXCTL_SERVER_ERRORS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_SETUP([unixctl server errors - Python3])
+AT_CHECK($PYTHON3 $srcdir/test-unixctl.py --unixctl "`pwd`"/bogus/path, [1], [], [ignore])
+AT_CLEANUP
index 2f532a725647e935bdf2a982413eaf200b1999a8..3e92e70a93c736af467d59a5df300e6fccbed0b7 100644 (file)
@@ -1,14 +1,12 @@
 AT_BANNER([vlog])
 
-m4_define([VLOG_PYN],
-  [AT_SETUP([vlog - $1])
-   AT_SKIP_IF([test $2 = no])
-   AT_CAPTURE_FILE([log_file])
-   AT_CAPTURE_FILE([stderr_log])
-   AT_CHECK([$3 $srcdir/test-vlog.py --log-file log_file \
+AT_SETUP([vlog - Python3])
+AT_CAPTURE_FILE([log_file])
+AT_CAPTURE_FILE([stderr_log])
+AT_CHECK([$PYTHON3 $srcdir/test-vlog.py --log-file log_file \
 -v dbg module_1:info module_2:warn syslog:off 2>stderr_log])
 
-   AT_CHECK([sed -e 's/.*-.*-.*T..:..:..Z |//' \
+AT_CHECK([sed -e 's/.*-.*-.*T..:..:..Z |//' \
 -e 's/File ".*", line [[0-9]][[0-9]]*,/File <name>, line <number>,/' \
 stderr_log], [0], [dnl
   0  | module_0 | EMER | emergency
@@ -100,10 +98,7 @@ Traceback (most recent call last):
 AssertionError
 ])
 
-   AT_CLEANUP])
-
-VLOG_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-VLOG_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_CLEANUP
 
 m4_divert_push([PREPARE_TESTS])
 vlog_filt () {
@@ -146,37 +141,32 @@ message3
 ])
 AT_CLEANUP
 
-m4_define([VLOG_REOPEN_PYN],
-  [AT_SETUP([vlog - vlog/reopen - $1])
-   # This test won't work as-is on Windows because Windows doesn't allow
-   # files that are open to be renamed.
-   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-   AT_SKIP_IF([test $2 = no])
-   on_exit 'kill `cat test-unixctl.py.pid`'
-
-   AT_CAPTURE_FILE([log])
-   AT_CAPTURE_FILE([log.old])
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir])
-
-   AT_CHECK([APPCTL -t test-unixctl.py log message])
-   mv log log.old
-   AT_CHECK([APPCTL -t test-unixctl.py log message2])
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen])
-   AT_CHECK([APPCTL -t test-unixctl.py log message3])
-   AT_CHECK([APPCTL -t test-unixctl.py exit])
-
-   AT_CHECK([sed 's/.*|//' log.old], [0], [dnl
+AT_SETUP([vlog - vlog/reopen - Python3])
+# This test won't work as-is on Windows because Windows doesn't allow
+# files that are open to be renamed.
+AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+on_exit 'kill `cat test-unixctl.py.pid`'
+
+AT_CAPTURE_FILE([log])
+AT_CAPTURE_FILE([log.old])
+AT_CHECK([$PYTHON3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir])
+
+AT_CHECK([APPCTL -t test-unixctl.py log message])
+mv log log.old
+AT_CHECK([APPCTL -t test-unixctl.py log message2])
+AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen])
+AT_CHECK([APPCTL -t test-unixctl.py log message3])
+AT_CHECK([APPCTL -t test-unixctl.py exit])
+
+AT_CHECK([sed 's/.*|//' log.old], [0], [dnl
  Entering run loop.
  message
  message2
 ])
-   AT_CHECK([sed 's/.*|//' log], [0], [dnl
+AT_CHECK([sed 's/.*|//' log], [0], [dnl
  message3
 ])
-   AT_CLEANUP])
-
-VLOG_REOPEN_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-VLOG_REOPEN_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_CLEANUP
 
 AT_SETUP([vlog - vlog/reopen without log file - C])
 on_exit 'kill `cat test-unixctl.pid`'
@@ -190,20 +180,15 @@ ovs-appctl: test-unixctl: server returned an error
 OVS_APP_EXIT_AND_WAIT([test-unixctl])
 AT_CLEANUP
 
-m4_define([VLOG_REOPEN_WITHOUT_FILE_PYN],
-  [AT_SETUP([vlog - vlog/reopen without log file - $1])
-   AT_SKIP_IF([test $2 = no])
-   on_exit 'kill `cat test-unixctl.py.pid`'
+AT_SETUP([vlog - vlog/reopen without log file - Python3])
+on_exit 'kill `cat test-unixctl.py.pid`'
 
-   AT_CHECK([$3 $srcdir/test-unixctl.py --pidfile --detach --no-chdir])
+AT_CHECK([$PYTHON3 $srcdir/test-unixctl.py --pidfile --detach --no-chdir])
 
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen], [0],
-     [Logging to file not configured
+AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen], [0],
+  [Logging to file not configured
 ])
-   AT_CLEANUP])
-
-VLOG_REOPEN_WITHOUT_FILE_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-VLOG_REOPEN_WITHOUT_FILE_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_CLEANUP
 
 dnl This checks that if vlog/reopen can't reopen the log file,
 dnl nothing particularly bad (e.g. a crash) happens.
@@ -243,37 +228,32 @@ AT_CLEANUP
 dnl This checks that if vlog/reopen can't reopen the log file,
 dnl nothing particularly bad (e.g. Python throws an exception and
 dnl aborts the program) happens.
-m4_define([VLOG_CANT_REOPEN_PYN],
-  [AT_SETUP([vlog - vlog/reopen can't reopen log file - $1])
-   AT_SKIP_IF([test $2 = no])
-
-   # Verify that /dev/full is a character device that fails writes.
-   AT_SKIP_IF([test ! -c /dev/full])
-   AT_SKIP_IF([echo > /dev/full])
-
-   on_exit 'kill `cat test-unixctl.py.pid`'
-
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir])
-   AT_CHECK([APPCTL -t test-unixctl.py log message])
-   mv log log.old
-   ln -s /dev/full log
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen])
-   AT_CHECK([APPCTL -t test-unixctl.py log message2])
-   rm log
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen])
-   AT_CHECK([APPCTL -t test-unixctl.py log message3])
-   AT_CHECK([APPCTL -t test-unixctl.py exit])
-   AT_CHECK([sed 's/.*|//' log.old], [0], [dnl
+AT_SETUP([vlog - vlog/reopen can't reopen log file - Python3])
+
+# Verify that /dev/full is a character device that fails writes.
+AT_SKIP_IF([test ! -c /dev/full])
+AT_SKIP_IF([echo > /dev/full])
+
+on_exit 'kill `cat test-unixctl.py.pid`'
+
+AT_CHECK([$PYTHON3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir])
+AT_CHECK([APPCTL -t test-unixctl.py log message])
+mv log log.old
+ln -s /dev/full log
+AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen])
+AT_CHECK([APPCTL -t test-unixctl.py log message2])
+rm log
+AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen])
+AT_CHECK([APPCTL -t test-unixctl.py log message3])
+AT_CHECK([APPCTL -t test-unixctl.py exit])
+AT_CHECK([sed 's/.*|//' log.old], [0], [dnl
  Entering run loop.
  message
 ])
-   AT_CHECK([sed 's/.*|//' log], [0], [dnl
+AT_CHECK([sed 's/.*|//' log], [0], [dnl
  message3
 ])
-   AT_CLEANUP])
-
-VLOG_CANT_REOPEN_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-VLOG_CANT_REOPEN_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_CLEANUP
 
 AT_SETUP([vlog - vlog/close - C])
 on_exit 'kill `cat test-unixctl.pid`'
@@ -315,44 +295,39 @@ message5
 ])
 AT_CLEANUP
 
-m4_define([VLOG_CLOSE_PYN],
-  [AT_SETUP([vlog - vlog/close - $1])
-   AT_SKIP_IF([test $2 = no])
-   on_exit 'kill `cat test-unixctl.py.pid`'
+AT_SETUP([vlog - vlog/close - Python3])
+on_exit 'kill `cat test-unixctl.py.pid`'
 
-   AT_CAPTURE_FILE([log])
-   AT_CAPTURE_FILE([log.old])
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir])
+AT_CAPTURE_FILE([log])
+AT_CAPTURE_FILE([log.old])
+AT_CHECK([$PYTHON3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir])
 
-   AT_CHECK([APPCTL -t test-unixctl.py log message])
-   AT_CHECK([APPCTL -t test-unixctl.py log message2])
+AT_CHECK([APPCTL -t test-unixctl.py log message])
+AT_CHECK([APPCTL -t test-unixctl.py log message2])
 
-   # After closing the log file, message3 won't appear anywhere.
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/close])
-   mv log log.old
-   AT_CHECK([APPCTL -t test-unixctl.py log message3])
+# After closing the log file, message3 won't appear anywhere.
+AT_CHECK([APPCTL -t test-unixctl.py vlog/close])
+mv log log.old
+AT_CHECK([APPCTL -t test-unixctl.py log message3])
 
-   # Closing the log file again is harmless.
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/close])
-   AT_CHECK([APPCTL -t test-unixctl.py log message4])
+# Closing the log file again is harmless.
+AT_CHECK([APPCTL -t test-unixctl.py vlog/close])
+AT_CHECK([APPCTL -t test-unixctl.py log message4])
 
-   # After reopening the log file, further messages start appearing again.
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen])
-   AT_CHECK([APPCTL -t test-unixctl.py log message5])
-   AT_CHECK([APPCTL -t test-unixctl.py exit])
+# After reopening the log file, further messages start appearing again.
+AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen])
+AT_CHECK([APPCTL -t test-unixctl.py log message5])
+AT_CHECK([APPCTL -t test-unixctl.py exit])
 
-   AT_CHECK([sed 's/.*|//' log.old], [0], [dnl
+AT_CHECK([sed 's/.*|//' log.old], [0], [dnl
  Entering run loop.
  message
  message2
 ])
-   AT_CHECK([sed 's/.*|//' log], [0], [dnl
+AT_CHECK([sed 's/.*|//' log], [0], [dnl
  message5
 ])
-   AT_CLEANUP])
-
-VLOG_CLOSE_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-VLOG_CLOSE_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_CLEANUP
 
 AT_SETUP([vlog - vlog/set and vlog/list - C])
 on_exit 'kill `cat test-unixctl.pid`'
@@ -400,15 +375,13 @@ AT_CHECK([grep -q 'I<3OVS' log])
 OVS_APP_EXIT_AND_WAIT([test-unixctl])
 AT_CLEANUP
 
-m4_define([VLOG_SET_AND_LIST_PYN],
-  [AT_SETUP([vlog - vlog/set and vlog/list - $1])
-   AT_SKIP_IF([test $2 = no])
-   on_exit 'kill `cat test-unixctl.py.pid`'
+AT_SETUP([vlog - vlog/set and vlog/list - Python3])
+on_exit 'kill `cat test-unixctl.py.pid`'
 
-   AT_CAPTURE_FILE([log])
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir])
+AT_CAPTURE_FILE([log])
+AT_CHECK([$PYTHON3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir])
 
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/list], [0], [dnl
+AT_CHECK([APPCTL -t test-unixctl.py vlog/list], [0], [dnl
                  console    syslog    file
                  -------    ------    ------
 daemon            info       info       info
@@ -441,19 +414,16 @@ test-unixctl      info       info        dbg
 unixctl_server    info       info        dbg
 ])
 
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern], [0],
+AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern], [0],
   [Please supply a valid pattern and destination
 ])
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern:nonexistent], [0],
+AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern:nonexistent], [0],
   [Destination nonexistent does not exist
 ])
-   AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern:file:'I<3OVS|%m'])
-   AT_CHECK([APPCTL -t test-unixctl.py log patterntest])
-   AT_CHECK([grep -q 'I<3OVS' log])
-   AT_CLEANUP])
-
-VLOG_SET_AND_LIST_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-VLOG_SET_AND_LIST_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern:file:'I<3OVS|%m'])
+AT_CHECK([APPCTL -t test-unixctl.py log patterntest])
+AT_CHECK([grep -q 'I<3OVS' log])
+AT_CLEANUP
 
 AT_SETUP([vlog - RFC5424 facility])
 on_exit 'kill `cat ovsdb-server.pid`'
@@ -492,24 +462,19 @@ AT_CHECK([tail -1 ovsdb-server.log | awk '{print $1}'], [0], [<191>1
 ])
 AT_CLEANUP
 
-m4_define([VLOG_RFC5424_PYN],
-  [AT_SETUP([vlog - RFC5424 facility - $1])
-   AT_SKIP_IF([test $2 = no])
-   on_exit 'kill `cat test-unixctl.py.pid`'
+AT_SETUP([vlog - RFC5424 facility - Python3])
+on_exit 'kill `cat test-unixctl.py.pid`'
 
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \
+AT_CHECK([$PYTHON3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \
 -vFACILITY:invalid --detach --no-chdir], [1], [], [test-unixctl.py: processing "FACILITY:invalid": Facility invalid is invalid
 ])
 
-   AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \
+AT_CHECK([$PYTHON3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \
 -vFACILITY:daemon --detach --no-chdir])
 
-   AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:invalid], [0],
+AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:invalid], [0],
 [Facility invalid is invalid
 ])
 
-   AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:local0])
-   AT_CLEANUP])
-
-VLOG_RFC5424_PYN([Python2], [$HAVE_PYTHON2], [$PYTHON2])
-VLOG_RFC5424_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:local0])
+AT_CLEANUP
index 58f743e04fef7139bf13c299af5bd1f5c50819f7..0660c078d259def713d971169c86ffddafe83660 100644 (file)
@@ -8,15 +8,12 @@ bin_SCRIPTS += utilities/ovs-docker \
        utilities/ovs-pki \
        utilities/ovs-pcap \
        utilities/ovs-tcpdump \
-       utilities/ovs-tcpundump
-if HAVE_PYTHON2
-bin_SCRIPTS += \
+       utilities/ovs-tcpundump \
        utilities/ovs-dpctl-top \
        utilities/ovs-l3ping \
        utilities/ovs-parse-backtrace \
        utilities/ovs-test \
        utilities/ovs-vlan-test
-endif
 scripts_SCRIPTS += \
        utilities/ovs-check-dead-ifs \
        utilities/ovs-ctl \
index 40980b367095c64c4ed109900c4a9153cf5e9173..4c85b9cba97598c4ee6c664da8f5354a02c5aa61 100644 (file)
@@ -1,4 +1,3 @@
-if HAVE_PYTHON2
 sbin_SCRIPTS += utilities/bugtool/ovs-bugtool
 CLEANFILES += utilities/bugtool/ovs-bugtool
 
@@ -51,7 +50,6 @@ bugtool-uninstall-local:
            rm -rf "$(DESTDIR)$(bugtoolpluginsdir)/$$dir"; \
          fi \
        done; exit 0
-endif
 
 EXTRA_DIST += \
        $(bugtool_plugins) \
index f3657dc96501c8b5dcd1021a72a62ad2f6f5f433..0f3189426a198f17fa3ae3b10a12da77117ac542 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of version 2.1 of the GNU Lesser General Public
index a9f27b52f3c815ebfec14532700dc2efaa520eea..9b79d268f455ec14de2a5a9868f89f43ee88e8e4 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright (c) 2016, 2017 Red Hat, Inc.
 # Copyright (c) 2018 Nicira, Inc.
 #
index 73e4fd9e102dcd729d8577198d3a96d4ce442f99..bf3565758a6bb24d8645a05e61cb26d2d82a6844 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 
 import os
 import re
index d8889b93284020e828db017dc74de7c4697c06bf..f2cc3f7f2a6faba2a321a35bb37a48a5b7bbddf3 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 #
 # Copyright (c) 2013 Nicira, Inc.
 #
index 1b07972954098a69fd9b0c19529f90d20950ff73..92d32acb3fa3d60c48361ab0639961c5947684d4 100644 (file)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
index 350cbd9f8774f86607f53993a757995f0a67d47d..d5506769a80df72dbbab2704f8566e8fe0dfb461 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 #
 # Copyright (c) 2012 Nicira, Inc.
 #
index 7bebc079543d710ff06b6c685067ebd80b50060f..dddbee4dfb16dd40dc1253252c10c688df315d99 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 #
 # Copyright (c) 2010 Nicira, Inc.
 #
index 11624c54bd2b05eb1250db50b8b6dd7e8582b6d0..0fa5dc418c7e839e60b1d30375dc11d63b9e4279 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 #
 # Copyright (c) 2016 Red Hat, Inc.
 #
index c2987006244ce21d0bb3a51363d2d5740ed8b8f0..b20730ec96be761d464ff69089eea73e70a25ff1 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 #
 # Copyright (c) 2010 Nicira, Inc.
 #
index fb1f9ad2abb860ec9d854762a157a2853ba929da..eb712ffe8bca969b5110f3255628f8c494cb359f 100644 (file)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
index e2294989fd64f4a8332d7123443313dbf3f853cd..154573a9b5ed856a37ba5a25a16319d87bb101d6 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 #
 # Copyright (c) 2010 Nicira, Inc.
 #
index abdbcc698ba7a823b2eddf09a23660687800e0a1..595d1e46a9c00792c40d2bb84b0fdf873f5ad9ee 100644 (file)
@@ -26,18 +26,16 @@ pkgdata_DATA += vswitchd/vswitch.ovsschema
 #
 # If "python" or "dot" is not available, then we do not add graphical diagram
 # to the documentation.
-if HAVE_PYTHON
 if HAVE_DOT
 vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema
        $(AM_V_GEN)$(OVSDB_DOT) --no-arrows $(srcdir)/vswitchd/vswitch.ovsschema > $@
 vswitchd/vswitch.pic: vswitchd/vswitch.gv ovsdb/dot2pic
-       $(AM_V_GEN)(dot -T plain < vswitchd/vswitch.gv | $(PYTHON) $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
+       $(AM_V_GEN)(dot -T plain < vswitchd/vswitch.gv | $(PYTHON3) $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
        mv $@.tmp $@
 VSWITCH_PIC = vswitchd/vswitch.pic
 VSWITCH_DOT_DIAGRAM_ARG = --er-diagram=$(VSWITCH_PIC)
 CLEANFILES += vswitchd/vswitch.gv vswitchd/vswitch.pic
 endif
-endif
 
 # vswitch schema documentation
 EXTRA_DIST += vswitchd/vswitch.xml
index 0f313dce3efc13028b10bfab6f94edb7ef304989..e549922d915f05182e8a33567f72a2386c11dae1 100644 (file)
@@ -53,18 +53,16 @@ pkgdata_DATA += vtep/vtep.ovsschema
 #
 # If "python" or "dot" is not available, then we do not add graphical diagram
 # to the documentation.
-if HAVE_PYTHON
 if HAVE_DOT
 vtep/vtep.gv: ovsdb/ovsdb-dot.in vtep/vtep.ovsschema
        $(AM_V_GEN)$(OVSDB_DOT) --no-arrows $(srcdir)/vtep/vtep.ovsschema > $@
 vtep/vtep.pic: vtep/vtep.gv ovsdb/dot2pic
-       $(AM_V_GEN)(dot -T plain < vtep/vtep.gv | $(PYTHON) $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
+       $(AM_V_GEN)(dot -T plain < vtep/vtep.gv | $(PYTHON3) $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
        mv $@.tmp $@
 VTEP_PIC = vtep/vtep.pic
 VTEP_DOT_DIAGRAM_ARG = --er-diagram=$(VTEP_PIC)
 CLEANFILES += vtep/vtep.gv vtep/vtep.pic
 endif
-endif
 
 # VTEP schema documentation
 EXTRA_DIST += vtep/vtep.xml
index 33838707508250ff9d72d93076095e5cb2206686..de848d1a0167f1e0d1e0313197ebbe358990d3cf 100755 (executable)
@@ -1,4 +1,4 @@
-#! @PYTHON@
+#! @PYTHON3@
 # Copyright (C) 2013 Nicira, Inc. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");