summaryrefslogtreecommitdiff
blob: ad32b611dfe235ca22d4bcd4c979298229c50f4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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)