Add Mac compatibility to integration tests

This commit is contained in:
Brandon Kreisel 2015-10-03 12:50:18 -04:00
parent 74b2e3bc51
commit a4d0188d21
3 changed files with 13 additions and 5 deletions

View file

@ -159,6 +159,7 @@ binary for temporary key/certificate generation.""".replace("\n", "")
# don't care about setting stdout and stderr,
# we're in test mode anyway
shell=True,
executable="/bin/bash",
# "preexec_fn" is UNIX specific, but so is "command"
preexec_fn=os.setsid)
except OSError as error: # ValueError should not happen!

View file

@ -301,11 +301,14 @@ class StandaloneAuthenticator(common.Plugin):
:param int port: The TCP port in question.
:returns: True or False."""
listeners = [conn.pid for conn in psutil.net_connections()
if conn.status == 'LISTEN' and
conn.type == socket.SOCK_STREAM and
conn.laddr[1] == port]
try:
# net_connections() can raise AccessDenied on certain OSs
listeners = [conn.pid for conn in psutil.net_connections()
if conn.status == 'LISTEN' and
conn.type == socket.SOCK_STREAM and
conn.laddr[1] == port]
if listeners and listeners[0] is not None:
# conn.pid may be None if the current process doesn't have
# permission to identify the listening process! Additionally,

View file

@ -50,7 +50,11 @@ dir="$root/conf/archive/le1.wtf"
for x in cert chain fullchain privkey;
do
latest="$(ls -1t $dir/ | grep -e "^${x}" | head -n1)"
live="$(readlink -f "$root/conf/live/le1.wtf/${x}.pem")"
if [ `uname` == 'Darwin' ]; then
live="$(greadlink -f "$root/conf/live/le1.wtf/${x}.pem")"
else
live="$(readlink -f "$root/conf/live/le1.wtf/${x}.pem")"
fi
[ "${dir}/${latest}" = "$live" ] # renewer fails this test
done