From 0d1d9a164954e7f6c19df5e187eecbc14e3d37f0 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 26 Jun 2024 15:05:15 -0600 Subject: [PATCH] Updated test to run on Linux only --- tests/pytests/pkg/integration/test_enabled_disabled.py | 5 ++++- tests/pytests/pkg/integration/test_salt_api.py | 9 +++++++-- tests/pytests/pkg/integration/test_salt_call.py | 4 ++++ tests/pytests/pkg/integration/test_salt_exec.py | 2 +- tests/pytests/pkg/integration/test_salt_grains.py | 2 +- tests/pytests/pkg/integration/test_salt_key.py | 2 +- tests/pytests/pkg/integration/test_salt_output.py | 2 +- tests/pytests/pkg/integration/test_salt_state_file.py | 2 +- tests/pytests/pkg/integration/test_version.py | 9 ++++----- 9 files changed, 24 insertions(+), 13 deletions(-) diff --git a/tests/pytests/pkg/integration/test_enabled_disabled.py b/tests/pytests/pkg/integration/test_enabled_disabled.py index ae6cf51362b..c73d0da29c1 100644 --- a/tests/pytests/pkg/integration/test_enabled_disabled.py +++ b/tests/pytests/pkg/integration/test_enabled_disabled.py @@ -1,8 +1,11 @@ import pytest from pytestskipmarkers.utils import platform +pytestmark = [ + pytest.mark.unless_on_linux, +] + -@pytest.mark.skip_on_windows(reason="Linux test only") def test_services(install_salt, salt_call_cli): """ Check if Services are enabled/disabled diff --git a/tests/pytests/pkg/integration/test_salt_api.py b/tests/pytests/pkg/integration/test_salt_api.py index 76b7d15b4cb..673ced01774 100644 --- a/tests/pytests/pkg/integration/test_salt_api.py +++ b/tests/pytests/pkg/integration/test_salt_api.py @@ -1,14 +1,19 @@ import pytest pytestmark = [ - pytest.mark.skip_on_windows, + pytest.mark.unless_on_linux, ] -def test_salt_api(api_request, salt_master): +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_call.py b/tests/pytests/pkg/integration/test_salt_call.py index c16ecb67481..bbaa5fd7ff2 100644 --- a/tests/pytests/pkg/integration/test_salt_call.py +++ b/tests/pytests/pkg/integration/test_salt_call.py @@ -3,6 +3,10 @@ import subprocess import pytest from pytestskipmarkers.utils import platform +pytestmark = [ + pytest.mark.unless_on_linux, +] + def test_salt_call_local(salt_call_cli): """ diff --git a/tests/pytests/pkg/integration/test_salt_exec.py b/tests/pytests/pkg/integration/test_salt_exec.py index 2e28999d7c3..66874c92806 100644 --- a/tests/pytests/pkg/integration/test_salt_exec.py +++ b/tests/pytests/pkg/integration/test_salt_exec.py @@ -3,7 +3,7 @@ from sys import platform import pytest pytestmark = [ - pytest.mark.skip_on_windows, + pytest.mark.unless_on_linux, ] diff --git a/tests/pytests/pkg/integration/test_salt_grains.py b/tests/pytests/pkg/integration/test_salt_grains.py index 2a609cb9ea0..432d2ea6872 100644 --- a/tests/pytests/pkg/integration/test_salt_grains.py +++ b/tests/pytests/pkg/integration/test_salt_grains.py @@ -1,7 +1,7 @@ import pytest pytestmark = [ - pytest.mark.skip_on_windows, + pytest.mark.unless_on_linux, ] diff --git a/tests/pytests/pkg/integration/test_salt_key.py b/tests/pytests/pkg/integration/test_salt_key.py index 87275a677fa..29f89cdda71 100644 --- a/tests/pytests/pkg/integration/test_salt_key.py +++ b/tests/pytests/pkg/integration/test_salt_key.py @@ -1,7 +1,7 @@ import pytest pytestmark = [ - pytest.mark.skip_on_windows, + pytest.mark.unless_on_linux, ] diff --git a/tests/pytests/pkg/integration/test_salt_output.py b/tests/pytests/pkg/integration/test_salt_output.py index b4d61044846..bad40b9af01 100644 --- a/tests/pytests/pkg/integration/test_salt_output.py +++ b/tests/pytests/pkg/integration/test_salt_output.py @@ -1,7 +1,7 @@ import pytest pytestmark = [ - pytest.mark.skip_on_windows, + pytest.mark.unless_on_linux, ] diff --git a/tests/pytests/pkg/integration/test_salt_state_file.py b/tests/pytests/pkg/integration/test_salt_state_file.py index 0c4804654cb..7d2e246f3c9 100644 --- a/tests/pytests/pkg/integration/test_salt_state_file.py +++ b/tests/pytests/pkg/integration/test_salt_state_file.py @@ -6,7 +6,7 @@ from pytestskipmarkers.utils import platform from saltfactories.utils.functional import MultiStateResult pytestmark = [ - pytest.mark.skip_on_windows, + pytest.mark.unless_on_linux, ] diff --git a/tests/pytests/pkg/integration/test_version.py b/tests/pytests/pkg/integration/test_version.py index 184555c5209..03dfd4c5265 100644 --- a/tests/pytests/pkg/integration/test_version.py +++ b/tests/pytests/pkg/integration/test_version.py @@ -5,8 +5,11 @@ import subprocess import pytest from pytestskipmarkers.utils import platform +pytestmark = [ + pytest.mark.unless_on_linux, +] + -@pytest.mark.skip_on_windows def test_salt_version(version, install_salt): """ Test version output from salt --version @@ -34,7 +37,6 @@ def test_salt_version(version, install_salt): assert actual == expected -@pytest.mark.skip_on_windows def test_salt_versions_report_master(install_salt): """ Test running --versions-report on master @@ -55,7 +57,6 @@ 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 @@ -106,7 +107,6 @@ def test_compare_versions(version, binary, install_salt): ) -@pytest.mark.skip_unless_on_darwin() @pytest.mark.parametrize( "symlink", [ @@ -138,7 +138,6 @@ def test_symlinks_created(version, symlink, install_salt): ret.stdout.matcher.fnmatch_lines([f"*{version}*"]) -@pytest.mark.skip_on_windows() def test_compare_pkg_versions_redhat_rc(version, install_salt): """ Test compare pkg versions for redhat RC packages. A tilde should be included