]> git.proxmox.com Git - mirror_ovs.git/blame - tests/atlocal.in
datapath: compat: Fix build on RHEL 7.3
[mirror_ovs.git] / tests / atlocal.in
CommitLineData
1b233b95 1# -*- shell-script -*-
d27ce529 2HAVE_OPENSSL='@HAVE_OPENSSL@'
05b3c97b 3HAVE_PYTHON='@HAVE_PYTHON@'
8fb7d026 4HAVE_PYTHON3='@HAVE_PYTHON3@'
8073dd31 5EGREP='@EGREP@'
05b3c97b 6PERL='@PERL@'
79982e90
EJ
7
8if test x"$PYTHON" = x; then
9 PYTHON='@PYTHON@'
10fi
99155935 11
8fb7d026
RB
12if test x"$PYTHON3" = x; then
13 PYTHON3='@PYTHON3@'
14fi
15
67e96a5d 16PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH
99155935 17export PYTHONPATH
be44585c
BP
18
19PYTHONIOENCODING=utf_8
20export PYTHONIOENCODING
42c2ebcd 21
e23812fc 22# PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
853d1083
BP
23# files. Creating .py[co] works OK for any given version of Open
24# vSwitch, but it causes trouble if you switch from a version with
25# foo/__init__.py into an (older) version with plain foo.py, since
26# foo/__init__.pyc will cause Python to ignore foo.py.
853d1083
BP
27PYTHONDONTWRITEBYTECODE=yes
28export PYTHONDONTWRITEBYTECODE
29
e6e590a7
BP
30# Test whether the current working directory name is all ASCII
31# characters. Some Python code doesn't tolerate non-ASCII characters
32# in filenames very well, so if the current working directory is
33# non-ASCII then we skip the tests that run those programs.
34#
35# This would be just papering over a real problem, except that the
36# tests that we skip are launched from initscripts and thus normally
37# run in system directories with ASCII names. (This problem only came
38# up at all because the Debian autobuilders do build in a top-level
39# directory named /«BUILDDIR».)
40case `pwd | tr -d ' -~'` in
41 '') non_ascii_cwd=false ;;
42 *) non_ascii_cwd=true
43esac
44
f0b87599
EM
45# Enable malloc debugging features.
46case `uname` in
47Linux)
b6137ea8
BP
48 MALLOC_PERTURB_=165; export MALLOC_PERTURB_
49
50 # Before glibc 2.11, the feature enabled by MALLOC_CHECK_ was not
51 # thread-safe. See https://bugzilla.redhat.com/show_bug.cgi?id=585674 and
52 # in particular the patch attached there, which was applied to glibc CVS as
53 # "Restore locking in free_check." between 1.11 and 1.11.1.
54 vswitchd=$abs_top_builddir/vswitchd/ovs-vswitchd
55 glibc=`ldd $vswitchd | sed -n 's/^ libc\.[^ ]* => \([^ ]*\) .*/\1/p'`
56 glibc_version=`$glibc | sed -n '1s/.*version \([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/p'`
57 case $glibc_version in
58 2.[0-9] | 2.1[01]) mcheck=disabled ;;
59 *) mcheck=enabled ;;
60 esac
61 if test $mcheck = enabled; then
62 MALLOC_CHECK_=2; export MALLOC_CHECK_
63 else
64 echo >&2 "glibc $glibc_version detected, disabling memory checking"
65 fi
f0b87599
EM
66 ;;
67FreeBSD)
68 case `uname -r` in
69 [789].*)
70 MALLOC_CONF=AJ
71 ;;
72 *)
73 MALLOC_CONF=abort:true,junk:true,redzone:true
74 ;;
75 esac
76 export MALLOC_CONF
77esac
9a9808d7
YT
78
79# The name of loopback interface
80case `uname` in
81Linux)
82 LOOPBACK_INTERFACE=lo
83 ;;
84FreeBSD|NetBSD)
85 LOOPBACK_INTERFACE=lo0
86 ;;
87esac
c7c1bdf3 88
d98e1498 89# Check for platform.
c7c1bdf3
GS
90case `uname` in
91MINGW*)
92 IS_WIN32="yes"
d98e1498
PS
93 IS_BSD="no"
94 ;;
95FreeBSD|NetBSD)
96 IS_WIN32="no"
97 IS_BSD="yes"
c7c1bdf3
GS
98 ;;
99*)
100 IS_WIN32="no"
d98e1498 101 IS_BSD="no"
c7c1bdf3
GS
102 ;;
103esac
0f1e8ed0 104
4819b3a5
BP
105# Check whether to run IPv6 tests.
106if perl -e 'use Socket; socket(FH, PF_INET6, SOCK_STREAM, 0) || exit 1;'; then
107 HAVE_IPV6=yes
108else
109 HAVE_IPV6=no
110fi
111
0f1e8ed0
GS
112# XXX: Disable Python related tests on Windows because Open vSwitch code
113# written in Python has not been ported to the Windows platform. We will
114# need to remove the next block after porting is complete.
115if test "$IS_WIN32" = "yes"; then
116 HAVE_PYTHON="no"
0ec785c3 117 HAVE_PYTHON3="no"
0f1e8ed0 118fi
07659514 119
d787ad39
JS
120if test "$HAVE_PYTHON" = "yes" \
121 && test "x`$PYTHON $abs_top_srcdir/tests/test-l7.py --help | grep 'ftp'`" != x; then
122 HAVE_PYFTPDLIB="yes"
123else
124 HAVE_PYFTPDLIB="no"
125fi
b54971f7
LR
126
127# Determine correct netcat option to quit on stdin EOF
128if nc --version 2>&1 | grep -q nmap.org; then
129 NC_EOF_OPT="--send-only"
130else
131 NC_EOF_OPT="-q 1"
132fi
4fee8b13
JR
133
134# Turn off proxies.
135unset http_proxy
136unset https_proxy
137unset ftp_proxy
138unset no_proxy
139unset HTTP_PROXY
140unset HTTPS_PROXY
141unset FTP_PROXY
142unset NO_PROXY