Merge pull request #56659 from s0undt3ch/hotfix/whitelist-marker

Add windows test whitelisting as pytest markers
This commit is contained in:
Daniel Wozniak 2020-04-17 09:47:06 -07:00 committed by GitHub
commit 62086096de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 266 additions and 449 deletions

View file

@ -2,16 +2,14 @@
"""
:codeauthor: Nicole Thomas <nicole@saltstack.com>
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import pytest
import salt.utils.platform
# Import Salt Testing Libs
from tests.support.case import ShellCase
@pytest.mark.windows_whitelisted
class BatchTest(ShellCase):
"""
Integration tests for the salt.cli.batch module

View file

@ -34,13 +34,13 @@
$ python tests/runtests.py -C --ssh
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import test Libs
import pytest
from tests.support.case import SSHCase
@pytest.mark.windows_whitelisted
class SSHCustomModuleTest(SSHCase):
"""
Test sls with custom module functionality using ssh

View file

@ -12,19 +12,17 @@
localhost:
localhost
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
# Import Salt Libs
import pytest
import salt.utils.files
# Import Salt Testing Libs
from tests.support.case import ShellCase, SSHCase
from tests.support.helpers import flaky
@pytest.mark.windows_whitelisted
class GrainsTargetingTest(ShellCase):
"""
Integration tests for targeting with grains.
@ -87,6 +85,7 @@ class GrainsTargetingTest(ShellCase):
os.unlink(key_file)
@pytest.mark.windows_whitelisted
class SSHGrainsTest(SSHCase):
"""
Test salt-ssh grains functionality

View file

@ -1,17 +1,14 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import pytest
import salt.utils.platform
# Import 3rd-party libs
from salt.ext import six
# Import Salt Testing libs
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class StdTest(ModuleCase):
"""
Test standard client calls

View file

