[ovs-dev] [PATCH] json.at: Avoid to run $PYTHON when python is not available

Timothy Redaelli tredaelli at redhat.com
Fri Apr 6 18:08:24 UTC 2018

This commit is needed since autotest tries to run AT_XFAIL_IF when
AT_SKIP_IF condition is true too.

Currently HAVE_PYTHON is required, but this may change in the future
since many distributions are migrating to python3 as default python
(like Arch Linux or Fedora) and so it can be a good idea to permit to
build OVS using python3.

Signed-off-by: Timothy Redaelli <tredaelli at redhat.com>
 tests/json.at | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/json.at b/tests/json.at
index ba7d4bbbe..325ac9435 100644
--- a/tests/json.at
+++ b/tests/json.at
@@ -26,7 +26,8 @@ m4_define([JSON_CHECK_POSITIVE_UCS4PY],
    AT_KEYWORDS([json positive Python])
    AT_SKIP_IF([test $HAVE_PYTHON = no])
-   AT_XFAIL_IF([$PYTHON -c "exit(len(u'\U00010800'))"; test $? -ne 1])
+   AT_XFAIL_IF([test $HAVE_PYTHON = yes &&
+                $PYTHON -c "exit(len(u'\U00010800'))"; test $? -ne 1])
    AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
    AT_CHECK([$PYTHON $srcdir/test-json.py $4 input], [0], [stdout], [])

More information about the dev mailing list