diff --git a/changelog/66467.removed.md b/changelog/66467.removed.md new file mode 100644 index 000000000000..aca1198858e0 --- /dev/null +++ b/changelog/66467.removed.md @@ -0,0 +1 @@ +Remove psutil_compat.py file, which should have been removed when RHEL 6 EOL diff --git a/requirements/pytest.txt b/requirements/pytest.txt index ce8b9569125d..82dd91389585 100644 --- a/requirements/pytest.txt +++ b/requirements/pytest.txt @@ -13,3 +13,5 @@ flaky more-itertools pyfakefs trustme +pytest-skip-markers >= 1.5.2 ; python_version >= '3.8' +pytest-skip-markers <= 1.5.1 ; python_version < '3.8' diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index ac9e868a1dc7..b64e1117dc19 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -482,9 +482,10 @@ pytest-shell-utilities==1.8.0 # via # -c requirements/static/ci/py3.10/linux.txt # pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via # -c requirements/static/ci/py3.10/linux.txt + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 1fcec03349a1..e5818d707bcb 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -337,8 +337,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 695496a31fc6..8df94c0cf59a 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -330,8 +330,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 2d58958d020a..e2142dcaa6b7 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -347,8 +347,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index c3d2ca7db3da..ae774c8c5da2 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -308,8 +308,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.11/cloud.txt b/requirements/static/ci/py3.11/cloud.txt index a83527ee15b9..c1f9e9183648 100644 --- a/requirements/static/ci/py3.11/cloud.txt +++ b/requirements/static/ci/py3.11/cloud.txt @@ -446,9 +446,10 @@ pytest-shell-utilities==1.8.0 # via # -c requirements/static/ci/py3.11/linux.txt # pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via # -c requirements/static/ci/py3.11/linux.txt + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index 7fd5ffd488eb..f03ecc33041a 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -308,8 +308,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index b6fc17085aea..f590604d2be9 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -307,8 +307,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index e4dee258e06a..1c23b60c1818 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -324,8 +324,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index 533a506872c4..5805ca012b04 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -304,8 +304,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.12/cloud.txt b/requirements/static/ci/py3.12/cloud.txt index a7aca219fc53..deb11a5621f0 100644 --- a/requirements/static/ci/py3.12/cloud.txt +++ b/requirements/static/ci/py3.12/cloud.txt @@ -446,9 +446,10 @@ pytest-shell-utilities==1.8.0 # via # -c requirements/static/ci/py3.12/linux.txt # pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via # -c requirements/static/ci/py3.12/linux.txt + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.12/darwin.txt b/requirements/static/ci/py3.12/darwin.txt index 5830968b7c27..dee6d2f8a3bd 100644 --- a/requirements/static/ci/py3.12/darwin.txt +++ b/requirements/static/ci/py3.12/darwin.txt @@ -308,8 +308,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.12/freebsd.txt b/requirements/static/ci/py3.12/freebsd.txt index b03594486655..31444237bdad 100644 --- a/requirements/static/ci/py3.12/freebsd.txt +++ b/requirements/static/ci/py3.12/freebsd.txt @@ -307,8 +307,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.12/linux.txt b/requirements/static/ci/py3.12/linux.txt index c0a9ce436b38..5c9055f8c864 100644 --- a/requirements/static/ci/py3.12/linux.txt +++ b/requirements/static/ci/py3.12/linux.txt @@ -324,8 +324,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.12/windows.txt b/requirements/static/ci/py3.12/windows.txt index 83a5207977d4..c154d4f98785 100644 --- a/requirements/static/ci/py3.12/windows.txt +++ b/requirements/static/ci/py3.12/windows.txt @@ -304,8 +304,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index a124d4c40a78..0c6c573ae001 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -530,9 +530,10 @@ pytest-shell-utilities==1.8.0 # via # -c requirements/static/ci/py3.7/linux.txt # pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.0 ; python_version < "3.8" # via # -c requirements/static/ci/py3.7/linux.txt + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 41265a081f7e..a2bc4b2d666f 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -371,8 +371,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.0 ; python_version < "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 03b9b6a2e882..8e5253ad65b2 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -383,8 +383,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.0 ; python_version < "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index de820b25b406..e59c9ccc427c 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -323,8 +323,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.0 ; python_version < "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 92138a595db1..a72f33cb2c92 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -516,9 +516,10 @@ pytest-shell-utilities==1.8.0 # via # -c requirements/static/ci/py3.8/linux.txt # pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via # -c requirements/static/ci/py3.8/linux.txt + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 00cdba1b2256..cbacf12301e8 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -357,8 +357,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 594b8c106b76..583da473b1d7 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -369,8 +369,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 3e67555b202e..9d490f6f8994 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -309,8 +309,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 647fc725be98..8cc07e4db5d7 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -518,9 +518,10 @@ pytest-shell-utilities==1.8.0 # via # -c requirements/static/ci/py3.9/linux.txt # pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via # -c requirements/static/ci/py3.9/linux.txt + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 12a75bae3d96..d54f2e9281f8 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -366,8 +366,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index f56f2ea6544a..1e830cd7cf3d 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -359,8 +359,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 772d1601a6c4..8075f781b7d9 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -369,8 +369,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index af27c5a56d20..03d521b7b0d9 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -310,8 +310,9 @@ pytest-salt-factories==1.0.1 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.5.0 +pytest-skip-markers==1.5.2 ; python_version >= "3.8" # via + # -r requirements/pytest.txt # pytest-salt-factories # pytest-shell-utilities # pytest-system-statistics diff --git a/salt/utils/platform.py b/salt/utils/platform.py index 100918b72d59..59a04b451bcd 100644 --- a/salt/utils/platform.py +++ b/salt/utils/platform.py @@ -228,7 +228,11 @@ def is_aarch64(): """ Simple function to return if host is AArch64 or not """ - return platform.machine().startswith("aarch64") + if is_darwin(): + # Allow for MacOS Arm64 platform returning differently from Linux + return platform.machine().startswith("arm64") + else: + return platform.machine().startswith("aarch64") def spawning_platform(): diff --git a/salt/utils/psutil_compat.py b/salt/utils/psutil_compat.py deleted file mode 100644 index a2ac44e2ae93..000000000000 --- a/salt/utils/psutil_compat.py +++ /dev/null @@ -1,21 +0,0 @@ -""" -Version agnostic psutil hack to fully support both old (<2.0) and new (>=2.0) -psutil versions. - -The old <1.0 psutil API is dropped in psutil 3.0 - -Should be removed once support for psutil <2.0 is dropped. (eg RHEL 6) - -Built off of http://grodola.blogspot.com/2014/01/psutil-20-porting.html -""" - -from psutil import * # pylint: disable=wildcard-import,unused-wildcard-import,3rd-party-module-not-gated - -import salt.utils.versions - -salt.utils.versions.warn_until( - 3008, - "Please stop importing 'salt.utils.psutil_compat' and instead import " - "'psutil' directly as there's no longer a need for a compatability " - "layer. The 'salt.utils.psutil_compat' will go away on Salt {version}.", -) diff --git a/tests/pytests/pkg/downgrade/test_salt_downgrade.py b/tests/pytests/pkg/downgrade/test_salt_downgrade.py index a3206485f1d6..251804530b08 100644 --- a/tests/pytests/pkg/downgrade/test_salt_downgrade.py +++ b/tests/pytests/pkg/downgrade/test_salt_downgrade.py @@ -47,7 +47,7 @@ def test_salt_downgrade_minion(salt_call_cli, install_salt): original_py_version = install_salt.package_python_version() # Verify current install version is setup correctly and works - ret = salt_call_cli.run("test.version") + ret = salt_call_cli.run("--local", "test.version") assert ret.returncode == 0 assert packaging.version.parse(ret.data) == packaging.version.parse( install_salt.artifact_version @@ -76,6 +76,14 @@ def test_salt_downgrade_minion(salt_call_cli, install_salt): # Downgrade Salt to the previous version and test install_salt.install(downgrade=True) + time.sleep(10) # give it some time + # downgrade install will stop services on Debian/Ubuntu + # This is due to RedHat systems are not active after an install, but Debian/Ubuntu are active after an install + # want to ensure our tests start with the config settings we have set, + # trying restart for Debian/Ubuntu to see the outcome + if install_salt.distro_id in ("ubuntu", "debian"): + install_salt.restart_services() + time.sleep(60) # give it some time # Verify there is a new running minion by getting its PID and comparing it @@ -99,7 +107,7 @@ def test_salt_downgrade_minion(salt_call_cli, install_salt): ret.stdout.strip().split()[1] ) < packaging.version.parse(install_salt.artifact_version) - if is_downgrade_to_relenv: + if is_downgrade_to_relenv and not platform.is_darwin(): new_py_version = install_salt.package_python_version() if new_py_version == original_py_version: # test pip install after a downgrade diff --git a/tests/support/pkg.py b/tests/support/pkg.py index 20c851dceddb..066db28921e2 100644 --- a/tests/support/pkg.py +++ b/tests/support/pkg.py @@ -220,6 +220,7 @@ def _default_version(self): version = self.prev_version parsed = packaging.version.parse(version) version = f"{parsed.major}.{parsed.minor}" + # ensure services stopped on Debian/Ubuntu (minic install for RedHat - non-starting) if self.distro_id in ("ubuntu", "debian"): self.stop_services() return version @@ -585,17 +586,16 @@ def install(self, upgrade=False, downgrade=False): def stop_services(self): """ - Debian distros automatically start the services - We want to ensure our tests start with the config - settings we have set. This will also verify the expected - services are up and running. + Debian/Ubuntu distros automatically start the services on install + We want to ensure our tests start with the config settings we have set. + This will also verify the expected services are up and running. """ retval = True for service in ["salt-syndic", "salt-master", "salt-minion"]: check_run = self.proc.run("systemctl", "status", service) if check_run.returncode != 0: - # The system was not started automatically and we - # are expecting it to be on install + # The system was not started automatically and + # we are expecting it to be on install on Debian/Ubuntu systems log.debug("The service %s was not started on install.", service) retval = False else: @@ -603,6 +603,23 @@ def stop_services(self): self._check_retcode(stop_service) return retval + def restart_services(self): + """ + Debian/Ubuntu distros automatically start the services + We want to ensure our tests start with the config settings we have set, + for example: after install the services are stopped (similar to RedHat not starting services on install) + This will also verify the expected services are up and running. + """ + for service in ["salt-minion", "salt-master", "salt-syndic"]: + check_run = self.proc.run("systemctl", "status", service) + log.debug( + "The restart_services status, before restart, for service %s is %s.", + service, + check_run, + ) + restart_service = self.proc.run("systemctl", "restart", service) + self._check_retcode(restart_service) + def install_previous(self, downgrade=False): """ Install previous version. This is used for @@ -706,7 +723,6 @@ def install_previous(self, downgrade=False): gpg_key = gpg_dest if relenv: gpg_key = "SALT-PROJECT-GPG-PUBKEY-2023.gpg" - download_file( f"https://repo.saltproject.io/{root_url}{distro_name}/{self.distro_version}/{arch}/{major_ver}/{gpg_key}", f"/etc/apt/keyrings/{gpg_dest}", @@ -821,14 +837,21 @@ def install_previous(self, downgrade=False): self._install_ssm_service() elif platform.is_darwin(): + if relenv and platform.is_aarch64(): + arch = "arm64" + elif platform.is_aarch64() and self.classic: + arch = "arm64" + else: + arch = "x86_64" + if self.classic: - mac_pkg = f"salt-{self.prev_version}-py3-x86_64.pkg" + mac_pkg = f"salt-{self.prev_version}-py3-{arch}.pkg" mac_pkg_url = f"https://repo.saltproject.io/osx/{mac_pkg}" else: if not relenv: - mac_pkg = f"salt-{self.prev_version}-1-macos-x86_64.pkg" + mac_pkg = f"salt-{self.prev_version}-1-macos-{arch}.pkg" else: - mac_pkg = f"salt-{self.prev_version}-py3-x86_64.pkg" + mac_pkg = f"salt-{self.prev_version}-py3-{arch}.pkg" mac_pkg_url = ( f"https://repo.saltproject.io/salt/py3/macos/{major_ver}/{mac_pkg}" )