@ -1,16 +1,14 @@
# coding: utf-8
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import pytest
import salt.runner
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
# Import Salt Testing libs
from tests.support.unit import TestCase
@pytest.mark.windows_whitelisted
class RunnerModuleTest(TestCase, AdaptedConfigurationTestCaseMixin):
# This is really an integration test since it needs a salt-master running
eauth_creds = {

View file

@ -1,18 +1,16 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class StdTest(ModuleCase):
"""
Test standard client calls

View file

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import SyndicCase
@pytest.mark.windows_whitelisted
class TestSyndic(SyndicCase):
"""
Validate the syndic interface by testing the test module

View file

@ -3,14 +3,11 @@
Test the core grains
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import pytest
import salt.loader
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import skipIf
@ -26,6 +23,7 @@ def _freebsd_or_openbsd():
return salt.utils.platform.is_freebsd() or salt.utils.platform.is_openbsd()
@pytest.mark.windows_whitelisted
class TestGrainsCore(ModuleCase):
"""
Test the core grains grains
@ -52,6 +50,7 @@ class TestGrainsCore(ModuleCase):
)
@pytest.mark.windows_whitelisted
class TestGrainsReg(ModuleCase, LoaderModuleMockMixin):
"""
Test the core windows grains

View file

@ -3,13 +3,13 @@
Test the core grains
"""
# Import python libs
from __future__ import absolute_import, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class TestGrainsCore(ModuleCase):
"""
Test the core grains grains

View file

@ -6,22 +6,20 @@
Test Salt's loader regarding external grains
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import time
# Import salt libs
import pytest
import salt.config
import salt.loader
from tests.support.case import ModuleCase
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class LoaderGrainsTest(ModuleCase):
"""
Test the loader standard behavior with external grains
@ -61,6 +59,7 @@ class LoaderGrainsTest(ModuleCase):
@skipIf(True, "needs a way to reload minion after config change")
@pytest.mark.windows_whitelisted
class LoaderGrainsMergeTest(ModuleCase):
"""
Test the loader deep merge behavior with external grains

View file

@ -9,18 +9,17 @@
Test Salt's loader regarding external overrides
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import time
import pytest
from tests.support.case import ModuleCase
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
@pytest.mark.windows_whitelisted
class LoaderOverridesTest(ModuleCase):
def setUp(self):
self.run_function("saltutil.sync_modules")

View file

@ -3,7 +3,6 @@
Tests for minion blackout
"""
# Import Python libs
from __future__ import absolute_import
import logging
@ -11,16 +10,15 @@ import os
import textwrap
import time
# Import Salt libs
import pytest
import salt.utils.files
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.runtests import RUNTIME_VARS
log = logging.getLogger(__name__)
@pytest.mark.windows_whitelisted
class MinionBlackoutTestCase(ModuleCase):
"""
Test minion blackout functionality

View file

@ -3,7 +3,6 @@
:codeauthor: Erik Johnson <erik@saltstack.com>
"""
# Import Python libs
from __future__ import absolute_import
import copy
@ -14,17 +13,14 @@ import shutil
import subprocess
import textwrap
import pytest
import salt.pillar as pillar
# Import salt libs
import salt.utils.files
import salt.utils.path
import salt.utils.stringutils
import salt.utils.yaml
from tests.support.case import ModuleCase
from tests.support.helpers import dedent, requires_system_grains
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@ -236,6 +232,7 @@ class _CommonBase(ModuleCase):
return ret
@pytest.mark.windows_whitelisted
class BasePillarTest(_CommonBase):
"""
Tests for pillar decryption
@ -305,6 +302,7 @@ class BasePillarTest(_CommonBase):
@skipIf(not salt.utils.path.which("gpg"), "GPG is not installed")
@pytest.mark.windows_whitelisted
class DecryptGPGPillarTest(_CommonBase):
"""
Tests for pillar decryption
@ -548,6 +546,7 @@ class DecryptGPGPillarTest(_CommonBase):
)
@pytest.mark.windows_whitelisted
class RefreshPillarTest(ModuleCase):
"""
These tests validate the behavior defined in the documentation:

View file

@ -3,18 +3,17 @@
Tests for various minion timeouts
"""
# Import Python libs
from __future__ import absolute_import
import os
import sys
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ShellCase
@pytest.mark.windows_whitelisted
class MinionTimeoutTestCase(ShellCase):
"""
Test minion timing functions

View file

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class AliasesTest(ModuleCase):
"""
Validate aliases module

View file

@ -2,30 +2,25 @@
"""
Tests for the archive state
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import textwrap
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
# Import 3rd party libs
from salt.ext import six
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
try:
import zipfile # pylint: disable=W0611
import zipfile # pylint: disable=unused-import
HAS_ZIPFILE = True
except ImportError:
@ -33,13 +28,20 @@ except ImportError:
@destructiveTest
@pytest.mark.windows_whitelisted
class ArchiveTest(ModuleCase):
"""
Validate the archive module
"""
# Base path used for test artifacts
base_path = os.path.join(RUNTIME_VARS.TMP, "modules", "archive")
@classmethod
def setUpClass(cls):
# Base path used for test artifacts
cls.base_path = os.path.join(RUNTIME_VARS.TMP, "modules", "archive")
@classmethod
def tearDownClass(cls):
cls.base_path = None
def _set_artifact_paths(self, arch_fmt):
"""

View file

@ -3,20 +3,18 @@
:codeauthor: Justin Anderson <janderson@saltstack.com>
"""
# Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import os
# Salt Libs
import pytest
from salt.exceptions import CommandExecutionError
from tests.support.case import ModuleCase
# Salttesting libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class BeaconsAddDeleteTest(ModuleCase):
"""
Tests the add and delete functions
@ -87,6 +85,7 @@ class BeaconsAddDeleteTest(ModuleCase):
self.run_function("beacons.save")
@pytest.mark.windows_whitelisted
class BeaconsTest(ModuleCase):
"""
Tests the beacons execution module

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
@ -9,14 +8,10 @@ import tempfile
import textwrap
from contextlib import contextmanager
# Import salt libs
import pytest
import salt.utils.path
import salt.utils.platform
# Import 3rd-party libs
from salt.ext import six
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import (
destructiveTest,
@ -31,6 +26,7 @@ AVAILABLE_PYTHON_EXECUTABLE = salt.utils.path.which_bin(
)
@pytest.mark.windows_whitelisted
class CMDModuleTest(ModuleCase):
"""
Validate the cmd module

View file

@ -3,13 +3,13 @@
"""
Validate the config system
"""
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class ConfigTest(ModuleCase):
"""
Test config routines

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import hashlib
@ -8,24 +7,18 @@ import logging
import os
import shutil
import signal
import sys
import tempfile
import textwrap
import time
import uuid
import psutil
# Import 3rd party libs
import pytest
import salt.ext.six as six
# Import salt libs
import salt.utils.files
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import (
get_unused_localhost_port,
@ -38,9 +31,7 @@ from tests.support.unit import skipIf
log = logging.getLogger(__name__)
SSL3_SUPPORT = sys.version_info >= (2, 7, 9)
@pytest.mark.windows_whitelisted
class CPModuleTest(ModuleCase):
"""
Validate the cp module
@ -233,7 +224,6 @@ class CPModuleTest(ModuleCase):
self.assertIn("KNIGHT: They're nervous, sire.", data)
self.assertNotIn("bacon", data)
@skipIf(not SSL3_SUPPORT, "Requires python with SSL3 support")
@skipIf(
salt.utils.platform.is_darwin() and six.PY2, "This test hangs on OS X on Py2"
)
@ -250,7 +240,6 @@ class CPModuleTest(ModuleCase):
self.assertIn("Windows", data)
self.assertNotIn("AYBABTU", data)
@skipIf(not SSL3_SUPPORT, "Requires python with SSL3 support")
@skipIf(
salt.utils.platform.is_darwin() and six.PY2, "This test hangs on OS X on Py2"
)
@ -267,7 +256,6 @@ class CPModuleTest(ModuleCase):
self.assertIn("Windows", data)
self.assertNotIn("AYBABTU", data)
@skipIf(not SSL3_SUPPORT, "Requires python with SSL3 support")
@skipIf(
salt.utils.platform.is_darwin() and six.PY2, "This test hangs on OS X on Py2"
)
@ -349,7 +337,6 @@ class CPModuleTest(ModuleCase):
ret = self.run_function("cp.get_file_str", [src])
self.assertEqual(ret, False)
@skipIf(not SSL3_SUPPORT, "Requires python with SSL3 support")
@skipIf(
salt.utils.platform.is_darwin() and six.PY2, "This test hangs on OS X on Py2"
)

View file

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class DataModuleTest(ModuleCase):
"""
Validate the data module

View file

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class DecoratorTest(ModuleCase):
def test_module(self):
self.assertTrue(self.run_function("runtests_decorators.working_function"))

View file

@ -1,24 +1,20 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
# Import Salt libs
import pytest
import salt.utils.platform
# Import 3rd-party libs
from salt.ext import six
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.unit import skipIf
@destructiveTest
@pytest.mark.windows_whitelisted
@skipIf(salt.utils.platform.is_darwin(), "No mtab on Darwin")
@skipIf(salt.utils.platform.is_freebsd(), "No mtab on FreeBSD")
@skipIf(salt.utils.platform.is_windows(), "No mtab on Windows")
@ -43,6 +39,7 @@ class DiskModuleVirtualizationTest(ModuleCase):
shutil.move("/tmp/mtab", "/etc/mtab")
@pytest.mark.windows_whitelisted
class DiskModuleTest(ModuleCase):
"""
Validate the disk module

View file

@ -7,25 +7,18 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import
import threading
import time
# Import salt libs
import pytest
import salt.utils.event as event
# Import 3rd-party libs
from salt.ext.six.moves.queue import ( # pylint: disable=import-error,no-name-in-module
Empty,
Queue,
)
# Import Salt Testing libs
from salt.ext.six.moves.queue import Empty, Queue
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class EventModuleTest(ModuleCase):
def __test_event_fire_master(self):
events = Queue()

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import getpass
@ -8,11 +7,9 @@ import os
import shutil
import sys
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import requires_system_grains
from tests.support.runtests import RUNTIME_VARS
@ -42,6 +39,7 @@ def symlink(source, link_name):
os.symlink(source, link_name)
@pytest.mark.windows_whitelisted
class FileModuleTest(ModuleCase):
"""
Validate the file module

View file

@ -3,16 +3,11 @@
Integration tests for Ruby Gem module
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import salt libs
import pytest
import salt.utils.path
# Import 3rd-party libs
from salt.ext.tornado.httpclient import HTTPClient
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.unit import skipIf
@ -30,6 +25,7 @@ def check_status():
@destructiveTest
@skipIf(not salt.utils.path.which("gem"), "Gem is not available")
@pytest.mark.windows_whitelisted
class GemModuleTest(ModuleCase):
"""
Validate gem module

View file

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class GentoolkitModuleTest(ModuleCase):
def setUp(self):
"""

View file

@ -7,7 +7,6 @@ destructive as a result. If no values are set for user.name or user.email in
the user's global .gitconfig, then these tests will set one.
"""
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
@ -20,18 +19,14 @@ import tarfile
import tempfile
from contextlib import closing
# Import salt libs
import pytest
import salt.utils.data
import salt.utils.files
import salt.utils.platform
# Import 3rd-party libs
from salt.ext import six
from salt.utils.versions import LooseVersion
from tests.support.case import ModuleCase
from tests.support.helpers import skip_if_binaries_missing
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@ -79,6 +74,7 @@ def _makedirs(path):
@skip_if_binaries_missing("git")
@pytest.mark.windows_whitelisted
class GitModuleTest(ModuleCase):
def setUp(self):
super(GitModuleTest, self).setUp()

View file

@ -3,7 +3,6 @@
Test the grains module
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
@ -11,10 +10,8 @@ import os
import pprint
import time
# Import Salt libs
import pytest
from salt.ext.six.moves import range
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import flaky
from tests.support.unit import skipIf
@ -22,6 +19,7 @@ from tests.support.unit import skipIf
log = logging.getLogger(__name__)
@pytest.mark.windows_whitelisted
class TestModulesGrains(ModuleCase):
"""
Test the grains module
@ -149,6 +147,7 @@ class TestModulesGrains(ModuleCase):
)
@pytest.mark.windows_whitelisted
class GrainsAppendTestCase(ModuleCase):
"""
Tests written specifically for the grains.append function.

View file

@ -1,20 +1,16 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import random
import string
import pytest
import salt.utils.files
import salt.utils.platform
import salt.utils.stringutils
# Import Salt libs
from salt.ext import six
from salt.ext.six.moves import range
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, skip_if_not_root
from tests.support.unit import skipIf
@ -25,6 +21,7 @@ if not salt.utils.platform.is_windows():
@skip_if_not_root
@destructiveTest
@pytest.mark.windows_whitelisted
class GroupModuleTest(ModuleCase):
"""
Validate the linux group system module

View file

@ -2,24 +2,22 @@
"""
Test the hosts module
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os
import shutil
# Import Salt libs
import pytest
import salt.utils.files
import salt.utils.stringutils
from tests.support.case import ModuleCase
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
log = logging.getLogger(__name__)
@pytest.mark.windows_whitelisted
class HostsModuleTest(ModuleCase):
"""
Test the hosts module

View file

@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import re
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class KeyModuleTest(ModuleCase):
def test_key_finger(self):
"""

View file

@ -1,19 +1,16 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.user
from tests.support.case import ModuleCase
from tests.support.helpers import skip_if_binaries_missing
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
@ -22,6 +19,7 @@ from tests.support.runtests import RUNTIME_VARS
# Doesn't work. Why?
# @requires_salt_modules('acl')
# @requires_salt_modules('linux_acl')
@pytest.mark.windows_whitelisted
class LinuxAclModuleTest(ModuleCase, AdaptedConfigurationTestCaseMixin):
"""
Validate the linux_acl module

View file

@ -1,20 +1,18 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import pytest
import salt.utils.path
import salt.utils.platform
import salt.utils.systemd
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, flaky
from tests.support.unit import skipIf
@destructiveTest
@pytest.mark.windows_whitelisted
class ServiceModuleTest(ModuleCase):
"""
Module testing the service module

View file

@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, requires_salt_modules
from tests.support.unit import skipIf
@ -21,6 +18,7 @@ def _find_new_locale(current_locale):
@skipIf(salt.utils.platform.is_windows(), "minion is windows")
@skipIf(salt.utils.platform.is_darwin(), "locale method is not supported on mac")
@requires_salt_modules("locale")
@pytest.mark.windows_whitelisted
class LocaleModuleTest(ModuleCase):
def test_get_locale(self):
locale = self.run_function("locale.get_locale")

View file

@ -4,13 +4,10 @@
Test the lxc module
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import 3rd-party libs
import pytest
from salt.ext import six
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import skip_if_binaries_missing, skip_if_not_root
from tests.support.unit import skipIf
@ -25,6 +22,7 @@ from tests.support.unit import skipIf
@skip_if_binaries_missing(
"lxc-start", message="LXC is not installed or minimal version not met"
)
@pytest.mark.windows_whitelisted
class LXCModuleTest(ModuleCase):
"""
Test the lxc module

View file

@ -2,20 +2,18 @@
"""
Test the salt mine system
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import pprint
import time
# Import Salt libs
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase, ShellCase
from tests.support.runtests import RUNTIME_VARS
@pytest.mark.windows_whitelisted
class MineTest(ModuleCase, ShellCase):
"""
Test the mine system

View file

@ -1,19 +1,14 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import salt libs
import pytest
import salt.utils.path
# Import 3rd-party libs
from salt.ext import six
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
from salt.ext.six.moves import range
from salt.modules import mysql as mysqlmod
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.mixins import SaltReturnAssertsMixin
@ -36,6 +31,7 @@ if not salt.utils.path.which("mysqladmin"):
"Please install MySQL bindings and a MySQL Server before running"
"MySQL integration tests.",
)
@pytest.mark.windows_whitelisted
class MysqlModuleDbTest(ModuleCase, SaltReturnAssertsMixin):
"""
Module testing database creation on a real MySQL Server.
@ -654,6 +650,7 @@ class MysqlModuleDbTest(ModuleCase, SaltReturnAssertsMixin):
"Please install MySQL bindings and a MySQL Server before running"
"MySQL integration tests.",
)
@pytest.mark.windows_whitelisted
class MysqlModuleUserTest(ModuleCase, SaltReturnAssertsMixin):
"""
User Creation and connection tests
@ -1327,6 +1324,7 @@ class MysqlModuleUserTest(ModuleCase, SaltReturnAssertsMixin):
"Please install MySQL bindings and a MySQL Server before running"
"MySQL integration tests.",
)
@pytest.mark.windows_whitelisted
class MysqlModuleUserGrantTest(ModuleCase, SaltReturnAssertsMixin):
"""
User Creation and connection tests
@ -1715,6 +1713,7 @@ class MysqlModuleUserGrantTest(ModuleCase, SaltReturnAssertsMixin):
"Please install MySQL bindings and a MySQL Server before running"
"MySQL integration tests.",
)
@pytest.mark.windows_whitelisted
class MysqlModuleFileQueryTest(ModuleCase, SaltReturnAssertsMixin):
"""
Test file query module

