mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
Revert "Test the Python C JSON extension"
This reverts commita7be68a4d7
and a subsequent commit4617d1f6bd
. There are too many issues with these patches. It's better to revert them for now and make a separate fixed versions later if needed. List of issues (maybe not full): 1. 'make clean' removes entire 'python' directory. 2. Fully broken Travis-CI testsuite build: building 'ovs._json' extension creating build/temp.linux-x86_64-2.7 error: could not create 'build/temp.linux-x86_64-2.7': \ Permission denied https://travis-ci.org/openvswitch/ovs/jobs/440693765 3. Broken local testsuite build on Ubuntu 18.04: running build_ext building 'ovs._json' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/ovs <...> /usr/bin/ld: .libs/libopenvswitch.a(util.o): \ relocation R_X86_64_TPOFF32 against `var.7749' can not be \ used when making a shared object; recompile with -fPIC <...> collect2: error: ld returned 1 exit status 4. Fedora build failure because of 'setuptools' ('distutils') hard dependency on 'redhat-rpm-config' package: building 'ovs._json' extension <...> gcc: error: <...>/redhat-hardened-cc1: No such file or directory 5. Looks like 'setuptools' also could download and install unwanted python modules during package build. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -92,17 +92,6 @@ python-sdist: $(srcdir)/python/ovs/version.py $(ovs_pyfiles) python/ovs/dirs.py
|
||||
|
||||
pypi-upload: $(srcdir)/python/ovs/version.py $(ovs_pyfiles) python/ovs/dirs.py
|
||||
(cd python/ && $(PYTHON) setup.py sdist upload)
|
||||
|
||||
ALL_LOCAL += python-build
|
||||
python-build:$(lib_LTLIBRARIES)
|
||||
(cd $(srcdir)/python/ && $(PYTHON) setup.py build_py -d $(abs_top_builddir)/python && $(PYTHON) setup.py build_ext -b $(abs_top_builddir)/python -I$(abs_top_srcdir)/include:$(abs_top_builddir)/include -L$(abs_top_builddir)/lib/.libs)
|
||||
if HAVE_PYTHON3
|
||||
(cd $(srcdir)/python/ && $(PYTHON3) setup.py build_py -d $(abs_top_builddir)/python && $(PYTHON3) setup.py build_ext -b $(abs_top_builddir)/python -I$(abs_top_srcdir)/include:$(abs_top_builddir)/include -L$(abs_top_builddir)/lib/.libs)
|
||||
|
||||
CLEAN_LOCAL += python-clean
|
||||
python-clean:
|
||||
rm -rf $(abs_top_builddir)/python
|
||||
endif
|
||||
else
|
||||
ovs-install-data-local:
|
||||
@:
|
||||
|
@@ -21,13 +21,10 @@ import sys
|
||||
|
||||
import six
|
||||
|
||||
PARSER_C = 'C'
|
||||
PARSER_PY = 'PYTHON'
|
||||
try:
|
||||
import ovs._json
|
||||
PARSER = PARSER_C
|
||||
except ImportError:
|
||||
PARSER = PARSER_PY
|
||||
pass
|
||||
|
||||
__pychecker__ = 'no-stringiter'
|
||||
|
||||
@@ -94,8 +91,9 @@ class Parser(object):
|
||||
MAX_HEIGHT = 1000
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
if PARSER == PARSER_C:
|
||||
try:
|
||||
return ovs._json.Parser(*args, **kwargs)
|
||||
except NameError:
|
||||
return super(Parser, cls).__new__(cls)
|
||||
|
||||
def __init__(self, check_trailer=False):
|
||||
|
@@ -272,7 +272,6 @@ class Connection(object):
|
||||
# data, so we convert it here as soon as possible.
|
||||
if data and not error:
|
||||
try:
|
||||
if six.PY3 or ovs.json.PARSER == ovs.json.PARSER_PY:
|
||||
data = decoder.decode(data)
|
||||
except UnicodeError:
|
||||
error = errno.EILSEQ
|
||||
@@ -299,10 +298,6 @@ class Connection(object):
|
||||
else:
|
||||
if self.parser is None:
|
||||
self.parser = ovs.json.Parser()
|
||||
if six.PY3 and ovs.json.PARSER == ovs.json.PARSER_C:
|
||||
self.input = self.input.encode('utf-8')[
|
||||
self.parser.feed(self.input):].decode()
|
||||
else:
|
||||
self.input = self.input[self.parser.feed(self.input):]
|
||||
if self.parser.is_done():
|
||||
msg = self.__process_msg()
|
||||
|
@@ -22,10 +22,8 @@ if test x"$PYTHON3" = x; then
|
||||
export PYTHONCOERCECLOCALE
|
||||
fi
|
||||
|
||||
PYTHONPATH=$abs_top_builddir/python:$abs_top_builddir/tests:$PYTHONPATH
|
||||
PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH
|
||||
export PYTHONPATH
|
||||
LD_LIBRARY_PATH=$abs_top_builddir/lib/.libs
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
PYTHONIOENCODING=utf_8
|
||||
export PYTHONIOENCODING
|
||||
|
@@ -9,16 +9,15 @@ m4_define([JSON_CHECK_POSITIVE_C],
|
||||
AT_CLEANUP])
|
||||
|
||||
# JSON_CHECK_POSITIVE_PY(TITLE, INPUT, OUTPUT, TEST-JSON-ARGS,
|
||||
# PYTHON-CHCEK, PYTHON-BIN, JSON-PARSER = python)
|
||||
# PYTHON-CHCEK, PYTHON-BIN)
|
||||
#
|
||||
m4_define([JSON_CHECK_POSITIVE_PY],
|
||||
[AT_SETUP([$1])
|
||||
AT_KEYWORDS([json positive Python])
|
||||
AT_SKIP_IF([test $5 = no])
|
||||
AT_SKIP_IF([test $7 = C && ! $6 -c "import ovs._json" 2>/dev/null])
|
||||
AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
|
||||
AT_CAPTURE_FILE([input])
|
||||
AT_CHECK([$6 $srcdir/test-json.py -j m4_default([$7], python) $4 input], [0], [stdout], [])
|
||||
AT_CHECK([$6 $srcdir/test-json.py $4 input], [0], [stdout], [])
|
||||
AT_CHECK([cat stdout], [0], [$3
|
||||
])
|
||||
AT_CLEANUP])
|
||||
@@ -38,17 +37,16 @@ m4_define([JSON_CHECK_POSITIVE_UCS4PY],
|
||||
|
||||
m4_define([JSON_CHECK_POSITIVE],
|
||||
[JSON_CHECK_POSITIVE_C([$1 - C], [$2], [$3], [$4])
|
||||
JSON_CHECK_POSITIVE_PY23([$1], [$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(pyjson)], [$2], [$3], [$4],
|
||||
[JSON_CHECK_POSITIVE_PY([$1 - Python2], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
JSON_CHECK_POSITIVE_PY([$1 - Python2(cjson)], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
JSON_CHECK_POSITIVE_PY([$1 - Python3(pyjson)], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
JSON_CHECK_POSITIVE_PY([$1 - Python3(cjson)], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
JSON_CHECK_POSITIVE_PY([$1 - Python3], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])])
|
||||
|
||||
m4_define([JSON_CHECK_NEGATIVE_C],
|
||||
[AT_SETUP([$1])
|
||||
@@ -61,30 +59,25 @@ m4_define([JSON_CHECK_NEGATIVE_C],
|
||||
AT_CLEANUP])
|
||||
|
||||
# JSON_CHECK_NEGATIVE_PY(TITLE, INPUT, OUTPUT, TEST-JSON-ARGS,
|
||||
# PYTHON-CHCEK, PYTHON-BIN, JSON_PARSER = python)
|
||||
# PYTHON-CHCEK, PYTHON-BIN)
|
||||
#
|
||||
m4_define([JSON_CHECK_NEGATIVE_PY],
|
||||
[AT_SETUP([$1])
|
||||
AT_KEYWORDS([json negative Python])
|
||||
AT_SKIP_IF([test $5 = no])
|
||||
AT_SKIP_IF([test $7 = C && ! $6 -c "import ovs._json" 2>/dev/null])
|
||||
AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
|
||||
AT_CAPTURE_FILE([input])
|
||||
AT_CHECK([$6 $srcdir/test-json.py -j m4_default([$7], python) $4 input], [1], [stdout], [])
|
||||
AT_CHECK([$6 $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(pyjson)], [$2], [$3], [$4],
|
||||
JSON_CHECK_NEGATIVE_PY([$1 - Python2], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
JSON_CHECK_NEGATIVE_PY([$1 - Python2(cjson)], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
JSON_CHECK_NEGATIVE_PY([$1 - Python3(pyjson)], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
JSON_CHECK_NEGATIVE_PY([$1 - Python3(cjson)], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
JSON_CHECK_NEGATIVE_PY([$1 - Python3], [$2], [$3], [$4],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])])
|
||||
|
||||
AT_BANNER([JSON -- arrays])
|
||||
|
||||
|
@@ -46,12 +46,11 @@ m4_define([OVSDB_CHECK_IDL_C],
|
||||
m4_define([OVSDB_CHECK_IDL_PYN],
|
||||
[AT_SETUP([$1])
|
||||
AT_SKIP_IF([test $7 = no])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
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 -j m4_default([$9], python) -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
|
||||
AT_CHECK([$8 $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])
|
||||
@@ -59,24 +58,19 @@ m4_define([OVSDB_CHECK_IDL_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_PY],
|
||||
[OVSDB_CHECK_IDL_PYN([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[OVSDB_CHECK_IDL_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
OVSDB_CHECK_IDL_PYN([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
OVSDB_CHECK_IDL_PYN([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_PYN([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
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 -j m4_default([$9], python) -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([$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],
|
||||
[0], [stdout], [ignore])
|
||||
AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
|
||||
[0], [$4])
|
||||
@@ -84,27 +78,22 @@ m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY],
|
||||
[OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
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 -j m4_default([$9], python) -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
|
||||
AT_CHECK([$8 $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])
|
||||
@@ -112,21 +101,16 @@ m4_define([OVSDB_CHECK_IDL_TCP_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_TCP_PY],
|
||||
[OVSDB_CHECK_IDL_TCP_PYN([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[OVSDB_CHECK_IDL_TCP_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
OVSDB_CHECK_IDL_TCP_PYN([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
OVSDB_CHECK_IDL_TCP_PYN([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_TCP_PYN([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
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])
|
||||
@@ -135,7 +119,7 @@ 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 -j m4_default([$9], python) -t10 idl $srcdir/idltest.ovsschema $remote $3],
|
||||
AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema $remote $3],
|
||||
[0], [stdout], [ignore])
|
||||
AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
|
||||
[0], [$4])
|
||||
@@ -143,14 +127,10 @@ m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PY],
|
||||
[OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN([$1 - Python2 (pyjson multiple remotes)], [$2], [$3], [$4], [$5], [$6],
|
||||
[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 - Python2 (cjson multiple remotes)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON], [$PYTHON], C)
|
||||
OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN([$1 - Python3 (pyjson multiple remotes)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN([$1 - Python3 (cjson multiple remotes)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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],
|
||||
@@ -158,7 +138,6 @@ m4_define([OVSDB_CHECK_IDL_TCP6_PYN],
|
||||
AT_SKIP_IF([test $7 = no])
|
||||
AT_SKIP_IF([test "$IS_WIN32" = "yes"])
|
||||
AT_SKIP_IF([test $HAVE_IPV6 = no])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
|
||||
AT_CHECK([ovsdb_start_idltest "ptcp:0:[[::1]]"])
|
||||
PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
|
||||
@@ -166,7 +145,7 @@ 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 -j m4_default([$9], python) -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
|
||||
AT_CHECK([$8 $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])
|
||||
@@ -174,21 +153,16 @@ m4_define([OVSDB_CHECK_IDL_TCP6_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_TCP6_PY],
|
||||
[OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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])
|
||||
AT_SKIP_IF([test "$IS_WIN32" = "yes"])
|
||||
AT_SKIP_IF([test $HAVE_IPV6 = no])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
|
||||
AT_CHECK([ovsdb_start_idltest "ptcp:0:[[::1]]"])
|
||||
PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
|
||||
@@ -197,7 +171,7 @@ 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 -j m4_default([$9], python) -t10 idl $srcdir/idltest.ovsschema $remote $3],
|
||||
AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema $remote $3],
|
||||
[0], [stdout], [ignore])
|
||||
AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
|
||||
[0], [$4])
|
||||
@@ -205,14 +179,10 @@ m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY],
|
||||
[OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN([$1 - Python2 (pyjson multiple remotes)], [$2], [$3], [$4], [$5], [$6],
|
||||
[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 - Python2 (cjson multiple remotes)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON], [$PYTHON], C)
|
||||
OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN([$1 - Python3 (pyjson multiple remotes)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN([$1 - Python3 (cjson multiple remotes)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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],
|
||||
@@ -222,7 +192,6 @@ m4_define([OVSDB_CHECK_IDL_SSL_PYN],
|
||||
$8 -c "import OpenSSL.SSL"
|
||||
SSL_PRESENT=$?
|
||||
AT_SKIP_IF([test $SSL_PRESENT != 0])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
AT_KEYWORDS([ovsdb server idl positive Python with ssl socket $5])
|
||||
AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
|
||||
[0], [stdout], [ignore])
|
||||
@@ -241,7 +210,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 -j m4_default([$9], python) -t10 idl $srcdir/idltest.ovsschema \
|
||||
AT_CHECK([$8 $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])
|
||||
@@ -251,14 +220,10 @@ m4_define([OVSDB_CHECK_IDL_SSL_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_SSL_PY],
|
||||
[OVSDB_CHECK_IDL_SSL_PYN([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[OVSDB_CHECK_IDL_SSL_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON], [$PYTHON])
|
||||
OVSDB_CHECK_IDL_SSL_PYN([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON], [$PYTHON], C)
|
||||
OVSDB_CHECK_IDL_SSL_PYN([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_SSL_PYN([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
OVSDB_CHECK_IDL_SSL_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL],
|
||||
[OVSDB_CHECK_IDL_C($@)
|
||||
@@ -274,7 +239,6 @@ m4_define([OVSDB_CHECK_IDL],
|
||||
m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PYN],
|
||||
[AT_SETUP([$1 ptcp])
|
||||
AT_SKIP_IF([test $7 = no])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
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"])
|
||||
@@ -284,7 +248,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 -j m4_default([$9], python) -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3],
|
||||
AT_CHECK([$8 $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])
|
||||
@@ -293,14 +257,10 @@ m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PYN],
|
||||
])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY],
|
||||
[OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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],
|
||||
[],
|
||||
@@ -473,12 +433,11 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode],
|
||||
m4_define([OVSDB_CHECK_IDL_PYN_WITH_EXPOUT],
|
||||
[AT_SETUP([$1])
|
||||
AT_SKIP_IF([test $7 = no])
|
||||
AT_SKIP_IF([test $9 = C && ! $8 -c "import ovs._json" 2>/dev/null])
|
||||
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 -j m4_default([$9], python) -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
|
||||
AT_CHECK([$8 $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]]),
|
||||
@@ -487,14 +446,10 @@ m4_define([OVSDB_CHECK_IDL_PYN_WITH_EXPOUT],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_PY_WITH_EXPOUT],
|
||||
[OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$6],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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",
|
||||
@@ -1013,12 +968,11 @@ AT_CLEANUP
|
||||
m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN],
|
||||
[AT_SETUP([$1 fetch])
|
||||
AT_SKIP_IF([test $8 = no])
|
||||
AT_SKIP_IF([test $10 = C && ! $9 -c "import ovs._json" 2>/dev/null])
|
||||
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 -j m4_default([$10], python) -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4],
|
||||
AT_CHECK([$9 $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])
|
||||
@@ -1026,14 +980,10 @@ m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY],
|
||||
[OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5], [$6], [$7],
|
||||
[OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6], [$7],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6], [$7],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$6], [$7],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$6], [$7],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
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($@)])
|
||||
@@ -1069,11 +1019,10 @@ OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated],
|
||||
m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN],
|
||||
[AT_SETUP([$1])
|
||||
AT_SKIP_IF([test $6 = no])
|
||||
AT_SKIP_IF([test $8 = C && ! $7 -c "import ovs._json" 2>/dev/null])
|
||||
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 -j m4_default([$8], python) -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
|
||||
AT_CHECK([$7 $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])
|
||||
@@ -1081,14 +1030,10 @@ m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN],
|
||||
AT_CLEANUP])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY],
|
||||
[OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python2(pyjson)], [$2], [$3], [$4], [$5],
|
||||
[OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
|
||||
[$HAVE_PYTHON2], [$PYTHON2])
|
||||
OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python2(cjson)], [$2], [$3], [$4], [$5],
|
||||
[$HAVE_PYTHON2], [$PYTHON2], C)
|
||||
OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])
|
||||
OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python3(cjson)], [$2], [$3], [$4], [$5],
|
||||
[$HAVE_PYTHON3], [$PYTHON3], C)])
|
||||
OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
|
||||
[$HAVE_PYTHON3], [$PYTHON3])])
|
||||
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND],
|
||||
@@ -1411,8 +1356,7 @@ OVSDB_CHECK_IDL_PY([partial-set idl],
|
||||
]])
|
||||
|
||||
m4_define([OVSDB_CHECK_IDL_NOTIFY_PYN],
|
||||
[OVSDB_CHECK_IDL_PYN([$1(pyjson)], [], [$2], [$3], [notify $4], [$5], [$6], [$7])
|
||||
OVSDB_CHECK_IDL_PYN([$1(cjson)], [], [$2], [$3], [notify $4], [$5], [$6], [$7], C)])
|
||||
[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],
|
||||
@@ -1422,8 +1366,7 @@ m4_define([OVSDB_CHECK_IDL_NOTIFY_PY],
|
||||
|
||||
# This test uses the Python IDL implementation with ssl
|
||||
m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PYN],
|
||||
[OVSDB_CHECK_IDL_SSL_PYN([$1(pyjson)], [], [$2], [$3], [notify $4], [$5], [$6], [$7])
|
||||
OVSDB_CHECK_IDL_SSL_PYN([$1(cjson)], [], [$2], [$3], [notify $4], [$5], [$6], [$7], C)])
|
||||
[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],
|
||||
|
@@ -12,7 +12,7 @@ m4_define([OVSDB_CHECK_POSITIVE],
|
||||
AT_CLEANUP])
|
||||
|
||||
# OVSDB_CHECK_POSITIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ],
|
||||
# [PY-CHECK] [JSON-PARSER = python])
|
||||
# [PY-CHECK])
|
||||
#
|
||||
# Runs "test-ovsdb.py TEST-OVSDB-ARGS" and checks that it exits with
|
||||
# status 0 and prints OUTPUT on stdout.
|
||||
@@ -24,15 +24,14 @@ m4_define([OVSDB_CHECK_POSITIVE],
|
||||
m4_define([OVSDB_CHECK_POSITIVE_PY],
|
||||
[AT_SETUP([$1])
|
||||
AT_SKIP_IF([test $HAVE_PYTHON2 = no])
|
||||
AT_SKIP_IF([test $7 = C && ! $PYTHON2 -c "import ovs._json" 2>/dev/null])
|
||||
$6
|
||||
AT_KEYWORDS([ovsdb positive Python $4])
|
||||
AT_CHECK([$PYTHON2 $srcdir/test-ovsdb.py -j m4_default([$7], python) $2], [0], [$3
|
||||
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] [PY3-CHECK] [JSON-PARSER = python])
|
||||
# [PY-CHECK])
|
||||
#
|
||||
# Runs "test-ovsdb.py TEST-OVSDB-ARGS" and checks that it exits with
|
||||
# status 0 and prints OUTPUT on stdout.
|
||||
@@ -44,10 +43,9 @@ m4_define([OVSDB_CHECK_POSITIVE_PY],
|
||||
m4_define([OVSDB_CHECK_POSITIVE_PY3],
|
||||
[AT_SETUP([$1])
|
||||
AT_SKIP_IF([test $HAVE_PYTHON3 = no])
|
||||
AT_SKIP_IF([test $8 = C && ! $PYTHON3 -c "import ovs._json" 2>/dev/null])
|
||||
$6
|
||||
AT_KEYWORDS([ovsdb positive Python $4])
|
||||
AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -j m4_default([$8], python) $2], [0], [$3
|
||||
AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py $2], [0], [$3
|
||||
], [])
|
||||
AT_CLEANUP])
|
||||
|
||||
@@ -57,10 +55,8 @@ m4_define([OVSDB_CHECK_POSITIVE_PY3],
|
||||
# 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(pyjson)], [$2], [$3], [$4], [$5], [$6])
|
||||
OVSDB_CHECK_POSITIVE_PY([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], [$6], C)
|
||||
OVSDB_CHECK_POSITIVE_PY3([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5], [$7])
|
||||
OVSDB_CHECK_POSITIVE_PY3([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], [$7], C)])
|
||||
OVSDB_CHECK_POSITIVE_PY([$1 - Python2], [$2], [$3], [$4], [$5], [$6])
|
||||
OVSDB_CHECK_POSITIVE_PY3([$1 - Python3], [$2], [$3], [$4], [$5], [$7])])
|
||||
|
||||
# OVSDB_CHECK_NEGATIVE(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ])
|
||||
#
|
||||
@@ -82,7 +78,7 @@ m4_define([OVSDB_CHECK_NEGATIVE],
|
||||
[0], [ignore], [ignore])
|
||||
AT_CLEANUP])
|
||||
|
||||
# OVSDB_CHECK_NEGATIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ] [JSON-PARSER = python])
|
||||
# OVSDB_CHECK_NEGATIVE_PY(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.
|
||||
@@ -90,9 +86,8 @@ m4_define([OVSDB_CHECK_NEGATIVE],
|
||||
m4_define([OVSDB_CHECK_NEGATIVE_PY],
|
||||
[AT_SETUP([$1])
|
||||
AT_SKIP_IF([test $HAVE_PYTHON2 = no])
|
||||
AT_SKIP_IF([test $6 = C && ! $PYTHON2 -c "import ovs._json" 2>/dev/null])
|
||||
AT_KEYWORDS([ovsdb negative Python $4])
|
||||
AT_CHECK([$PYTHON2 $srcdir/test-ovsdb.py -j m4_default([$6], python) $2], [1], [], [stderr])
|
||||
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
|
||||
@@ -104,7 +99,7 @@ m4_define([OVSDB_CHECK_NEGATIVE_PY],
|
||||
[0], [ignore], [ignore])
|
||||
AT_CLEANUP])
|
||||
|
||||
# OVSDB_CHECK_NEGATIVE_PY3(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ], [JSON-PARSER = python])
|
||||
# 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.
|
||||
@@ -112,9 +107,8 @@ m4_define([OVSDB_CHECK_NEGATIVE_PY],
|
||||
m4_define([OVSDB_CHECK_NEGATIVE_PY],
|
||||
[AT_SETUP([$1])
|
||||
AT_SKIP_IF([test $HAVE_PYTHON3 = no])
|
||||
AT_SKIP_IF([test $6 = C && ! $PYTHON3 -c "import ovs._json" 2>/dev/null])
|
||||
AT_KEYWORDS([ovsdb negative Python $4])
|
||||
AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -j m4_default([$6], python) $2], [1], [], [stderr])
|
||||
AT_KEYWORDS([ovsdb negative $4])
|
||||
AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py $2], [1], [], [stderr])
|
||||
m4_assert(m4_len([$3]))
|
||||
AT_CHECK(
|
||||
[if grep -F -e "AS_ESCAPE([$3])" stderr
|
||||
@@ -132,10 +126,8 @@ 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(pyjson)], [$2], [$3], [$4], [$5])
|
||||
OVSDB_CHECK_NEGATIVE_PY([$1 - Python2(cjson)], [$2], [$3], [$4], [$5], C)
|
||||
OVSDB_CHECK_NEGATIVE_PY3([$1 - Python3(pyjson)], [$2], [$3], [$4], [$5])
|
||||
OVSDB_CHECK_NEGATIVE_PY3([$1 - Python3(cjson)], [$2], [$3], [$4], [$5], C)])
|
||||
OVSDB_CHECK_NEGATIVE_PY([$1 - Python2], [$2], [$3], [$4], [$5])
|
||||
OVSDB_CHECK_NEGATIVE_PY3([$1 - Python3], [$2], [$3], [$4], [$5])])
|
||||
|
||||
OVS_START_SHELL_HELPERS
|
||||
ovsdb_client_wait() {
|
||||
|
@@ -18,7 +18,6 @@ import codecs
|
||||
import getopt
|
||||
import sys
|
||||
|
||||
from ovs.db import error
|
||||
import ovs.json
|
||||
|
||||
import six
|
||||
@@ -67,26 +66,15 @@ def main(argv):
|
||||
sys.stderr = codecs.getwriter("utf-8")(sys.stderr)
|
||||
|
||||
try:
|
||||
options, args = getopt.gnu_getopt(argv[1:], 'j:',
|
||||
['multiple', 'json-parser'])
|
||||
options, args = getopt.gnu_getopt(argv[1:], '', ['multiple'])
|
||||
except getopt.GetoptError as geo:
|
||||
sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
|
||||
sys.exit(1)
|
||||
|
||||
multiple = False
|
||||
ORIG_PARSER = ovs.json.PARSER
|
||||
ovs.json.PARSER = ovs.json.PARSER_PY
|
||||
for key, value in options:
|
||||
if key == '--multiple':
|
||||
multiple = True
|
||||
elif key in ('-j', '--json-parser'):
|
||||
if value == "python":
|
||||
ovs.json.PARSER = ovs.json.PARSER_PY
|
||||
elif value in ('C', 'c'):
|
||||
if ORIG_PARSER != ovs.json.PARSER_C:
|
||||
raise error.Error("C parser selected, but not compiled")
|
||||
else:
|
||||
ovs.json.PARSER = ovs.json.PARSER_C
|
||||
else:
|
||||
sys.stderr.write("%s: unhandled option %s\n" % (argv0, key))
|
||||
sys.exit(1)
|
||||
|
@@ -23,7 +23,6 @@ import uuid
|
||||
import ovs.db.idl
|
||||
import ovs.db.schema
|
||||
import ovs.db.types
|
||||
import ovs.json
|
||||
import ovs.ovsuuid
|
||||
import ovs.poller
|
||||
import ovs.stream
|
||||
@@ -816,20 +815,14 @@ The following options are also available:
|
||||
|
||||
def main(argv):
|
||||
try:
|
||||
options, args = getopt.gnu_getopt(argv[1:], 't:h:j:',
|
||||
options, args = getopt.gnu_getopt(argv[1:], 't:h',
|
||||
['timeout',
|
||||
'help', 'json-parser'])
|
||||
'help'])
|
||||
except getopt.GetoptError as geo:
|
||||
sys.stderr.write("%s: %s\n" % (ovs.util.PROGRAM_NAME, geo.msg))
|
||||
sys.exit(1)
|
||||
|
||||
timeout = None
|
||||
# Save the old version to detect whether we support the C Parser
|
||||
# but then override to the Python parser because it is always available
|
||||
# and is the historical default
|
||||
ORIG_PARSER = ovs.json.PARSER
|
||||
ovs.json.PARSER = ovs.json.PARSER_PY
|
||||
|
||||
for key, value in options:
|
||||
if key in ['-h', '--help']:
|
||||
usage()
|
||||
@@ -841,17 +834,6 @@ def main(argv):
|
||||
except TypeError:
|
||||
raise error.Error("value %s on -t or --timeout is not at "
|
||||
"least 1" % value)
|
||||
elif key in ['-j', '--json-parser']:
|
||||
if value == "python":
|
||||
ovs.json.PARSER = ovs.json.PARSER_PY
|
||||
elif value in ('C', 'c'):
|
||||
if ORIG_PARSER != ovs.json.PARSER_C:
|
||||
raise error.Error("C parser selected, but not compiled")
|
||||
else:
|
||||
ovs.json.PARSER = ovs.json.PARSER_C
|
||||
else:
|
||||
raise error.Error(
|
||||
"invalid option: %s, json-parser must be 'C' or json")
|
||||
else:
|
||||
sys.exit(0)
|
||||
|
||||
|
Reference in New Issue
Block a user