From 853d3dafe3b9228cbecdca317268d7d9dfc2026d Mon Sep 17 00:00:00 2001 From: David Murphy Date: Tue, 20 Aug 2024 11:38:59 -0600 Subject: [PATCH] Added delay for salt_master running, and updated some package tests --- .../pytests/pkg/integration/test_salt_api.py | 5 ---- .../pytests/pkg/integration/test_salt_user.py | 30 ++++++++++++------- tests/pytests/pkg/integration/test_version.py | 8 +++-- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/tests/pytests/pkg/integration/test_salt_api.py b/tests/pytests/pkg/integration/test_salt_api.py index e962fbe3221..a4f11973748 100644 --- a/tests/pytests/pkg/integration/test_salt_api.py +++ b/tests/pytests/pkg/integration/test_salt_api.py @@ -9,11 +9,6 @@ def test_salt_api(api_request, salt_master, install_salt): """ Test running a command against the salt api """ - 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( diff --git a/tests/pytests/pkg/integration/test_salt_user.py b/tests/pytests/pkg/integration/test_salt_user.py index aad60827518..96180a972fe 100644 --- a/tests/pytests/pkg/integration/test_salt_user.py +++ b/tests/pytests/pkg/integration/test_salt_user.py @@ -2,6 +2,7 @@ import os import pathlib import subprocess import sys +import time import packaging.version import psutil @@ -91,6 +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): + if salt_master.is_running(): + break + else: + time.sleep(1) assert salt_master.is_running() match = False @@ -227,17 +235,17 @@ def test_paths_log_rotation( ): pytest.skip("Package path ownership was changed in salt 3006.4") - if install_salt.distro_id not in ( - "almalinux", - "rocky", - "centos", - "redhat", - "amzn", - "fedora", - ): - pytest.skip( - "Only tests RedHat family packages till logrotation paths are resolved on Ubuntu/Debian, see issue 65231" - ) + # DGM if install_salt.distro_id not in ( + # DGM "almalinux", + # DGM "rocky", + # DGM "centos", + # DGM "redhat", + # DGM "amzn", + # DGM "fedora", + # DGM ): + # DGM pytest.skip( + # DGM "Only tests RedHat family packages till logrotation paths are resolved on Ubuntu/Debian, see issue 65231" + # DGM ) match = False for proc in psutil.Process(salt_master.pid).children(): diff --git a/tests/pytests/pkg/integration/test_version.py b/tests/pytests/pkg/integration/test_version.py index b1bee9d60af..dc710f1b7cc 100644 --- a/tests/pytests/pkg/integration/test_version.py +++ b/tests/pytests/pkg/integration/test_version.py @@ -6,7 +6,7 @@ import pytest from pytestskipmarkers.utils import platform -@pytest.mark.skip_on_windows +# DGM @pytest.mark.skip_on_windows def test_salt_version(version, install_salt): """ Test version output from salt --version @@ -35,6 +35,7 @@ def test_salt_version(version, install_salt): @pytest.mark.skip_on_windows +@pytest.mark.skip_on_darwin def test_salt_versions_report_master(install_salt): """ Test running --versions-report on master @@ -52,7 +53,7 @@ def test_salt_versions_report_master(install_salt): ret.stdout.matcher.fnmatch_lines([f"*{py_version}*"]) -@pytest.mark.skip_on_windows +# DGM @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 @@ -104,7 +105,8 @@ def test_compare_versions(binary, install_salt): ) -@pytest.mark.skip_unless_on_darwin() +# DGM +@pytest.mark.skip_on_windows @pytest.mark.parametrize( "symlink", [