View file

@ -1,19 +1,17 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Libs
import pytest
import salt.utils.path
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
URL = "google-public-dns-a.google.com"
@pytest.mark.windows_whitelisted
class NetworkTest(ModuleCase):
"""
Validate network module

View file

@ -1,14 +1,13 @@
# -*- coding: utf-8 -*-
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from tests.support.case import ModuleCase
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
@pytest.mark.windows_whitelisted
class PillarModuleTest(ModuleCase):
"""
Validate the pillar module

View file

@ -4,7 +4,6 @@ tests.integration.modules.pip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
@ -14,15 +13,13 @@ import shutil
import sys
import tempfile
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.path
import salt.utils.platform
from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES
from tests.support.case import ModuleCase
from tests.support.helpers import patched_environ
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@ -30,6 +27,7 @@ from tests.support.unit import skipIf
@skipIf(
salt.utils.path.which_bin(KNOWN_BINARY_NAMES) is None, "virtualenv not installed"
)
@pytest.mark.windows_whitelisted
class PipModuleTest(ModuleCase):
def setUp(self):
super(PipModuleTest, self).setUp()

View file

@ -1,17 +1,14 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import pprint
# Import Salt libs
import pytest
import salt.utils.path
import salt.utils.pkg
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import (
destructiveTest,
@ -25,6 +22,7 @@ from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin):
"""
Validate the pkg module

View file

@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
@pytest.mark.windows_whitelisted
class PublishModuleTest(ModuleCase, SaltReturnAssertsMixin):
"""
Validate the publish module

