tests...runtests_helpers: TMPDIR on MacOS gives too long paths

This commit is contained in:
Justin Findlay 2016-03-30 18:53:53 -06:00
parent 0edd532add
commit 8f558a5f41

View File

@ -12,8 +12,20 @@ from __future__ import absolute_import
import os
import tempfile
# Import salt libs
import salt.utils
SYS_TMP_DIR = os.path.realpath(
os.environ.get(
# Avoid MacOS ${TMPDIR} as it yields a base path too long for unix sockets:
# 'error: AF_UNIX path too long'
# Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR}
'TMPDIR' if not salt.utils.is_darwin() else '',
tempfile.gettempdir()
)
)
SYS_TMP_DIR = os.path.realpath(os.environ.get('TMPDIR', tempfile.gettempdir()))
# This tempdir path is defined on tests.integration.__init__
TMP = os.path.join(SYS_TMP_DIR, 'salt-tests-tmpdir')