The Debian autobuild machines run their builds inside a top-level
directory named /«BUILDDIR». That name contains two non-ASCII characters
that cause the Python code in the interface-reconfigure and ovs-monitor-ipsec
tests to fail. The problem seems to be related to the locale, because
switching to a UTF-8 locale allows the tests to proceed farther but does
not fix the problem. I was not able to easily fix the actual problem.
Web searches turn up articles that imply that the problem is not
reasonably fixable with Python 2.x, e.g.:
http://stackoverflow.com/a/
11742928
This commit instead avoids the problem by skipping these tests if the
current working directory's name contains non-ASCII characters. This is
a legitimate solution only because interface-reconfigure and
ovs-monitor-ipsec run from initscripts and thus their current working
directories are system directories. (Also, the current working directory
matters much less when run in a real environment because the --root-prefix
option that causes the issue is not used in a real environment.)
Signed-off-by: Ben Pfaff <blp@nicira.com>
PYTHONDONTWRITEBYTECODE=yes
export PYTHONDONTWRITEBYTECODE
+# Test whether the current working directory name is all ASCII
+# characters. Some Python code doesn't tolerate non-ASCII characters
+# in filenames very well, so if the current working directory is
+# non-ASCII then we skip the tests that run those programs.
+#
+# This would be just papering over a real problem, except that the
+# tests that we skip are launched from initscripts and thus normally
+# run in system directories with ASCII names. (This problem only came
+# up at all because the Debian autobuilders do build in a top-level
+# directory named /«BUILDDIR».)
+case `pwd | tr -d ' -~'` in
+ '') non_ascii_cwd=false ;;
+ *) non_ascii_cwd=true
+esac
+
if test $HAVE_PYTHON = yes; then
if python -m argparse 2>/dev/null; then
:
AT_SETUP([non-VLAN, non-bond])
AT_KEYWORDS([interface-reconfigure])
+AT_SKIP_IF([$non_ascii_cwd])
ifr_setup
AT_CHECK([ifr_run --force xenbr2 up], [0], [], [stderr])
\f
AT_SETUP([VLAN, non-bond])
AT_KEYWORDS([interface-reconfigure])
+AT_SKIP_IF([$non_ascii_cwd])
ifr_setup
AT_CHECK([ifr_run --force xapi3 up], [0], [], [stderr])
\f
AT_SETUP([Bond, non-VLAN])
AT_KEYWORDS([interface-reconfigure])
+AT_SKIP_IF([$non_ascii_cwd])
ifr_setup
# Pretend that bond0 exists, even though it would really be created by
\f
AT_SETUP([VLAN on bond])
AT_KEYWORDS([interface-reconfigure])
+AT_SKIP_IF([$non_ascii_cwd])
ifr_setup
# Pretend that bond0 exists, even though it would really be created by
AT_SETUP([ovs-monitor-ipsec])
AT_SKIP_IF([test $HAVE_PYTHON = no])
+AT_SKIP_IF([$non_ascii_cwd])
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
OVS_DBDIR=`pwd`; export OVS_DBDIR