View file

@ -5,20 +5,18 @@
tests.integration.modules.pw_user
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import random
import string
# Import 3rd-party libs
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
# Import Salt Testing libs
import pytest
from salt.ext.six.moves import range
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, skip_if_not_root
@pytest.mark.skip_unless_on_freebsd
class PwUserModuleTest(ModuleCase):
def setUp(self):
super(PwUserModuleTest, self).setUp()

View file

@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ModuleCase
from tests.support.helpers import requires_salt_modules, skip_if_not_root
@skip_if_not_root
@requires_salt_modules("rabbitmq")
@pytest.mark.windows_whitelisted
class RabbitModuleTest(ModuleCase):
"""
Validates the rabbitmqctl functions.

View file

@ -3,24 +3,22 @@
Integration tests for the saltutil module.
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import textwrap
import time
# Import Salt Libs
import pytest
import salt.utils.files
import salt.utils.stringutils
from tests.support.case import ModuleCase
from tests.support.helpers import flaky
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class SaltUtilModuleTest(ModuleCase):
"""
Testcase for the saltutil execution module
@ -66,12 +64,14 @@ class SaltUtilModuleTest(ModuleCase):
self.assertIn("priv", ret["return"])
@pytest.mark.windows_whitelisted
class SyncGrainsTest(ModuleCase):
def test_sync_grains(self):
ret = self.run_function("saltutil.sync_grains")
self.assertEqual(ret, [])
@pytest.mark.windows_whitelisted
class SaltUtilSyncModuleTest(ModuleCase):
"""
Testcase for the saltutil sync execution module
@ -220,6 +220,7 @@ class SaltUtilSyncModuleTest(ModuleCase):
@skipIf(True, "Pillar refresh test is flaky. Skipping for now.")
@pytest.mark.windows_whitelisted
class SaltUtilSyncPillarTest(ModuleCase):
"""
Testcase for the saltutil sync pillar module

View file

@ -3,22 +3,17 @@
"""
Test the ssh module
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.platform
# Import 3rd-party libs
from salt.ext.tornado.httpclient import HTTPClient
from tests.support.case import ModuleCase
from tests.support.helpers import skip_if_binaries_missing
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
GITHUB_FINGERPRINT = "9d:38:5b:83:a9:17:52:92:56:1a:5e:c4:d4:81:8e:0a:ca:51:a2:64:f1:74:20:11:2e:f8:8a:c3:a1:39:49:8f"
@ -35,6 +30,7 @@ def check_status():
@skip_if_binaries_missing(["ssh", "ssh-keygen"], check_all=True)
@pytest.mark.windows_whitelisted
class SSHModuleTest(ModuleCase):
"""
Test the ssh module

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
@ -12,21 +11,17 @@ import textwrap
import threading
import time
# Import Salt libs
import pytest
import salt.utils.atomicfile
import salt.utils.files
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
# Import 3rd-party libs
from salt.ext import six
from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES
from tests.support.case import ModuleCase
from tests.support.helpers import with_tempdir
from tests.support.mixins import SaltReturnAssertsMixin
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@ -64,6 +59,7 @@ def reline(source, dest, force=False, ending=DEFAULT_ENDING):
os.rename(tmp, dest)
@pytest.mark.windows_whitelisted
class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
"""
Validate the state module

View file

@ -1,21 +1,18 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import random
import pytest
import salt.utils.platform
# Import Salt libs
from salt.ext import six
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import flaky
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class StatusModuleTest(ModuleCase):
"""
Test the status module

View file

@ -1,14 +1,13 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from salt.ext import six
# Import Salt Testing libs
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class SysModuleTest(ModuleCase):
"""
Validate the sys module

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import datetime
@ -11,16 +10,13 @@ import subprocess
import textwrap
import time
import pytest
import salt.states.file
# Import Salt libs
import salt.utils.files
import salt.utils.path
import salt.utils.platform
from salt.ext import six
from salt.ext.six.moves import range
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import (
destructiveTest,
@ -34,6 +30,7 @@ log = logging.getLogger(__name__)
@skipIf(not salt.utils.platform.is_linux(), "These tests can only be run on linux")
@pytest.mark.windows_whitelisted
class SystemModuleTest(ModuleCase):
"""
Validate the date/time functions in the system module
@ -395,6 +392,7 @@ class SystemModuleTest(ModuleCase):
@skipIf(not salt.utils.platform.is_windows(), "These tests can only be run on windows")
@pytest.mark.windows_whitelisted
class WinSystemModuleTest(ModuleCase):
"""
Validate the date/time functions in the win_system module

View file

@ -1,18 +1,15 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import pytest
import salt.config
# Import salt libs
import salt.version
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
@pytest.mark.windows_whitelisted
class TestModuleTest(ModuleCase, AdaptedConfigurationTestCaseMixin):
"""
Validate the test module

View file

