mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Add Mac compatibility to integration tests
This commit is contained in:
parent
74b2e3bc51
commit
a4d0188d21
3 changed files with 13 additions and 5 deletions
|
|
@ -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!
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue