mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
The tests get the `grains
from the fixture not the
requires_system_grains
decorator
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
49f46b166c
commit
af52993670
3 changed files with 0 additions and 26 deletions
|
@ -9,7 +9,6 @@ import pytest
|
|||
import salt.utils.path
|
||||
import salt.utils.pkg
|
||||
import salt.utils.platform
|
||||
from tests.support.helpers import requires_system_grains
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -38,7 +37,6 @@ def preserve_rhel_yum_conf():
|
|||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@requires_system_grains
|
||||
def refresh_db(ctx, grains, modules):
|
||||
if "refresh" not in ctx:
|
||||
modules.pkg.refresh_db()
|
||||
|
@ -56,7 +54,6 @@ def refresh_db(ctx, grains, modules):
|
|||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@requires_system_grains
|
||||
def test_pkg(grains):
|
||||
_pkg = "figlet"
|
||||
if salt.utils.platform.is_windows():
|
||||
|
@ -82,7 +79,6 @@ def test_list(modules):
|
|||
|
||||
|
||||
@pytest.mark.requires_salt_modules("pkg.version_cmp")
|
||||
@requires_system_grains
|
||||
@pytest.mark.slow_test
|
||||
def test_version_cmp(grains, modules):
|
||||
"""
|
||||
|
@ -108,7 +104,6 @@ def test_version_cmp(grains, modules):
|
|||
|
||||
@pytest.mark.destructive_test
|
||||
@pytest.mark.requires_salt_modules("pkg.mod_repo", "pkg.del_repo", "pkg.get_repo")
|
||||
@requires_system_grains
|
||||
@pytest.mark.slow_test
|
||||
@pytest.mark.requires_network
|
||||
def test_mod_del_repo(grains, modules):
|
||||
|
@ -275,7 +270,6 @@ def test_install_remove(modules, test_pkg):
|
|||
"pkg.remove",
|
||||
"pkg.list_pkgs",
|
||||
)
|
||||
@requires_system_grains
|
||||
@pytest.mark.slow_test
|
||||
@pytest.mark.requires_network
|
||||
@pytest.mark.requires_salt_states("pkg.installed")
|
||||
|
@ -323,7 +317,6 @@ def test_hold_unhold(grains, modules, states, test_pkg):
|
|||
|
||||
@pytest.mark.destructive_test
|
||||
@pytest.mark.requires_salt_modules("pkg.refresh_db")
|
||||
@requires_system_grains
|
||||
@pytest.mark.slow_test
|
||||
@pytest.mark.requires_network
|
||||
def test_refresh_db(grains, modules, tmp_path, minion_opts):
|
||||
|
@ -351,7 +344,6 @@ def test_refresh_db(grains, modules, tmp_path, minion_opts):
|
|||
|
||||
|
||||
@pytest.mark.requires_salt_modules("pkg.info_installed")
|
||||
@requires_system_grains
|
||||
@pytest.mark.slow_test
|
||||
def test_pkg_info(grains, modules, test_pkg):
|
||||
"""
|
||||
|
@ -387,7 +379,6 @@ def test_pkg_info(grains, modules, test_pkg):
|
|||
"pkg.list_repo_pkgs",
|
||||
"pkg.list_upgrades",
|
||||
)
|
||||
@requires_system_grains
|
||||
@pytest.mark.slow_test
|
||||
@pytest.mark.requires_network
|
||||
def test_pkg_upgrade_has_pending_upgrades(grains, modules, test_pkg):
|
||||
|
@ -467,7 +458,6 @@ def test_pkg_upgrade_has_pending_upgrades(grains, modules, test_pkg):
|
|||
" unrunnable",
|
||||
)
|
||||
@pytest.mark.requires_salt_modules("pkg.remove", "pkg.latest_version")
|
||||
@requires_system_grains
|
||||
@pytest.mark.slow_test
|
||||
@pytest.mark.requires_salt_states("pkg.removed")
|
||||
def test_pkg_latest_version(grains, modules, states, test_pkg):
|
||||
|
@ -511,7 +501,6 @@ def test_pkg_latest_version(grains, modules, states, test_pkg):
|
|||
@pytest.mark.destructive_test
|
||||
@pytest.mark.requires_salt_modules("pkg.list_repos")
|
||||
@pytest.mark.slow_test
|
||||
@requires_system_grains
|
||||
def test_list_repos_duplicate_entries(preserve_rhel_yum_conf, grains, modules):
|
||||
"""
|
||||
test duplicate entries in /etc/yum.conf
|
||||
|
|
|
@ -11,7 +11,6 @@ import salt.utils.files
|
|||
import salt.utils.path
|
||||
import salt.utils.pkg.rpm
|
||||
import salt.utils.platform
|
||||
from tests.support.helpers import requires_system_grains
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -23,7 +22,6 @@ pytestmark = [
|
|||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@requires_system_grains
|
||||
def refresh_db(ctx, grains, modules):
|
||||
if "refresh" not in ctx:
|
||||
modules.pkg.refresh_db()
|
||||
|
@ -41,7 +39,6 @@ def refresh_db(ctx, grains, modules):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
@requires_system_grains
|
||||
def PKG_TARGETS(grains):
|
||||
_PKG_TARGETS = ["figlet", "sl"]
|
||||
if grains["os"] == "Windows":
|
||||
|
@ -60,7 +57,6 @@ def PKG_TARGETS(grains):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
@requires_system_grains
|
||||
def PKG_CAP_TARGETS(grains):
|
||||
_PKG_CAP_TARGETS = []
|
||||
if grains["os_family"] == "Suse":
|
||||
|
@ -70,7 +66,6 @@ def PKG_CAP_TARGETS(grains):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
@requires_system_grains
|
||||
def PKG_32_TARGETS(grains):
|
||||
_PKG_32_TARGETS = []
|
||||
if grains["os_family"] == "RedHat":
|
||||
|
@ -83,7 +78,6 @@ def PKG_32_TARGETS(grains):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
@requires_system_grains
|
||||
def PKG_DOT_TARGETS(grains):
|
||||
_PKG_DOT_TARGETS = []
|
||||
if grains["os_family"] == "RedHat":
|
||||
|
@ -99,7 +93,6 @@ def PKG_DOT_TARGETS(grains):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
@requires_system_grains
|
||||
def PKG_EPOCH_TARGETS(grains):
|
||||
_PKG_EPOCH_TARGETS = []
|
||||
if grains["os_family"] == "RedHat":
|
||||
|
@ -112,7 +105,6 @@ def PKG_EPOCH_TARGETS(grains):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
@requires_system_grains
|
||||
def VERSION_SPEC_SUPPORTED(grains):
|
||||
_VERSION_SPEC_SUPPORTED = True
|
||||
if grains["os"] == "FreeBSD":
|
||||
|
@ -121,7 +113,6 @@ def VERSION_SPEC_SUPPORTED(grains):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
@requires_system_grains
|
||||
def WILDCARDS_SUPPORTED(grains):
|
||||
_WILDCARDS_SUPPORTED = False
|
||||
if grains["os_family"] in ("Arch", "Debian"):
|
||||
|
@ -414,7 +405,6 @@ def test_pkg_010_latest(PKG_TARGETS, latest_version, states):
|
|||
@pytest.mark.requires_salt_modules("pkg.list_pkgs", "pkg.list_upgrades", "pkg.version")
|
||||
@pytest.mark.requires_salt_states("pkg.latest")
|
||||
@pytest.mark.slow_test
|
||||
@requires_system_grains
|
||||
def test_pkg_011_latest_only_upgrade(
|
||||
grains, PKG_TARGETS, latest_version, states, modules
|
||||
):
|
||||
|
@ -520,7 +510,6 @@ def test_pkg_012_installed_with_wildcard_version(
|
|||
|
||||
@pytest.mark.requires_salt_modules("pkg.version", "pkg.latest_version")
|
||||
@pytest.mark.requires_salt_states("pkg.installed", "pkg.removed")
|
||||
@requires_system_grains
|
||||
def test_pkg_013_installed_with_comparison_operator(
|
||||
grains, PKG_TARGETS, states, modules
|
||||
):
|
||||
|
@ -591,7 +580,6 @@ def test_pkg_014_installed_missing_release(grains, PKG_TARGETS, states, modules)
|
|||
"pkg.hold", "pkg.unhold", "pkg.version", "pkg.list_pkgs"
|
||||
)
|
||||
@pytest.mark.requires_salt_states("pkg.installed", "pkg.removed")
|
||||
@requires_system_grains
|
||||
def test_pkg_015_installed_held(grains, modules, states, PKG_TARGETS):
|
||||
"""
|
||||
Tests that a package can be held even when the package is already installed.
|
||||
|
@ -710,7 +698,6 @@ def test_pkg_016_conditionally_ignore_epoch(PKG_EPOCH_TARGETS, latest_version, s
|
|||
"pkg.hold", "pkg.unhold", "pkg.version", "pkg.list_pkgs"
|
||||
)
|
||||
@pytest.mark.requires_salt_states("pkg.installed", "pkg.removed")
|
||||
@requires_system_grains
|
||||
def test_pkg_017_installed_held_equals_false(grains, modules, states, PKG_TARGETS):
|
||||
"""
|
||||
Tests that a package is installed when hold is explicitly False.
|
||||
|
|
|
@ -3,7 +3,6 @@ Integration tests for modules/useradd.py and modules/win_useradd.py
|
|||
"""
|
||||
import pytest
|
||||
from saltfactories.utils import random_string
|
||||
from tests.support.helpers import requires_system_grains
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.windows_whitelisted,
|
||||
|
@ -26,7 +25,6 @@ def setup_teardown_vars(salt_call_cli):
|
|||
@pytest.mark.skip_on_windows(reason="Windows does not do user checks")
|
||||
@pytest.mark.destructive_test
|
||||
@pytest.mark.skip_if_not_root
|
||||
@requires_system_grains
|
||||
def test_groups_includes_primary(setup_teardown_vars, grains, salt_call_cli):
|
||||
# Let's create a user, which usually creates the group matching the
|
||||
# name
|
||||
|
|
Loading…
Add table
Reference in a new issue