@ -1,18 +1,13 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import random
import string
# Import Salt libs
import pytest
import salt.utils.platform
# Import 3rd-party libs
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
# Import Salt Testing libs
from salt.ext.six.moves import range
from tests.support.case import ModuleCase
from tests.support.helpers import (
destructiveTest,
@ -25,6 +20,7 @@ from tests.support.unit import skipIf
@destructiveTest
@skipIf(not salt.utils.platform.is_linux(), "These tests can only be run on linux")
@skip_if_not_root
@pytest.mark.windows_whitelisted
class UseraddModuleTestLinux(ModuleCase):
def setUp(self):
super(UseraddModuleTestLinux, self).setUp()
@ -105,6 +101,7 @@ class UseraddModuleTestLinux(ModuleCase):
@destructiveTest
@skipIf(not salt.utils.platform.is_windows(), "These tests can only be run on Windows")
@skip_if_not_root
@pytest.mark.windows_whitelisted
class UseraddModuleTestWindows(ModuleCase):
def __random_string(self, size=6):
return "RS-" + "".join(

View file

@ -1,17 +1,15 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt libs
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
@skipIf(not salt.utils.platform.is_windows(), "windows tests only")
@pytest.mark.windows_whitelisted
class AutoRunsModuleTest(ModuleCase):
"""
Test the autoruns module

View file

@ -1,18 +1,16 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt libs
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.unit import skipIf
@skipIf(not salt.utils.platform.is_windows(), "windows test only")
@pytest.mark.windows_whitelisted
class WinDNSTest(ModuleCase):
"""
Test for salt.modules.win_dns_client

View file

@ -1,18 +1,16 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Libs
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.unit import skipIf
@skipIf(not salt.utils.platform.is_windows(), "Tests for only Windows")
@pytest.mark.windows_whitelisted
class FirewallTest(ModuleCase):
"""
Validate windows firewall module

View file

@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Libs
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, flaky
from tests.support.unit import skipIf
@ -14,6 +11,7 @@ from tests.support.unit import skipIf
@flaky
@skipIf(not salt.utils.platform.is_windows(), "Tests for only Windows")
@pytest.mark.windows_whitelisted
class NTPTest(ModuleCase):
"""
Validate windows ntp module

View file

@ -1,16 +1,13 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import textwrap
# Import Salt libs
import pytest
import salt.utils.files
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.runtests import RUNTIME_VARS
@ -18,6 +15,7 @@ from tests.support.unit import skipIf
@skipIf(not salt.utils.platform.is_windows(), "windows test only")
@pytest.mark.windows_whitelisted
class WinPKGTest(ModuleCase):
"""
Tests for salt.modules.win_pkg. There are already

View file

@ -1,17 +1,15 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt libs
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
@skipIf(not salt.utils.platform.is_windows(), "windows test only")
@pytest.mark.windows_whitelisted
class WinServermanagerTest(ModuleCase):
"""
Test for salt.modules.win_servermanager

View file

@ -7,17 +7,15 @@
Test Salt's reactor system
"""
# Import Python libs
from __future__ import absolute_import
# Import Salt libs
import pytest
import salt.utils.event
# Import Salt testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import SaltMinionEventAssertsMixin
@pytest.mark.windows_whitelisted
class ReactorTest(SaltMinionEventAssertsMixin, ModuleCase):
"""
Test Salt's reactor system

View file

@ -1,22 +1,20 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import textwrap
# Import Salt libs
import pytest
import salt.utils.files
import salt.utils.platform
import salt.utils.stringutils
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
@pytest.mark.windows_whitelisted
class PyDSLRendererIncludeTestCase(ModuleCase):
def setUp(self):
self.directory_created = False

View file

@ -2,15 +2,12 @@
"""
Tests for the librato returner
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import salt libs
import pytest
from salt.returners import librato_return
# Import Salt Testing libs
from tests.support.case import ShellCase
log = logging.getLogger(__name__)
@ -48,6 +45,7 @@ MOCK_RET_OBJ = {
}
@pytest.mark.windows_whitelisted
class libratoTest(ShellCase):
"""
Test the librato returner

View file

@ -2,19 +2,17 @@
"""
Tests for the fileserver runner
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import contextlib
# Import Salt libs
import pytest
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ShellCase
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class FileserverTest(ShellCase):
"""
Test the fileserver runner

View file

@ -2,14 +2,14 @@
"""
Tests for the salt-run command
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ShellCase
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class ManageTest(ShellCase):
"""
Test the manage runner
@ -48,6 +48,7 @@ class ManageTest(ShellCase):
self.assertIsInstance(ret["return"], dict)
@pytest.mark.windows_whitelisted
class LocalCacheTargetTest(ShellCase):
"""
Test that a job stored in the local_cache has target information

View file

@ -2,13 +2,13 @@
"""
Tests for the salt-run command
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ShellCase
@pytest.mark.windows_whitelisted
class ManageTest(ShellCase):
"""
Test the manage runner

View file

@ -2,12 +2,11 @@
"""
Tests for the salt-run command
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt Testing libs
import pytest
from tests.support.case import ShellCase
from tests.support.unit import skipIf
@ -23,6 +22,7 @@ log = logging.getLogger(__name__)
@skipIf(not HAS_LIBNACL, "skipping test_nacl, libnacl is unavailable")
@pytest.mark.windows_whitelisted
class NaclTest(ShellCase):
"""
Test the nacl runner

View file

@ -2,7 +2,6 @@
"""
Tests for runner_returns
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
@ -10,18 +9,17 @@ import os
import socket
import tempfile
# Import salt libs
import pytest
import salt.payload
import salt.utils.args
import salt.utils.files
import salt.utils.jid
import salt.utils.yaml
# Import Salt Testing libs
from tests.support.case import ShellCase
from tests.support.runtests import RUNTIME_VARS
@pytest.mark.windows_whitelisted
class RunnerReturnsTest(ShellCase):
"""
Test the "runner_returns" feature

View file

@ -4,13 +4,13 @@ Tests for the salt runner
.. versionadded:: 2016.11.0
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ShellCase
@pytest.mark.windows_whitelisted
class SaltRunnerTest(ShellCase):
"""
Test the salt runner

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import copy
@ -10,13 +9,10 @@ import os
import random
import time
import pytest
import salt.utils.platform
# Import Salt libs
import salt.utils.schedule
from salt.modules.test import ping
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.mock import MagicMock, patch
@ -32,7 +28,7 @@ except ImportError:
try:
import croniter # pylint: disable=W0611
import croniter # pylint: disable=unused-import
HAS_CRONITER = True
except ImportError:
@ -51,6 +47,7 @@ DEFAULT_CONFIG["cachedir"] = os.path.join(ROOT_DIR, "cache")
@skipIf(HAS_DATEUTIL_PARSER is False, "The 'dateutil.parser' library is not available")
@pytest.mark.windows_whitelisted
class SchedulerEvalTest(ModuleCase, SaltReturnAssertsMixin):
"""
Validate the pkg module

View file

@ -1,19 +1,15 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import copy
import logging
import os
import pytest
import salt.utils.platform
# Import Salt libs
import salt.utils.schedule
from salt.modules.test import ping
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.mock import MagicMock, patch
@ -31,6 +27,7 @@ DEFAULT_CONFIG["pki_dir"] = os.path.join(ROOT_DIR, "pki")
DEFAULT_CONFIG["cachedir"] = os.path.join(ROOT_DIR, "cache")
@pytest.mark.windows_whitelisted
class SchedulerHelpersTest(ModuleCase, SaltReturnAssertsMixin):
"""
Test scheduler helper functions

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import copy
@ -9,12 +8,9 @@ import logging
import os
import dateutil.parser as dateutil_parser
# Import Salt libs
import pytest
import salt.utils.schedule
from salt.modules.test import ping
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.mock import MagicMock, patch
@ -32,6 +28,7 @@ DEFAULT_CONFIG["pki_dir"] = os.path.join(ROOT_DIR, "pki")
DEFAULT_CONFIG["cachedir"] = os.path.join(ROOT_DIR, "cache")
@pytest.mark.windows_whitelisted
class SchedulerPostponeTest(ModuleCase, SaltReturnAssertsMixin):
"""
Validate the pkg module

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import copy
@ -8,12 +7,9 @@ import logging
import os
import dateutil.parser as dateutil_parser
# Import Salt libs
import pytest
import salt.utils.schedule
from salt.modules.test import ping
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.mock import MagicMock, patch
@ -31,6 +27,7 @@ DEFAULT_CONFIG["pki_dir"] = os.path.join(ROOT_DIR, "pki")
DEFAULT_CONFIG["cachedir"] = os.path.join(ROOT_DIR, "cache")
@pytest.mark.windows_whitelisted
class SchedulerSkipTest(ModuleCase, SaltReturnAssertsMixin):
"""
Validate the pkg module

View file

@ -7,15 +7,14 @@ from __future__ import absolute_import, print_function, unicode_literals
import os
import textwrap
# Import salt libs
import pytest
import salt.utils.files
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.runtests import RUNTIME_VARS
@pytest.mark.windows_whitelisted
class EnvTestCase(ModuleCase, SaltReturnAssertsMixin):
def setUp(self):
self.state_name = "test_sdb_env"

View file

@ -3,18 +3,16 @@
Test Salt's argument parser
"""
# Import Python libs
from __future__ import absolute_import
# Import Salt libs
import pytest
import salt.utils.args
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import requires_salt_modules
@requires_salt_modules("test.ping", "test.arg")
@pytest.mark.windows_whitelisted
class ArgumentTestCase(ModuleCase):
def test_unsupported_kwarg(self):
"""

View file

@ -4,18 +4,15 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import random
import string
# Import Salt libs
import pytest
import salt.utils.platform
# Import 3rd-party libs
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
from salt.ext.six.moves import range
from salt.utils.pycrypto import gen_hash
from tests.support.case import ModuleCase, ShellCase
from tests.support.helpers import (
@ -25,8 +22,6 @@ from tests.support.helpers import (
skip_if_not_root,
)
from tests.support.mixins import SaltReturnAssertsMixin
# Import Salt Testing libs
from tests.support.unit import skipIf
try:
@ -54,8 +49,9 @@ def gen_password():
@requires_salt_states("user.absent", "user.present")
@requires_salt_modules("shadow.set_password")
@skip_if_not_root
@skipIf(pwd is None or grp is None, "No crypt module available")
@skipIf(pwd is None or grp is None, "No pwd or grp module available")
@destructiveTest
@pytest.mark.windows_whitelisted
class UserAuthTest(ModuleCase, SaltReturnAssertsMixin, ShellCase):
"""
Test user auth mechanisms

View file

@ -6,9 +6,6 @@
tests.integration.shell.call
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# pylint: disable=invalid-name
# Import python libs
from __future__ import absolute_import
import logging
@ -17,7 +14,7 @@ import re
import shutil
import sys
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.json
import salt.utils.platform
@ -27,14 +24,13 @@ from tests.integration.utils import testprogram
from tests.support.case import ShellCase
from tests.support.helpers import flaky, with_tempfile
from tests.support.mixins import ShellCaseCommonTestsMixin
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
log = logging.getLogger(__name__)
@pytest.mark.windows_whitelisted
class CallTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMixin):
_call_binary_ = "salt-call"

View file

@ -7,30 +7,25 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import
import logging
import os
import pipes
import pytest
import salt.utils.files
# Import salt libs
import salt.utils.platform
import salt.utils.yaml
# Import 3rd-party libs
from salt.ext import six
from tests.support.case import ShellCase
from tests.support.mixins import ShellCaseCommonTestsMixin
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
log = logging.getLogger(__name__)
@pytest.mark.windows_whitelisted
class CopyTest(ShellCase, ShellCaseCommonTestsMixin):
_call_binary_ = "salt-cp"

View file

@ -1,22 +1,19 @@
# -*- coding: utf-8 -*-
# Import Python Libs
from __future__ import absolute_import
import os
import textwrap
import pytest
import salt.utils.files
# Import Salt Libs
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class EnabledTest(ModuleCase):
"""
validate the use of shell processing for cmd.run on the salt command line

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
@ -8,18 +7,14 @@ import shutil
import tempfile
import textwrap
# Import Salt libs
import pytest
import salt.utils.files
import salt.utils.platform
import salt.utils.yaml
# Import 3rd-party libs
from salt.ext import six
from tests.support.case import ShellCase
from tests.support.helpers import destructiveTest, skip_if_not_root
from tests.support.mixins import ShellCaseCommonTestsMixin
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
USERA = "saltdev"
@ -27,6 +22,7 @@ USERA_PWD = "saltdev"
HASHED_USERA_PWD = "$6$SALTsalt$ZZFD90fKFWq8AGmmX0L3uBtS9fXL62SrTk5zcnQ6EkD6zoiM3kB88G1Zvs0xm/gZ7WXJRs5nsTBybUvGSqZkT."
@pytest.mark.windows_whitelisted
class KeyTest(ShellCase, ShellCaseCommonTestsMixin):
"""
Test salt-key script

View file

@ -7,10 +7,9 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import
# Import salt test libs
import pytest
import tests.integration.utils
from tests.integration.utils import testprogram
from tests.support.case import ShellCase
@ -19,6 +18,7 @@ from tests.support.unit import skipIf
@skipIf(True, "This test file should be in an isolated test space.")
@pytest.mark.windows_whitelisted
class MasterTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMixin):
_call_binary_ = "salt-master"

View file

@ -4,13 +4,13 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
import pytest
from tests.support.case import ShellCase
@pytest.mark.windows_whitelisted
class MasterTopsTest(ShellCase):
_call_binary_ = "salt"

View file

@ -1,16 +1,12 @@
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# Import python libs
from __future__ import absolute_import
import time
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.yaml
# Import Salt Testing libs
from tests.support.case import ShellCase
from tests.support.helpers import dedent, flaky
from tests.support.mixins import ShellCaseCommonTestsMixin
@ -21,6 +17,7 @@ def minion_in_returns(minion, lines):
return bool([True for line in lines if line == "{0}:".format(minion)])
@pytest.mark.windows_whitelisted
class MatchTest(ShellCase, ShellCaseCommonTestsMixin):
"""
Test salt matchers

View file

@ -7,7 +7,6 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import
import getpass
@ -16,15 +15,11 @@ import os
import platform
import sys
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.platform
import salt.utils.yaml
# Import Salt Testing libs
import tests.integration.utils
# Import 3rd-party libs
from salt.ext import six
from tests.integration.utils import testprogram
from tests.support.case import ShellCase
@ -37,6 +32,7 @@ log = logging.getLogger(__name__)
DEBUG = True
@pytest.mark.windows_whitelisted
class MinionTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMixin):
"""
Various integration tests for the salt-minion executable.

View file

@ -6,14 +6,12 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import pytest
import salt.utils.platform
# Import salt tests libs
import tests.integration.utils
from tests.integration.utils import testprogram
from tests.support.unit import skipIf
@ -21,6 +19,7 @@ from tests.support.unit import skipIf
log = logging.getLogger(__name__)
@pytest.mark.windows_whitelisted
class ProxyTest(testprogram.TestProgramCase):
"""
Various integration tests for the salt-proxy executable.

View file

@ -1,19 +1,15 @@
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""
Tests for the salt-run command
"""
# Import Python libs
from __future__ import absolute_import
# Import Salt libs
import pytest
import salt.utils.files
import salt.utils.platform
import salt.utils.yaml
# Import Salt Testing libs
from tests.integration.utils import testprogram
from tests.support.case import ShellCase
from tests.support.helpers import skip_if_not_root
@ -24,6 +20,7 @@ USERA_PWD = "saltdev"
HASHED_USERA_PWD = "$6$SALTsalt$ZZFD90fKFWq8AGmmX0L3uBtS9fXL62SrTk5zcnQ6EkD6zoiM3kB88G1Zvs0xm/gZ7WXJRs5nsTBybUvGSqZkT."
@pytest.mark.windows_whitelisted
class RunTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMixin):
"""
Test the salt-run command

View file

@ -9,24 +9,22 @@
in the python importer with the expected ``salt`` namespace and breaks imports.
"""
# Import python libs
from __future__ import absolute_import
import logging
import os
# Import Salt libs
import pytest
import salt.defaults.exitcodes
import salt.utils.files
import salt.utils.path
from tests.integration.utils import testprogram
# Import Salt Testing libs
from tests.support.case import ShellCase
log = logging.getLogger(__name__)
@pytest.mark.windows_whitelisted
class SaltTest(testprogram.TestProgramCase):
"""
Various integration tests for the salt executable.
@ -69,6 +67,7 @@ class SaltTest(testprogram.TestProgramCase):
)
@pytest.mark.windows_whitelisted
class RetcodeTestCase(ShellCase):
"""
Tests to ensure that we set non-zero retcodes when execution fails

View file

@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
import pytest
from tests.support.case import ShellCase, SPMCase
@pytest.mark.windows_whitelisted
class SPMTest(ShellCase, SPMCase):
"""
Test spm script

View file

@ -7,28 +7,21 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import
import logging
from collections import OrderedDict
# Import 3rd-party libs
import psutil
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.platform
import salt.utils.yaml
from tests.integration.utils import testprogram
# Import Salt Testing libs
from tests.support.case import ShellCase
from tests.support.mixins import ShellCaseCommonTestsMixin
from tests.support.unit import skipIf
# import pytest
log = logging.getLogger(__name__)
@ -57,6 +50,7 @@ def session_salt_syndic(request, session_salt_master_of_masters, session_salt_sy
log.warning("Failed to terminate daemon: %s", daemon.__class__.__name__)
@pytest.mark.windows_whitelisted
class SyndicTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMixin):
"""
Test the salt-syndic command

View file

@ -2,23 +2,21 @@
"""
Tests for the spm build utility
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
# Import Salt libs
import pytest
import salt.utils.files
import salt.utils.path
# Import Salt Testing libs
from tests.support.case import ModuleCase, SPMCase
from tests.support.helpers import destructiveTest
from tests.support.unit import skipIf
@destructiveTest
@pytest.mark.windows_whitelisted
class SPMBuildTest(SPMCase, ModuleCase):
"""
Validate the spm build command

View file

@ -2,18 +2,18 @@
"""
Tests for the spm files utility
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
# Import Salt Testing libs
import pytest
from tests.support.case import SPMCase
from tests.support.helpers import destructiveTest
@destructiveTest
@pytest.mark.windows_whitelisted
class SPMFilesTest(SPMCase):
"""
Validate the spm files command

View file

@ -2,17 +2,17 @@
"""
Tests for the spm info utility
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import shutil
# Import Salt Testing libs
import pytest
from tests.support.case import SPMCase
from tests.support.helpers import destructiveTest
@destructiveTest
@pytest.mark.windows_whitelisted
class SPMInfoTest(SPMCase):
"""
Validate the spm info command

View file

@ -2,18 +2,18 @@
"""
Tests for the spm install utility
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
# Import Salt Testing libs
import pytest
from tests.support.case import SPMCase
from tests.support.helpers import destructiveTest
@destructiveTest
@pytest.mark.windows_whitelisted
class SPMInstallTest(SPMCase):
"""
Validate the spm install command

View file

@ -2,18 +2,18 @@
"""
Tests for the spm remove utility
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
# Import Salt Testing libs
import pytest
from tests.support.case import SPMCase
from tests.support.helpers import destructiveTest
@destructiveTest
@pytest.mark.windows_whitelisted
class SPMRemoveTest(SPMCase):
"""
Validate the spm remove command

View file

@ -2,18 +2,18 @@
"""
Tests for the spm repo
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
# Import Salt Testing libs
import pytest
from tests.support.case import SPMCase
from tests.support.helpers import destructiveTest
@destructiveTest
@pytest.mark.windows_whitelisted
class SPMRepoTest(SPMCase):
"""
Validate commands related to spm repo

View file

@ -4,7 +4,6 @@
Tests for the file state
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
@ -18,19 +17,16 @@ import sys
import tempfile
import textwrap
import pytest
import salt.serializers.configparser
# Import Salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.json
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
# Import 3rd-party libs
from salt.ext import six
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
from salt.ext.six.moves import range
from salt.utils.versions import LooseVersion as _LooseVersion
from tests.support.case import ModuleCase
from tests.support.helpers import (
@ -43,8 +39,6 @@ from tests.support.helpers import (
with_tempfile,
)
from tests.support.mixins import SaltReturnAssertsMixin
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@ -122,6 +116,7 @@ def _test_managed_file_mode_keep_helper(testcase, local=False):
os.chmod(grail_fs_path, grail_fs_mode)
@pytest.mark.windows_whitelisted
class FileTest(ModuleCase, SaltReturnAssertsMixin):
"""
Validate the file state
@ -2901,6 +2896,7 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin):
self.assertSaltTrueReturn(ret)
@pytest.mark.windows_whitelisted
class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
marker_start = "# start"
marker_end = "# end"
@ -4336,6 +4332,7 @@ class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
self.assertEqual(ret[job]["changes"]["diff"], diff)
@pytest.mark.windows_whitelisted
class RemoteFileTest(ModuleCase, SaltReturnAssertsMixin):
"""
Uses a local tornado webserver to test http(s) file.managed states with and
@ -4427,6 +4424,7 @@ class RemoteFileTest(ModuleCase, SaltReturnAssertsMixin):
@skipIf(not salt.utils.path.which("patch"), "patch is not installed")
@pytest.mark.windows_whitelisted
class PatchTest(ModuleCase, SaltReturnAssertsMixin):
def _check_patch_version(self, min_version):
"""
@ -5000,6 +4998,7 @@ WIN_TEST_FILE = "c:/testfile"
@destructiveTest
@skipIf(not IS_WINDOWS, "windows test only")
@pytest.mark.windows_whitelisted
class WinFileTest(ModuleCase):
"""
Test for the file state on Windows

View file

@ -3,25 +3,23 @@
tests for host state
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os
import shutil
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.stringutils
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
log = logging.getLogger(__name__)
@pytest.mark.windows_whitelisted
class HostTest(ModuleCase, SaltReturnAssertsMixin):
"""
Validate the host state

