Adjust tests for syndic

This commit is contained in:
David Murphy 2024-08-23 13:18:17 -06:00 committed by Daniel Wozniak
parent b0e1dfd7b3
commit 2c8becaf81
4 changed files with 26 additions and 11 deletions

View file

@ -2505,8 +2505,8 @@ def syndic_config(
# DGM conf/suse/master has syndic_user for running syndic as a different user
# DGM use urrently set it to 'salt'
# DGM testing getting the master_opts user, and run syndic as that
"user": opts.get("syndic_user", opts["user"]),
# DGM test revert "user": opts.get("syndic_user", master_opts["user"]),
# DGM "user": opts.get("syndic_user", opts["user"]),
"user": opts.get("syndic_user", master_opts["user"]),
"sock_dir": os.path.join(
opts["cachedir"], opts.get("syndic_sock_dir", opts["sock_dir"])
),

View file

@ -9,6 +9,12 @@ def test_salt_api(api_request, salt_master, install_salt):
"""
Test running a command against the salt api
"""
# DGM TBD 66672 is merged, need to remove this check and see if test passes
if install_salt.distro_id in ("ubuntu", "debian"):
pytest.skip(
"Package test are getting reworked in https://github.com/saltstack/salt/issues/66672"
)
assert salt_master.is_running()
ret = api_request.post(

View file

@ -92,13 +92,13 @@ def test_salt_user_master(salt_master, install_salt):
"""
Test the correct user is running the Salt Master
"""
# DGM assert salt_master.is_running()
for count in range(0, 10):
for count in range(0, 30):
if salt_master.is_running():
break
else:
time.sleep(1)
time.sleep(2)
print(f"DGM test_salt_user_master, salt_master '{salt_master}'", flush=True)
assert salt_master.is_running()
match = False

View file

@ -1,12 +1,13 @@
import os.path
import pathlib
import subprocess
import time
import pytest
from pytestskipmarkers.utils import platform
# DGM @pytest.mark.skip_on_windows
@pytest.mark.skip_on_windows
def test_salt_version(version, install_salt):
"""
Test version output from salt --version
@ -53,12 +54,19 @@ def test_salt_versions_report_master(install_salt):
ret.stdout.matcher.fnmatch_lines([f"*{py_version}*"])
# DGM @pytest.mark.skip_on_windows
@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
for count in range(0, 30):
if salt_minion.is_running():
break
else:
time.sleep(2)
print(f"DGM test_salt_user_mnion, salt_minion '{salt_minion}'", flush=True)
assert salt_minion.is_running()
# Make sure we can ping the minion ...
@ -78,6 +86,8 @@ def test_salt_versions_report_minion(salt_cli, salt_call_cli, salt_minion):
ret.stdout.matcher.fnmatch_lines(["*Salt Version:*"])
@pytest.mark.skip_on_windows
@pytest.mark.skip_on_darwin
@pytest.mark.parametrize(
"binary", ["master", "cloud", "syndic", "minion", "call", "api"]
)
@ -105,8 +115,8 @@ def test_compare_versions(binary, install_salt):
)
# DGM
@pytest.mark.skip_on_windows
@pytest.mark.skip_on_darwin
@pytest.mark.parametrize(
"symlink",
[
@ -134,8 +144,7 @@ def test_symlinks_created(version, symlink, install_salt):
ret.stdout.matcher.fnmatch_lines([f"*{version}*"])
@pytest.mark.skip_on_windows
@pytest.mark.skip_on_darwin
@pytest.mark.skip_unless_on_linux
def test_compare_pkg_versions_redhat_rc(version, install_salt):
"""
Test compare pkg versions for redhat RC packages. A tilde should be included