mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Replace @skipIf(salt.utils.platform.is_freebsd(), ...)
usage
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
8e3db35dd0
commit
442b29a2ac
5 changed files with 8 additions and 13 deletions
|
@ -10,7 +10,7 @@ from tests.support.unit import skipIf
|
|||
|
||||
@pytest.mark.windows_whitelisted
|
||||
@skipIf(salt.utils.platform.is_darwin(), "No mtab on Darwin")
|
||||
@skipIf(salt.utils.platform.is_freebsd(), "No mtab on FreeBSD")
|
||||
@pytest.mark.skip_on_freebsd
|
||||
@pytest.mark.skip_on_windows(reason="No mtab on Windows")
|
||||
@pytest.mark.destructive_test
|
||||
class DiskModuleVirtualizationTest(ModuleCase):
|
||||
|
|
|
@ -8,7 +8,6 @@ import salt.utils.user
|
|||
from tests.support.case import ModuleCase
|
||||
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
|
||||
from tests.support.runtests import RUNTIME_VARS
|
||||
from tests.support.unit import skipIf
|
||||
|
||||
# Doesn't work. Why?
|
||||
# @requires_salt_modules('acl')
|
||||
|
@ -51,11 +50,11 @@ class LinuxAclModuleTest(ModuleCase, AdaptedConfigurationTestCaseMixin):
|
|||
shutil.rmtree(self.mydir, ignore_errors=True)
|
||||
super().tearDown()
|
||||
|
||||
@skipIf(salt.utils.platform.is_freebsd(), "Skip on FreeBSD")
|
||||
@pytest.mark.skip_on_freebsd
|
||||
def test_version(self):
|
||||
self.assertRegex(self.run_function("acl.version"), r"\d+\.\d+\.\d+")
|
||||
|
||||
@skipIf(salt.utils.platform.is_freebsd(), "Skip on FreeBSD")
|
||||
@pytest.mark.skip_on_freebsd
|
||||
def test_getfacl_w_single_file_without_acl(self):
|
||||
ret = self.run_function("acl.getfacl", arg=[self.myfile])
|
||||
user = salt.utils.user.get_user()
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import pytest
|
||||
|
||||
import salt.utils.platform
|
||||
from tests.support.case import ModuleCase
|
||||
from tests.support.unit import skipIf
|
||||
|
||||
|
||||
@pytest.mark.skip_on_windows(reason="minion is windows")
|
||||
@skipIf(salt.utils.platform.is_darwin(), "locale method is not supported on mac")
|
||||
@skipIf(
|
||||
salt.utils.platform.is_freebsd(),
|
||||
"locale method is supported only within login classes or environment variables",
|
||||
@pytest.mark.skip_on_freebsd(
|
||||
reason="locale method is supported only within login classes or environment variables"
|
||||
)
|
||||
@pytest.mark.requires_salt_modules("locale")
|
||||
@pytest.mark.windows_whitelisted
|
||||
|
|
|
@ -7,7 +7,6 @@ import salt.utils.files
|
|||
import salt.utils.platform
|
||||
from tests.support.case import ModuleCase
|
||||
from tests.support.runtests import RUNTIME_VARS
|
||||
from tests.support.unit import skipIf
|
||||
|
||||
|
||||
@pytest.mark.windows_whitelisted
|
||||
|
@ -24,7 +23,7 @@ class EnabledTest(ModuleCase):
|
|||
)
|
||||
|
||||
@pytest.mark.skip_on_windows(reason="Skip on Windows OS")
|
||||
@skipIf(salt.utils.platform.is_freebsd(), "Skip on FreeBSD")
|
||||
@pytest.mark.skip_on_freebsd
|
||||
def test_shell_default_enabled(self):
|
||||
"""
|
||||
ensure that python_shell defaults to True for cmd.run
|
||||
|
@ -46,7 +45,7 @@ class EnabledTest(ModuleCase):
|
|||
self.assertEqual(ret, disabled_ret)
|
||||
|
||||
@pytest.mark.skip_on_windows(reason="Skip on Windows OS")
|
||||
@skipIf(salt.utils.platform.is_freebsd(), "Skip on FreeBSD")
|
||||
@pytest.mark.skip_on_freebsd
|
||||
def test_template_shell(self):
|
||||
"""
|
||||
Test cmd.shell works correctly when using a template.
|
||||
|
|
|
@ -197,7 +197,7 @@ def test_blkid(stub_disk_blkid):
|
|||
|
||||
@pytest.mark.skip_on_windows(reason="Skip on Windows")
|
||||
@skipIf(salt.utils.platform.is_darwin(), "Skip on Darwin")
|
||||
@skipIf(salt.utils.platform.is_freebsd(), "Skip on FreeBSD")
|
||||
@pytest.mark.skip_on_freebsd
|
||||
def test_blkid_token():
|
||||
run_stdout_mock = MagicMock(return_value={"retcode": 1})
|
||||
with patch.dict(disk.__salt__, {"cmd.run_all": run_stdout_mock}):
|
||||
|
|
Loading…
Add table
Reference in a new issue