View file

@ -7,7 +7,6 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
@ -17,7 +16,7 @@ import pprint
import shutil
import sys
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.path
import salt.utils.platform
@ -26,12 +25,8 @@ import salt.utils.win_dacl
import salt.utils.win_functions
import salt.utils.win_runas
from salt.exceptions import CommandExecutionError
# Import 3rd-party libs
from salt.ext import six
from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import (
destructiveTest,
@ -76,6 +71,7 @@ class VirtualEnv(object):
@skipIf(
salt.utils.path.which_bin(KNOWN_BINARY_NAMES) is None, "virtualenv not installed"
)
@pytest.mark.windows_whitelisted
class PipStateTest(ModuleCase, SaltReturnAssertsMixin):
def _create_virtualenv(self, path, **kwargs):
"""
@ -619,6 +615,7 @@ class PipStateTest(ModuleCase, SaltReturnAssertsMixin):
shutil.rmtree(venv_dir)
@pytest.mark.windows_whitelisted
class PipStateInRequisiteTest(ModuleCase, SaltReturnAssertsMixin):
@with_tempdir()
def test_issue_54755(self, tmpdir):

View file

@ -3,24 +3,19 @@
"""
tests for pkg state
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os
import time
# Import Salt libs
import pytest
import salt.utils.files
import salt.utils.path
import salt.utils.pkg.rpm
import salt.utils.platform
# Import 3rd-party libs
from salt.ext import six
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
# Import Salt Testing libs
from salt.ext.six.moves import range
from tests.support.case import ModuleCase
from tests.support.helpers import (
destructiveTest,
@ -37,6 +32,7 @@ log = logging.getLogger(__name__)
@destructiveTest
@pytest.mark.windows_whitelisted
class PkgTest(ModuleCase, SaltReturnAssertsMixin):
_PKG_EPOCH_TARGETS = []
_PKG_32_TARGETS = []

View file

@ -2,16 +2,13 @@
"""
Tests for the Reg State
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt libs
import pytest
import salt.utils.platform
import salt.utils.win_reg as reg
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, generate_random_name
from tests.support.mixins import SaltReturnAssertsMixin
@ -19,8 +16,6 @@ from tests.support.unit import skipIf
log = logging.getLogger(__name__)
__testcontext__ = {}
UNICODE_VALUE_NAME = "Unicode Key \N{TRADE MARK SIGN}"
UNICODE_VALUE = (
"Unicode Value " "\N{COPYRIGHT SIGN},\N{TRADE MARK SIGN},\N{REGISTERED SIGN}"
@ -30,6 +25,7 @@ FAKE_KEY = "SOFTWARE\\{0}".format(generate_random_name("SaltTesting-"))
@destructiveTest
@skipIf(not salt.utils.platform.is_windows(), "Windows Specific Test")
@pytest.mark.windows_whitelisted
class RegTest(ModuleCase, SaltReturnAssertsMixin):
"""
Reg state module tests

View file

@ -3,21 +3,17 @@
Integration tests for renderer functions
"""
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import pytest
import salt.utils.platform
# Import 3rd-party libs
from salt.ext import six
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import flaky
from tests.support.unit import skipIf
@pytest.mark.windows_whitelisted
class TestJinjaRenderer(ModuleCase):
"""
Validate that ordering works correctly

Some files were not shown because too many files have changed in this diff Show more