Updated tests

This commit is contained in:
David Murphy 2024-06-13 11:27:59 -06:00 committed by Daniel Wozniak
parent 89ee02f891
commit c21f67b915
3 changed files with 51 additions and 34 deletions

View file

@ -11,13 +11,13 @@ from saltfactories.utils.tempfiles import temp_directory
pytestmark = [
pytest.mark.skip_on_windows,
pytest.mark.skip_on_darwin,
pytest.mark.skipif(
True,
reason=(
"Package permissions are getting reworked in "
"https://github.com/saltstack/salt/pull/66218"
),
),
## DGM pytest.mark.skipif(
## DGM True,
## DGM reason=(
## DGM "Package permissions are getting reworked in "
## DGM "https://github.com/saltstack/salt/pull/66218"
## DGM ),
## DGM ),
]

View file

@ -34,6 +34,9 @@ def test_salt_systemd_disabled_preservation(
"""
Test upgrade of Salt packages preserve disabled state of systemd
"""
if not install_salt.upgrade:
pytest.skip("Not testing an upgrade, do not run")
# setup systemd to enabled and active for Salt packages
# pylint: disable=pointless-statement
salt_systemd_setup
@ -66,6 +69,9 @@ def test_salt_systemd_enabled_preservation(
"""
Test upgrade of Salt packages preserve enabled state of systemd
"""
if not install_salt.upgrade:
pytest.skip("Not testing an upgrade, do not run")
# setup systemd to enabled and active for Salt packages
# pylint: disable=pointless-statement
salt_systemd_setup
@ -91,6 +97,9 @@ def test_salt_systemd_inactive_preservation(
"""
Test upgrade of Salt packages preserve inactive state of systemd
"""
if not install_salt.upgrade:
pytest.skip("Not testing an upgrade, do not run")
# setup systemd to enabled and active for Salt packages
# pylint: disable=pointless-statement
salt_systemd_setup
@ -123,6 +132,9 @@ def test_salt_systemd_active_preservation(
"""
Test upgrade of Salt packages preserve active state of systemd
"""
if not install_salt.upgrade:
pytest.skip("Not testing an upgrade, do not run")
# setup systemd to enabled and active for Salt packages
# pylint: disable=pointless-statement
salt_systemd_setup
@ -146,6 +158,9 @@ def test_salt_ownership_permission(salt_call_cli, install_salt, salt_systemd_set
"""
Test upgrade of Salt packages preserve existing ownership
"""
if not install_salt.upgrade:
pytest.skip("Not testing an upgrade, do not run")
# setup systemd to enabled and active for Salt packages
# pylint: disable=pointless-statement
salt_systemd_setup

View file

@ -6,37 +6,13 @@ import pytest
from pytestskipmarkers.utils import platform
@pytest.mark.skip_on_windows
def test_salt_versions_report_minion(salt_cli, salt_call_cli, salt_minion):
"""
Test running test.versions_report on minion
"""
# Make sure the minion is running
assert salt_minion.is_running()
# Make sure we can ping the minion ...
ret = salt_cli.run(
"--timeout=240", "test.ping", minion_tgt=salt_minion.id, _timeout=240
)
assert ret.returncode == 0
assert ret.data is True
ret = salt_cli.run(
"--hard-crash",
"--failhard",
"--timeout=240",
"test.versions_report",
minion_tgt=salt_minion.id,
_timeout=240,
)
ret.stdout.matcher.fnmatch_lines(["*Salt Version:*"])
@pytest.mark.skip_on_windows
def test_salt_version(version, install_salt):
"""
Test version output from salt --version
"""
install_salt.install()
if install_salt.upgrade:
install_salt.install()
test_bin = os.path.join(*install_salt.binary_paths["salt"])
ret = install_salt.proc.run(test_bin, "--version")
@ -65,6 +41,31 @@ def test_salt_versions_report_master(install_salt):
ret.stdout.matcher.fnmatch_lines([f"*{py_version}*"])
@pytest.mark.skip_on_windows
def test_salt_versions_report_minion(salt_cli, salt_call_cli, salt_minion):
"""
Test running test.versions_report on minion
"""
# Make sure the minion is running
assert salt_minion.is_running()
# Make sure we can ping the minion ...
ret = salt_cli.run(
"--timeout=240", "test.ping", minion_tgt=salt_minion.id, _timeout=240
)
assert ret.returncode == 0
assert ret.data is True
ret = salt_cli.run(
"--hard-crash",
"--failhard",
"--timeout=240",
"test.versions_report",
minion_tgt=salt_minion.id,
_timeout=240,
)
ret.stdout.matcher.fnmatch_lines(["*Salt Version:*"])
@pytest.mark.parametrize(
"binary", ["master", "cloud", "syndic", "minion", "call", "api"]
)
@ -73,7 +74,8 @@ def test_compare_versions(version, binary, install_salt):
Test compare versions
"""
if binary in install_salt.binary_paths:
install_salt.install()
if install_salt.upgrade:
install_salt.install()
ret = install_salt.proc.run(
*install_salt.binary_paths[binary],