From 8f558a5f4197933f6f8e4a9877a4de9e315f2b03 Mon Sep 17 00:00:00 2001 From: Justin Findlay Date: Wed, 30 Mar 2016 18:53:53 -0600 Subject: [PATCH] tests...runtests_helpers: TMPDIR on MacOS gives too long paths --- .../files/file/base/_modules/runtests_helpers.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/integration/files/file/base/_modules/runtests_helpers.py b/tests/integration/files/file/base/_modules/runtests_helpers.py index ca8ef50959..943c514f71 100644 --- a/tests/integration/files/file/base/_modules/runtests_helpers.py +++ b/tests/integration/files/file/base/_modules/runtests_helpers.py @@ -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')