You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-admin/salt/files/salt-3001.1-tests.patch

152 lines
7.0 KiB

diff --git a/tests/integration/master/test_event_return.py b/tests/integration/master/test_event_return.py
index 1a97be0e5f..93c57f08ff 100644
--- a/tests/integration/master/test_event_return.py
+++ b/tests/integration/master/test_event_return.py
@@ -18,7 +18,7 @@ import time
import salt.ext.six as six
from salt.utils.nb_popen import NonBlockingPopen
from saltfactories.utils.ports import get_unused_localhost_port
-from saltfactories.utils.processes.helpers import terminate_process
+from saltfactories.utils.processes import terminate_process
from tests.support.cli_scripts import ScriptPathMixin
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
from tests.support.runtests import RUNTIME_VARS
diff --git a/tests/integration/utils/testprogram.py b/tests/integration/utils/testprogram.py
index 74bbc1cd90..be651591d1 100644
--- a/tests/integration/utils/testprogram.py
+++ b/tests/integration/utils/testprogram.py
@@ -30,7 +30,7 @@ import salt.utils.psutil_compat as psutils
import salt.utils.yaml
from salt.ext import six
from salt.ext.six.moves import range
-from saltfactories.utils.processes.helpers import (
+from saltfactories.utils.processes import (
terminate_process,
terminate_process_list,
)
diff --git a/tests/support/case.py b/tests/support/case.py
index 9017027ae3..517cefb64a 100644
--- a/tests/support/case.py
+++ b/tests/support/case.py
@@ -25,7 +25,7 @@ import time
from datetime import datetime, timedelta
import salt.utils.files
-from saltfactories.utils.processes.helpers import terminate_process
+from saltfactories.utils.processes import terminate_process
from tests.support.cli_scripts import ScriptPathMixin
from tests.support.helpers import RedirectStdStreams, requires_sshd_server
from tests.support.mixins import ( # pylint: disable=unused-import
diff --git a/tests/support/helpers.py b/tests/support/helpers.py
index bae2dceff4..93fbb66742 100644
--- a/tests/support/helpers.py
+++ b/tests/support/helpers.py
@@ -42,7 +42,7 @@ import salt.utils.versions
from salt.ext import six
from salt.ext.six.moves import builtins, range
from saltfactories.utils.ports import get_unused_localhost_port
-from saltfactories.utils.processes.bases import ProcessResult
+from saltfactories.utils.processes import ProcessResult
from tests.support.mock import patch
from tests.support.runtests import RUNTIME_VARS
from tests.support.sminion import create_sminion
@@ -1674,7 +1674,7 @@ class VirtualEnv(object):
kwargs.setdefault("stderr", subprocess.PIPE)
kwargs.setdefault("universal_newlines", True)
proc = subprocess.run(args, check=False, **kwargs)
- ret = ProcessResult(proc.returncode, proc.stdout, proc.stderr, proc.args)
+ ret = ProcessResult(proc.returncode, proc.stdout, proc.stderr, cmdline=proc.args)
log.debug(ret)
if check is True:
proc.check_returncode()
diff --git a/tests/support/paths.py b/tests/support/paths.py
index 1e1e081dc4..981aa54eb7 100644
--- a/tests/support/paths.py
+++ b/tests/support/paths.py
@@ -49,14 +49,12 @@ if TESTS_DIR not in sys.path:
sys.path.insert(1, TESTS_DIR)
SYS_TMP_DIR = os.path.abspath(
- os.path.realpath(
- # Avoid ${TMPDIR} and gettempdir() on MacOS as they yield a base path too long
- # for unix sockets: ``error: AF_UNIX path too long``
- # Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR}
- os.environ.get("TMPDIR", tempfile.gettempdir())
- if not sys.platform.startswith("darwin")
- else "/tmp"
- )
+ # Avoid ${TMPDIR} and gettempdir() on MacOS as they yield a base path too long
+ # for unix sockets: ``error: AF_UNIX path too long``
+ # Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR}
+ os.environ.get("TMPDIR", tempfile.gettempdir())
+ if not sys.platform.startswith("darwin")
+ else "/tmp"
)
TMP = os.path.join(SYS_TMP_DIR, "salt-tests-tmpdir")
TMP_ROOT_DIR = os.path.join(TMP, "rootdir")
diff --git a/tests/support/processes.py b/tests/support/processes.py
index 4f264862a4..7c93e48368 100644
--- a/tests/support/processes.py
+++ b/tests/support/processes.py
@@ -14,7 +14,7 @@ from __future__ import absolute_import
import logging
-from saltfactories.utils.processes.helpers import ( # pylint: disable=unused-import
+from saltfactories.utils.processes import ( # pylint: disable=unused-import
collect_child_processes,
terminate_process,
terminate_process_list,
diff --git a/tests/unit/utils/scheduler/base.py b/tests/unit/utils/scheduler/base.py
index 5d7f161eb5..286e047e40 100644
--- a/tests/unit/utils/scheduler/base.py
+++ b/tests/unit/utils/scheduler/base.py
@@ -14,7 +14,7 @@ import salt.utils.platform
import salt.utils.schedule
from salt.modules.test import ping
from salt.utils.process import SubprocessList
-from saltfactories.utils.processes.helpers import terminate_process
+from saltfactories.utils.processes import terminate_process
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.mock import MagicMock, patch
from tests.support.runtests import RUNTIME_VARS
diff --git a/tests/unit/utils/test_event.py b/tests/unit/utils/test_event.py
index 9a3b1c428d..dfcf1c5275 100644
--- a/tests/unit/utils/test_event.py
+++ b/tests/unit/utils/test_event.py
@@ -21,7 +21,7 @@ import zmq
import zmq.eventloop.ioloop
from salt.ext.six.moves import range
from salt.ext.tornado.testing import AsyncTestCase
-from saltfactories.utils.processes.helpers import terminate_process
+from saltfactories.utils.processes import terminate_process
from tests.support.events import eventpublisher_process, eventsender_process
from tests.support.helpers import slowTest
from tests.support.runtests import RUNTIME_VARS
diff --git a/tests/unit/utils/test_verify.py b/tests/unit/utils/test_verify.py
index 5662cf621b..0339c353dc 100644
--- a/tests/unit/utils/test_verify.py
+++ b/tests/unit/utils/test_verify.py
@@ -343,7 +343,7 @@ class TestCleanPath(TestCase):
def test_clean_path_valid(self):
path_a = os.path.join(self.tmpdir, "foo")
path_b = os.path.join(self.tmpdir, "foo", "bar")
- assert clean_path(path_a, path_b) == path_b
+ assert clean_path(path_a, path_b) == os.path.realpath(path_b)
def test_clean_path_invalid(self):
path_a = os.path.join(self.tmpdir, "foo")
@@ -398,10 +398,10 @@ class TestCleanPathLink(TestCase):
test_path = os.path.join(self.from_path, "test")
expect_path = os.path.join(self.to_path, "test")
ret = clean_path(self.from_path, test_path)
- assert ret == expect_path, "{} is not {}".format(ret, expect_path)
+ assert ret == os.path.realpath(expect_path), "{} is not {}".format(ret, expect_path)
def test_clean_path_symlinked_tgt(self):
test_path = os.path.join(self.to_path, "test")
expect_path = os.path.join(self.to_path, "test")
ret = clean_path(self.from_path, test_path)
- assert ret == expect_path, "{} is not {}".format(ret, expect_path)
+ assert ret == os.path.realpath(expect_path), "{} is not {}".format(ret, expect_path)