2 HAVE_OPENSSL='@HAVE_OPENSSL@'
3 HAVE_PYTHON='@HAVE_PYTHON@'
4 HAVE_PYTHON3='@HAVE_PYTHON3@'
7 if test x"$PYTHON" = x; then
11 if test x"$PYTHON3" = x; then
14 # PYTHONCOERCECLOCALE=0 disables the Unicode compatibility warning on
15 # stderr that breaks almost any Python3 test (PEP 0538)
17 export PYTHONCOERCECLOCALE
20 PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH
23 PYTHONIOENCODING=utf_8
24 export PYTHONIOENCODING
26 # PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
27 # files. Creating .py[co] works OK for any given version of Open
28 # vSwitch, but it causes trouble if you switch from a version with
29 # foo/__init__.py into an (older) version with plain foo.py, since
30 # foo/__init__.pyc will cause Python to ignore foo.py.
31 PYTHONDONTWRITEBYTECODE=yes
32 export PYTHONDONTWRITEBYTECODE
34 # Test whether the current working directory name is all ASCII
35 # characters. Some Python code doesn't tolerate non-ASCII characters
36 # in filenames very well, so if the current working directory is
37 # non-ASCII then we skip the tests that run those programs.
39 # This would be just papering over a real problem, except that the
40 # tests that we skip are launched from initscripts and thus normally
41 # run in system directories with ASCII names. (This problem only came
42 # up at all because the Debian autobuilders do build in a top-level
43 # directory named /«BUILDDIR».)
44 case `pwd | tr -d ' -~'` in
45 '') non_ascii_cwd=false ;;
49 # Enable malloc debugging features.
52 MALLOC_PERTURB_=165; export MALLOC_PERTURB_
54 # Before glibc 2.11, the feature enabled by MALLOC_CHECK_ was not
55 # thread-safe. See https://bugzilla.redhat.com/show_bug.cgi?id=585674 and
56 # in particular the patch attached there, which was applied to glibc CVS as
57 # "Restore locking in free_check." between 1.11 and 1.11.1.
58 vswitchd=$abs_top_builddir/vswitchd/ovs-vswitchd
59 glibc=`ldd $vswitchd | sed -n 's/^ libc\.[^ ]* => \([^ ]*\) .*/\1/p'`
60 glibc_version=`$glibc | sed -n '1s/.*version \([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/p'`
61 case $glibc_version in
62 2.[0-9] | 2.1[01]) mcheck=disabled ;;
65 if test $mcheck = enabled; then
66 MALLOC_CHECK_=2; export MALLOC_CHECK_
68 echo >&2 "glibc $glibc_version detected, disabling memory checking"
77 MALLOC_CONF=abort:true,junk:true,redzone:true
83 # The name of loopback interface
89 LOOPBACK_INTERFACE=lo0
109 # Check whether to run IPv6 tests.
112 socket.socket(family=socket.AF_INET6).bind(("::1", 0, 0, 0))
119 # Look for a python L7 library 'LIB' in the system. If it is found, defines
120 # HAVE_LIB="yes", otherwise HAVE_LIB="no"
124 var=HAVE_`echo "$1" | tr '[a-z]' '[A-Z]'`
125 if test "$HAVE_PYTHON" = "yes"; then
126 result=$($PYTHON $abs_top_srcdir/tests/test-l7.py --help | grep "$1")
127 if test "x${result}" != x; then
142 # Look for a commnand in the system. If it is found, defines
143 # HAVE_COMMAND="yes", otherwise HAVE_COMMAND="no".
146 which $1 > /dev/null 2>&1
148 var=HAVE_`echo "$1" | tr '[a-z]' '[A-Z]'`
149 if test "$status" = "0"; then
159 # Determine correct netcat option to quit on stdin EOF
160 if nc --version 2>&1 | grep -q nmap.org; then
162 NC_EOF_OPT="--send-only -w 5"
165 NC_EOF_OPT="-q 1 -w 5"
171 CURL_OPT="-g -v --max-time 1 --retry 2 --retry-delay 1 --connect-timeout 1"
173 # Determine whether "diff" supports "normal" diffs. (busybox diff does not.)
174 if echo xyzzy | diff /dev/null - | grep '^>' >/dev/null; then
175 DIFF_SUPPORTS_NORMAL_FORMAT=yes
177 DIFF_SUPPORTS_NORMAL_FORMAT=no