summaryrefslogtreecommitdiff
path: root/tests/checkpatch.at
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2019-09-20 08:30:42 -0700
committerBen Pfaff <blp@ovn.org>2019-09-27 09:23:50 -0700
commit1ca0323e7c29dc7ef5a615c265df0460208f92de (patch)
tree377630fee2130b269cfe2fd348c9e8c6bc5a814a /tests/checkpatch.at
parent187bb41fbf447acf9fb6ac117dc923bbe649e78c (diff)
downloadopenvswitch-1ca0323e7c29dc7ef5a615c265df0460208f92de.tar.gz
Require Python 3 and remove support for Python 2.
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>
Diffstat (limited to 'tests/checkpatch.at')
-rwxr-xr-xtests/checkpatch.at17
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/checkpatch.at b/tests/checkpatch.at
index fe21acdf2..6c7394772 100755
--- a/tests/checkpatch.at
+++ b/tests/checkpatch.at
@@ -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