2 HAVE_OPENSSL='@HAVE_OPENSSL@'
3 HAVE_PYTHON='@HAVE_PYTHON@'
4 HAVE_PYTHON3='@HAVE_PYTHON3@'
8 if test x"$PYTHON" = x; then
12 if test x"$PYTHON3" = x; then
15 # PYTHONCOERCECLOCALE=0 disables the Unicode compatibility warning on
16 # stderr that breaks almost any Python3 test (PEP 0538)
18 export PYTHONCOERCECLOCALE
21 PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH
24 PYTHONIOENCODING=utf_8
25 export PYTHONIOENCODING
27 # PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
28 # files. Creating .py[co] works OK for any given version of Open
29 # vSwitch, but it causes trouble if you switch from a version with
30 # foo/__init__.py into an (older) version with plain foo.py, since
31 # foo/__init__.pyc will cause Python to ignore foo.py.
32 PYTHONDONTWRITEBYTECODE=yes
33 export PYTHONDONTWRITEBYTECODE
35 # Test whether the current working directory name is all ASCII
36 # characters. Some Python code doesn't tolerate non-ASCII characters
37 # in filenames very well, so if the current working directory is
38 # non-ASCII then we skip the tests that run those programs.
40 # This would be just papering over a real problem, except that the
41 # tests that we skip are launched from initscripts and thus normally
42 # run in system directories with ASCII names. (This problem only came
43 # up at all because the Debian autobuilders do build in a top-level
44 # directory named /«BUILDDIR».)
45 case `pwd | tr -d ' -~'` in
46 '') non_ascii_cwd=false ;;
50 # Enable malloc debugging features.
53 MALLOC_PERTURB_=165; export MALLOC_PERTURB_
55 # Before glibc 2.11, the feature enabled by MALLOC_CHECK_ was not
56 # thread-safe. See https://bugzilla.redhat.com/show_bug.cgi?id=585674 and
57 # in particular the patch attached there, which was applied to glibc CVS as
58 # "Restore locking in free_check." between 1.11 and 1.11.1.
59 vswitchd=$abs_top_builddir/vswitchd/ovs-vswitchd
60 glibc=`ldd $vswitchd | sed -n 's/^ libc\.[^ ]* => \([^ ]*\) .*/\1/p'`
61 glibc_version=`$glibc | sed -n '1s/.*version \([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/p'`
62 case $glibc_version in
63 2.[0-9] | 2.1[01]) mcheck=disabled ;;
66 if test $mcheck = enabled; then
67 MALLOC_CHECK_=2; export MALLOC_CHECK_
69 echo >&2 "glibc $glibc_version detected, disabling memory checking"
78 MALLOC_CONF=abort:true,junk:true,redzone:true
84 # The name of loopback interface
90 LOOPBACK_INTERFACE=lo0
110 # Check whether to run IPv6 tests.
112 use Socket qw(PF_INET6 SOCK_STREAM pack_sockaddr_in6 IN6ADDR_LOOPBACK);
114 socket(S, PF_INET6, SOCK_STREAM, 0) || exit 1;
115 bind(S, pack_sockaddr_in6(0, IN6ADDR_LOOPBACK)) || exit 1;
122 # Look for a python L7 library 'LIB' in the system. If it is found, defines
123 # HAVE_LIB="yes", otherwise HAVE_LIB="no"
127 var=HAVE_`echo "$1" | tr '[a-z]' '[A-Z]'`
128 if test "$HAVE_PYTHON" = "yes"; then
129 result=$($PYTHON $abs_top_srcdir/tests/test-l7.py --help | grep "$1")
130 if test "x${result}" != x; then
145 # Look for a commnand in the system. If it is found, defines
146 # HAVE_COMMAND="yes", otherwise HAVE_COMMAND="no".
149 which $1 > /dev/null 2>&1
151 var=HAVE_`echo "$1" | tr '[a-z]' '[A-Z]'`
152 if test "$status" = "0"; then
162 # Determine correct netcat option to quit on stdin EOF
163 if nc --version 2>&1 | grep -q nmap.org; then
165 NC_EOF_OPT="--send-only -w 5"
168 NC_EOF_OPT="-q 1 -w 5"
174 CURL_OPT="-g -v --max-time 1 --retry 2 --retry-delay 1 --connect-timeout 1"