Import from the original modules not tests.integration

This commit is contained in:
Pedro Algarvio 2017-04-03 17:04:09 +01:00
parent 104a2fb30c
commit 2ee6d5d589
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
150 changed files with 605 additions and 529 deletions

View file

@ -438,22 +438,23 @@ to test states:
import shutil
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.paths import FILES, TMP
from tests.support.mixins import SaltReturnAssertsMixin
import tests.integration as integration
# Import salt libs
import salt.utils
HFILE = os.path.join(integration.TMP, 'hosts')
HFILE = os.path.join(TMP, 'hosts')
class HostTest(integration.ModuleCase, SaltReturnAssertsMixin):
class HostTest(ModuleCase, SaltReturnAssertsMixin):
'''
Validate the host state
'''
def setUp(self):
shutil.copyfile(os.path.join(integration.FILES, 'hosts'), HFILE)
shutil.copyfile(os.path.join(FILES, 'hosts'), HFILE)
super(HostTest, self).setUp()
def tearDown(self):
@ -473,12 +474,12 @@ to test states:
output = fp_.read()
self.assertIn('{0}\t\t{1}'.format(ip, name), output)
To access the integration files, a variable named ``integration.FILES``
points to the ``tests/integration/files`` directory. This is where the referenced
To access the integration files, a variable named ``FILES`` points to the
``tests/integration/files`` directory. This is where the referenced
``host.present`` sls file resides.
In addition to the static files in the integration state tree, the location
``integration.TMP`` can also be used to store temporary files that the test system
``TMP`` can also be used to store temporary files that the test system
will clean up when the execution finishes.
@ -506,7 +507,7 @@ the test method:
.. code-block:: python
import tests.integration as integration
from tests.support.helpers import destructiveTest
from tests.support.helpers import destructiveTest, skip_if_not_root
class DestructiveExampleModuleTest(integration.ModuleCase):
'''
@ -514,7 +515,7 @@ the test method:
'''
@destructiveTest
@skipIf(os.geteuid() != 0, 'you must be root to run this test')
@skip_if_not_root
def test_user_not_present(self):
'''
This is a DESTRUCTIVE TEST it creates a new user on the minion.
@ -571,7 +572,10 @@ contain valid information are also required in the test class's ``setUp`` functi
.. code-block:: python
class LinodeTest(integration.ShellCase):
from tests.support.case import ShellCase
from tests.support.paths import FILES
class LinodeTest(ShellCase):
'''
Integration tests for the Linode cloud provider in Salt-Cloud
'''
@ -594,7 +598,7 @@ contain valid information are also required in the test class's ``setUp`` functi
)
# check if apikey and password are present
path = os.path.join(integration.FILES,
path = os.path.join(FILES,
'conf',
'cloud.providers.d',
provider + '.conf')

View file

@ -6,10 +6,10 @@
from __future__ import absolute_import
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
class BatchTest(integration.ShellCase):
class BatchTest(ShellCase):
'''
Integration tests for the salt.cli.batch module
'''

View file

@ -37,11 +37,11 @@
# Import Python libs
from __future__ import absolute_import
# Import Salt Libs
import tests.integration as integration
# Import test Libs
from tests.support.case import SSHCase
class SSHCustomModuleTest(integration.SSHCase):
class SSHCustomModuleTest(SSHCase):
'''
Test sls with custom module functionality using ssh
'''

View file

@ -20,10 +20,10 @@ import os
import salt.utils
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase, SSHCase
class GrainsTargetingTest(integration.ShellCase):
class GrainsTargetingTest(ShellCase):
'''
Integration tests for targeting with grains.
'''
@ -75,10 +75,10 @@ class GrainsTargetingTest(integration.ShellCase):
os.unlink(key_file)
class SSHGrainsTest(integration.SSHCase):
class SSHGrainsTest(SSHCase):
'''
Test salt-ssh grains functionality
Depend on proper environment set by integration.SSHCase class
Depend on proper environment set by SSHCase class
'''
def test_grains_id(self):

View file

@ -4,10 +4,10 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class StdTest(integration.ModuleCase):
class StdTest(ModuleCase):
'''
Test standard client calls
'''

View file

@ -5,13 +5,13 @@ from __future__ import absolute_import
import os
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
# Import salt libs
import salt.utils
class StdTest(integration.ModuleCase):
class StdTest(ModuleCase):
'''
Test standard client calls
'''

View file

@ -4,10 +4,10 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import SyndicCase
class TestSyndic(integration.SyndicCase):
class TestSyndic(SyndicCase):
'''
Validate the syndic interface by testing the test module
'''

View file

@ -7,15 +7,17 @@ import logging
import os
# Import Salt Testing libs
import tests.integration.cloud.helpers
from tests.support.case import ShellCase
from tests.support.unit import TestCase, skipIf
from tests.support.paths import FILES
# Import Salt libs
import salt.ext.six as six
import tests.integration as integration
import salt.utils.virtualbox
# Create the cloud instance name to be used throughout the tests
INSTANCE_NAME = integration.cloud.helpers.random_name()
INSTANCE_NAME = tests.integration.cloud.helpers.random_name()
PROVIDER_NAME = "virtualbox"
CONFIG_NAME = PROVIDER_NAME + "-config"
PROFILE_NAME = PROVIDER_NAME + "-test"
@ -25,12 +27,7 @@ BASE_BOX_NAME = "__temp_test_vm__"
BOOTABLE_BASE_BOX_NAME = "SaltMiniBuntuTest"
# Setup logging
log = logging.getLogger()
log_handler = logging.StreamHandler()
log_handler.setLevel(logging.INFO)
log.addHandler(log_handler)
log.setLevel(logging.INFO)
info = log.info
log = logging.getLogger(__name__)
@skipIf(salt.utils.virtualbox.HAS_LIBS is False, 'virtualbox has to be installed')
@ -52,7 +49,7 @@ class VirtualboxTestCase(TestCase):
@skipIf(salt.utils.virtualbox.HAS_LIBS is False, 'salt-cloud requires virtualbox to be installed')
class VirtualboxCloudTestCase(integration.ShellCase):
class VirtualboxCloudTestCase(ShellCase):
def run_cloud(self, arg_str, catch_stderr=False, timeout=None):
"""
Execute salt-cloud with json output and try to interpret it
@ -60,10 +57,7 @@ class VirtualboxCloudTestCase(integration.ShellCase):
@return:
@rtype: dict
"""
config_path = os.path.join(
integration.FILES,
'conf'
)
config_path = os.path.join(FILES, 'conf')
arg_str = '--out=json -c {0} {1}'.format(config_path, arg_str)
# arg_str = "{0} --log-level=error".format(arg_str)
log.debug("running salt-cloud with %s", arg_str)

View file

@ -10,7 +10,8 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.helpers import expensiveTest
# Import Salt Libs
@ -34,7 +35,7 @@ INSTANCE_NAME = __random_name()
PROVIDER_NAME = 'digital_ocean'
class DigitalOceanTest(integration.ShellCase):
class DigitalOceanTest(ShellCase):
'''
Integration tests for the DigitalOcean cloud provider in Salt-Cloud
'''
@ -59,7 +60,7 @@ class DigitalOceanTest(integration.ShellCase):
# check if personal access token, ssh_key_file, and ssh_key_names are present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -13,7 +13,8 @@ import string
from salt.config import cloud_providers_config
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.helpers import expensiveTest
# Import Third-Party Libs
@ -34,7 +35,7 @@ INSTANCE_NAME = __random_name()
PROVIDER_NAME = 'ec2'
class EC2Test(integration.ShellCase):
class EC2Test(ShellCase):
'''
Integration tests for the EC2 cloud provider in Salt-Cloud
'''
@ -61,7 +62,7 @@ class EC2Test(integration.ShellCase):
# and provider are present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -14,7 +14,8 @@ import string
from salt.config import cloud_providers_config
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.helpers import expensiveTest
# Import Third-Party Libs
@ -33,7 +34,7 @@ def _random_name(size=6):
)
class GCETest(integration.ShellCase):
class GCETest(ShellCase):
'''
Integration tests for the GCE cloud provider in Salt-Cloud
'''
@ -61,7 +62,7 @@ class GCETest(integration.ShellCase):
# check if project, service_account_email_address, service_account_private_key
# and provider are present
path = os.path.join(integration.FILES,
path = os.path.join(FILES,
'conf',
'cloud.providers.d',
provider + '.conf')

View file

@ -10,7 +10,8 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.helpers import expensiveTest
from tests.support.unit import skipIf
@ -34,7 +35,7 @@ PROVIDER_NAME = 'gogrid'
@skipIf(True, 'waiting on bug report fixes from #13365')
class GoGridTest(integration.ShellCase):
class GoGridTest(ShellCase):
'''
Integration tests for the GoGrid cloud provider in Salt-Cloud
'''
@ -59,7 +60,7 @@ class GoGridTest(integration.ShellCase):
# check if client_key and api_key are present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -10,7 +10,8 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.helpers import expensiveTest
# Import Salt Libs
@ -32,7 +33,7 @@ INSTANCE_NAME = __random_name()
PROVIDER_NAME = 'joyent'
class JoyentTest(integration.ShellCase):
class JoyentTest(ShellCase):
'''
Integration tests for the Joyent cloud provider in Salt-Cloud
'''
@ -57,7 +58,7 @@ class JoyentTest(integration.ShellCase):
# check if user, password, private_key, and keyname are present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -10,7 +10,8 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.helpers import expensiveTest
# Import Salt Libs
@ -32,7 +33,7 @@ INSTANCE_NAME = __random_name()
PROVIDER_NAME = 'linode'
class LinodeTest(integration.ShellCase):
class LinodeTest(ShellCase):
'''
Integration tests for the Linode cloud provider in Salt-Cloud
'''
@ -57,7 +58,7 @@ class LinodeTest(integration.ShellCase):
# check if personal access token, ssh_key_file, and ssh_key_names are present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -10,7 +10,8 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.unit import skipIf
from tests.support.helpers import expensiveTest
@ -66,7 +67,7 @@ def __has_required_azure():
@skipIf(HAS_AZURE is False, 'These tests require the Azure Python SDK to be installed.')
@skipIf(__has_required_azure() is False, 'The Azure Python SDK must be >= 0.11.1.')
class AzureTest(integration.ShellCase):
class AzureTest(ShellCase):
'''
Integration tests for the Azure cloud provider in Salt-Cloud
'''
@ -91,7 +92,7 @@ class AzureTest(integration.ShellCase):
# check if subscription_id and certificate_path are present in provider file
provider_config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'
@ -112,7 +113,7 @@ class AzureTest(integration.ShellCase):
# in the azure configuration file
profile_config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.profiles.d',
PROVIDER_NAME + '.conf'

View file

@ -8,7 +8,7 @@ from __future__ import absolute_import
import logging
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
from tests.support.mixins import SaltReturnAssertsMixin
@ -29,7 +29,7 @@ except ImportError:
'Please install keystoneclient and a keystone server before running'
'openstack integration tests.'
)
class OpenstackTest(integration.ModuleCase, SaltReturnAssertsMixin):
class OpenstackTest(ModuleCase, SaltReturnAssertsMixin):
'''
Validate the keystone state
'''

View file

@ -10,7 +10,8 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.unit import skipIf
from tests.support.helpers import expensiveTest
@ -42,7 +43,7 @@ DRIVER_NAME = 'profitbricks'
@skipIf(HAS_PROFITBRICKS is False, 'salt-cloud requires >= profitbricks 2.3.0')
class ProfitBricksTest(integration.ShellCase):
class ProfitBricksTest(ShellCase):
'''
Integration tests for the ProfitBricks cloud provider
'''
@ -67,7 +68,7 @@ class ProfitBricksTest(integration.ShellCase):
# check if credentials and datacenter_id present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -10,7 +10,8 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.unit import skipIf
from tests.support.helpers import expensiveTest
@ -42,7 +43,7 @@ DRIVER_NAME = 'openstack'
@skipIf(HAS_LIBCLOUD is False, 'salt-cloud requires >= libcloud 0.13.2')
class RackspaceTest(integration.ShellCase):
class RackspaceTest(ShellCase):
'''
Integration tests for the Rackspace cloud provider using the Openstack driver
'''
@ -67,7 +68,7 @@ class RackspaceTest(integration.ShellCase):
# check if personal access token, ssh_key_file, and ssh_key_names are present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -13,7 +13,8 @@ import string
from salt.config import cloud_providers_config
# Import Salt Testing LIbs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.helpers import expensiveTest
from salt.ext.six.moves import range
@ -33,7 +34,7 @@ PROVIDER_NAME = 'vmware'
TIMEOUT = 500
class VMWareTest(integration.ShellCase):
class VMWareTest(ShellCase):
'''
Integration tests for the vmware cloud provider in Salt-Cloud
'''
@ -58,7 +59,7 @@ class VMWareTest(integration.ShellCase):
# check if user, password, url and provider are present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -11,7 +11,8 @@ import string
import time
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.paths import FILES
from tests.support.helpers import expensiveTest
# Import Salt Libs
@ -35,7 +36,7 @@ INSTANCE_NAME = __random_name()
PROVIDER_NAME = 'vultr'
class VultrTest(integration.ShellCase):
class VultrTest(ShellCase):
'''
Integration tests for the Vultr cloud provider in Salt-Cloud
'''
@ -60,7 +61,7 @@ class VultrTest(integration.ShellCase):
# check if api_key, ssh_key_file, and ssh_key_names are present
config = cloud_providers_config(
os.path.join(
integration.FILES,
FILES,
'conf',
'cloud.providers.d',
PROVIDER_NAME + '.conf'

View file

@ -7,7 +7,7 @@ Test the core grains
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
# Import salt libs
@ -19,7 +19,7 @@ if salt.utils.is_windows():
pass
class TestGrainsCore(integration.ModuleCase):
class TestGrainsCore(ModuleCase):
'''
Test the core grains grains
'''
@ -30,9 +30,9 @@ class TestGrainsCore(integration.ModuleCase):
'''
opts = self.minion_opts
cpu_model_text = salt.modules.reg.read_value(
"HKEY_LOCAL_MACHINE",
"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
"ProcessorNameString").get('vdata')
'HKEY_LOCAL_MACHINE',
'HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0',
'ProcessorNameString').get('vdata')
self.assertEqual(
self.run_function('grains.items')['cpu_model'],
cpu_model_text

View file

@ -12,15 +12,16 @@ import os
import time
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.paths import TMP
from tests.support.unit import skipIf
# Import salt libs
import tests.integration as integration
from salt.config import minion_config
from salt.loader import grains
import salt.config
import salt.loader
class LoaderGrainsTest(integration.ModuleCase):
class LoaderGrainsTest(ModuleCase):
'''
Test the loader standard behavior with external grains
'''
@ -35,7 +36,7 @@ class LoaderGrainsTest(integration.ModuleCase):
# `test_custom_grain2.py` file is present in the _grains directory
# before trying to get the grains. This test may execute before the
# minion has finished syncing down the files it needs.
module = os.path.join(integration.TMP, 'rootdir', 'cache', 'files',
module = os.path.join(TMP, 'rootdir', 'cache', 'files',
'base', '_grains', 'test_custom_grain2.py')
tries = 0
while not os.path.exists(module):
@ -50,17 +51,18 @@ class LoaderGrainsTest(integration.ModuleCase):
@skipIf(True, "needs a way to reload minion after config change")
class LoaderGrainsMergeTest(integration.ModuleCase):
class LoaderGrainsMergeTest(ModuleCase):
'''
Test the loader deep merge behavior with external grains
'''
def setUp(self):
self.opts = minion_config(None)
# XXX: This seems like it should become a unit test instead
self.opts = salt.config.minion_config(None)
self.opts['grains_deep_merge'] = True
self.assertTrue(self.opts['grains_deep_merge'])
self.opts['disable_modules'] = ['pillar']
__grains__ = grains(self.opts)
__grains__ = salt.loader.grains(self.opts)
def test_grains_merge(self):
__grain__ = self.run_function('grains.item', ['a_custom'])

View file

@ -15,17 +15,18 @@ import os
import time
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.paths import TMP
class LoaderOverridesTest(integration.ModuleCase):
class LoaderOverridesTest(ModuleCase):
def test_overridden_internal(self):
# To avoid a race condition on Windows, we need to make sure the
# `override_test.py` file is present in the _modules directory before
# trying to list all functions. This test may execute before the
# minion has finished syncing down the files it needs.
module = os.path.join(integration.TMP, 'rootdir', 'cache', 'files',
module = os.path.join(TMP, 'rootdir', 'cache', 'files',
'base', '_modules', 'override_test.py')
tries = 0
while not os.path.exists(module):

View file

@ -10,18 +10,19 @@ from time import sleep
import textwrap
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.paths import PILLAR_DIR
from tests.support.helpers import destructiveTest
# Import Salt libs
import salt.utils
BLACKOUT_PILLAR = os.path.join(integration.PILLAR_DIR, 'base', 'blackout.sls')
BLACKOUT_PILLAR = os.path.join(PILLAR_DIR, 'base', 'blackout.sls')
@destructiveTest
class MinionBlackoutTestCase(integration.ModuleCase):
class MinionBlackoutTestCase(ModuleCase):
'''
Test minion blackout functionality
'''

View file

@ -11,32 +11,33 @@ import logging
import os
import shutil
import textwrap
import yaml
from subprocess import Popen, PIPE, STDOUT
import subprocess
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.paths import TMP, TMP_CONF_DIR
from tests.support.unit import skipIf
from tests.support.helpers import requires_system_grains
# Import 3rd-party libs
import yaml
import salt.ext.six as six
# Import salt libs
import salt.utils
from salt import pillar
import salt.pillar as pillar
log = logging.getLogger(__name__)
GPG_HOMEDIR = os.path.join(integration.TMP_CONF_DIR, 'gpgkeys')
PILLAR_BASE = os.path.join(integration.TMP, 'test-decrypt-pillar', 'pillar')
GPG_HOMEDIR = os.path.join(TMP_CONF_DIR, 'gpgkeys')
PILLAR_BASE = os.path.join(TMP, 'test-decrypt-pillar', 'pillar')
TOP_SLS = os.path.join(PILLAR_BASE, 'top.sls')
GPG_SLS = os.path.join(PILLAR_BASE, 'gpg.sls')
DEFAULT_OPTS = {
'cachedir': os.path.join(integration.TMP, 'rootdir', 'cache'),
'config_dir': integration.TMP_CONF_DIR,
'extension_modules': os.path.join(integration.TMP,
'cachedir': os.path.join(TMP, 'rootdir', 'cache'),
'config_dir': TMP_CONF_DIR,
'extension_modules': os.path.join(TMP,
'test-decrypt-pillar',
'extmods'),
'pillar_roots': {'base': [PILLAR_BASE]},
@ -189,7 +190,7 @@ GPG_PILLAR_DECRYPTED = {
@skipIf(not salt.utils.which('gpg'), 'GPG is not installed')
class DecryptGPGPillarTest(integration.ModuleCase):
class DecryptGPGPillarTest(ModuleCase):
'''
Tests for pillar decryption
'''
@ -208,19 +209,19 @@ class DecryptGPGPillarTest(integration.ModuleCase):
cmd = cmd_prefix + ['--list-keys']
log.debug('Instantiating gpg keyring using: %s', cmd)
output = Popen(cmd,
stdout=PIPE,
stderr=STDOUT,
shell=False).communicate()[0]
output = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=False).communicate()[0]
log.debug('Result:\n%s', output)
cmd = cmd_prefix + ['--import', '--allow-secret-key-import']
log.debug('Importing keypair using: %s', cmd)
output = Popen(cmd,
stdin=PIPE,
stdout=PIPE,
stderr=STDOUT,
shell=False).communicate(input=six.b(TEST_KEY))[0]
output = subprocess.Popen(cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=False).communicate(input=six.b(TEST_KEY))[0]
log.debug('Result:\n%s', output)
os.makedirs(PILLAR_BASE)

View file

@ -7,10 +7,10 @@ Tests for various minion timeouts
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ShellCase
class MinionTimeoutTestCase(integration.ShellCase):
class MinionTimeoutTestCase(ShellCase):
'''
Test minion timing functions
'''

View file

@ -4,10 +4,10 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class AliasesTest(integration.ModuleCase):
class AliasesTest(ModuleCase):
'''
Validate aliases module
'''

View file

@ -9,8 +9,9 @@ import shutil
import textwrap
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import TMP
from tests.support.helpers import destructiveTest
# Import salt libs
@ -25,12 +26,12 @@ except ImportError:
@destructiveTest
class ArchiveTest(integration.ModuleCase):
class ArchiveTest(ModuleCase):
'''
Validate the archive module
'''
# Base path used for test artifacts
base_path = os.path.join(integration.TMP, 'modules', 'archive')
base_path = os.path.join(TMP, 'modules', 'archive')
def _set_artifact_paths(self, arch_fmt):
'''

View file

@ -11,11 +11,11 @@ import os
from salt.exceptions import CommandExecutionError
# Salttesting libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
class BeaconsAddDeleteTest(integration.ModuleCase):
class BeaconsAddDeleteTest(ModuleCase):
'''
Tests the add and delete functions
'''
@ -50,7 +50,7 @@ class BeaconsAddDeleteTest(integration.ModuleCase):
self.run_function('beacons.save')
class BeaconsTest(integration.ModuleCase):
class BeaconsTest(ModuleCase):
'''
Tests the beacons execution module
'''

View file

@ -7,7 +7,7 @@ Validate the boto_iam module
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
# Import 3rd-party libs
@ -33,7 +33,7 @@ except ImportError:
BOTO_NOT_CONFIGURED,
'Please setup boto AWS credentials before running boto integration tests.'
)
class BotoIAMTest(integration.ModuleCase):
class BotoIAMTest(ModuleCase):
def test_get_account_id(self):
ret = self.run_function('boto_iam.get_account_id')

View file

@ -8,7 +8,7 @@ from __future__ import absolute_import
import re
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
# Import 3rd-party libs
@ -34,7 +34,7 @@ except ImportError:
BOTO_NOT_CONFIGURED,
'Please setup boto AWS credentials before running boto integration tests.'
)
class BotoSNSTest(integration.ModuleCase):
class BotoSNSTest(ModuleCase):
def setUp(self):
# The name of the topic you want to create.

View file

@ -7,7 +7,7 @@ import sys
import textwrap
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import (
destructiveTest,
@ -30,7 +30,7 @@ AVAILABLE_PYTHON_EXECUTABLE = salt.utils.which_bin([
])
class CMDModuleTest(integration.ModuleCase):
class CMDModuleTest(ModuleCase):
'''
Validate the cmd module
'''

View file

@ -7,10 +7,10 @@ Validate the config system
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class ConfigTest(integration.ModuleCase):
class ConfigTest(ModuleCase):
'''
Test config routines
'''

View file

@ -8,7 +8,7 @@ import shutil
import hashlib
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
import tests.support.paths as paths
# Import salt libs
@ -16,7 +16,7 @@ import salt.ext.six as six
import salt.utils
class CPModuleTest(integration.ModuleCase):
class CPModuleTest(ModuleCase):
'''
Validate the cp module
'''

View file

@ -14,7 +14,7 @@ import salt.utils.files
from salt.exceptions import CommandExecutionError
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -25,7 +25,7 @@ CONFIG = '/etc/sysctl.conf'
@destructiveTest
@skipIf(os.geteuid() != 0, 'You must be logged in as root to run this test')
class DarwinSysctlModuleTest(integration.ModuleCase):
class DarwinSysctlModuleTest(ModuleCase):
'''
Integration tests for the darwin_sysctl module
'''

View file

@ -4,10 +4,10 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class DataModuleTest(integration.ModuleCase):
class DataModuleTest(ModuleCase):
'''
Validate the data module
'''

View file

@ -4,10 +4,10 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class DecoratorTest(integration.ModuleCase):
class DecoratorTest(ModuleCase):
def test_module(self):
self.assertTrue(
self.run_function(

View file

@ -6,7 +6,7 @@ import os
import shutil
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -20,7 +20,7 @@ import salt.ext.six as six
@destructiveTest
@skipIf(salt.utils.is_windows(), 'No mtab on Windows')
@skipIf(salt.utils.is_darwin(), 'No mtab on Darwin')
class DiskModuleVirtualizationTest(integration.ModuleCase):
class DiskModuleVirtualizationTest(ModuleCase):
'''
Test to make sure we return a clean result under Docker. Refs #8976
@ -40,7 +40,7 @@ class DiskModuleVirtualizationTest(integration.ModuleCase):
shutil.move('/tmp/mtab', '/etc/mtab')
class DiskModuleTest(integration.ModuleCase):
class DiskModuleTest(ModuleCase):
'''
Validate the disk module
'''

View file

@ -13,7 +13,7 @@ import time
import threading
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
# Import salt libs
from salt.utils import event
@ -22,7 +22,7 @@ from salt.utils import event
from salt.ext.six.moves.queue import Queue, Empty # pylint: disable=import-error,no-name-in-module
class EventModuleTest(integration.ModuleCase):
class EventModuleTest(ModuleCase):
def __test_event_fire_master(self):
events = Queue()

View file

@ -10,30 +10,31 @@ import shutil
import sys
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import FILES, TMP
# Import salt libs
import salt.utils
class FileModuleTest(integration.ModuleCase):
class FileModuleTest(ModuleCase):
'''
Validate the file module
'''
def setUp(self):
self.myfile = os.path.join(integration.TMP, 'myfile')
self.myfile = os.path.join(TMP, 'myfile')
with salt.utils.fopen(self.myfile, 'w+') as fp:
fp.write('Hello\n')
self.mydir = os.path.join(integration.TMP, 'mydir/isawesome')
self.mydir = os.path.join(TMP, 'mydir/isawesome')
if not os.path.isdir(self.mydir):
# left behind... Don't fail because of this!
os.makedirs(self.mydir)
self.mysymlink = os.path.join(integration.TMP, 'mysymlink')
self.mysymlink = os.path.join(TMP, 'mysymlink')
if os.path.islink(self.mysymlink):
os.remove(self.mysymlink)
os.symlink(self.myfile, self.mysymlink)
self.mybadsymlink = os.path.join(integration.TMP, 'mybadsymlink')
self.mybadsymlink = os.path.join(TMP, 'mybadsymlink')
if os.path.islink(self.mybadsymlink):
os.remove(self.mybadsymlink)
os.symlink('/nonexistentpath', self.mybadsymlink)
@ -120,8 +121,8 @@ class FileModuleTest(integration.ModuleCase):
self.skipTest('patch is not installed')
src_patch = os.path.join(
integration.FILES, 'file', 'base', 'hello.patch')
src_file = os.path.join(integration.TMP, 'src.txt')
FILES, 'file', 'base', 'hello.patch')
src_file = os.path.join(TMP, 'src.txt')
with salt.utils.fopen(src_file, 'w+') as fp:
fp.write('Hello\n')

View file

@ -7,7 +7,7 @@ Integration tests for Ruby Gem module
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -36,7 +36,7 @@ def check_status():
@destructiveTest
@skipIf(not salt.utils.which('gem'), 'Gem is not available')
@skipIf(not check_status(), 'External source \'https://rubygems.org\' is not available')
class GemModuleTest(integration.ModuleCase):
class GemModuleTest(ModuleCase):
'''
Validate gem module
'''

View file

@ -4,10 +4,10 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class GentoolkitModuleTest(integration.ModuleCase):
class GentoolkitModuleTest(ModuleCase):
def setUp(self):
'''
Set up test environment

View file

@ -20,8 +20,9 @@ import tarfile
import tempfile
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import TMP
from tests.support.helpers import skip_if_binaries_missing
# Import salt libs
@ -74,13 +75,13 @@ def _makedirs(path):
@skip_if_binaries_missing('git')
class GitModuleTest(integration.ModuleCase):
class GitModuleTest(ModuleCase):
def setUp(self):
super(GitModuleTest, self).setUp()
self.orig_cwd = os.getcwd()
self.addCleanup(os.chdir, self.orig_cwd)
self.repo = tempfile.mkdtemp(dir=integration.TMP)
self.repo = tempfile.mkdtemp(dir=TMP)
self.addCleanup(shutil.rmtree, self.repo, ignore_errors=True)
self.files = ('foo', 'bar', 'baz')
self.dirs = ('', 'qux')
@ -177,7 +178,7 @@ class GitModuleTest(integration.ModuleCase):
'''
Test git.archive
'''
tar_archive = os.path.join(integration.TMP, 'test_archive.tar.gz')
tar_archive = os.path.join(TMP, 'test_archive.tar.gz')
self.assertTrue(
self.run_function(
'git.archive',
@ -199,7 +200,7 @@ class GitModuleTest(integration.ModuleCase):
Test git.archive on a subdir, giving only a partial copy of the repo in
the resulting archive
'''
tar_archive = os.path.join(integration.TMP, 'test_archive.tar.gz')
tar_archive = os.path.join(TMP, 'test_archive.tar.gz')
self.assertTrue(
self.run_function(
'git.archive',
@ -276,7 +277,7 @@ class GitModuleTest(integration.ModuleCase):
'''
Test cloning an existing repo
'''
clone_parent_dir = tempfile.mkdtemp(dir=integration.TMP)
clone_parent_dir = tempfile.mkdtemp(dir=TMP)
self.assertTrue(
self.run_function('git.clone', [clone_parent_dir, self.repo])
)
@ -287,7 +288,7 @@ class GitModuleTest(integration.ModuleCase):
'''
Test cloning an existing repo with an alternate name for the repo dir
'''
clone_parent_dir = tempfile.mkdtemp(dir=integration.TMP)
clone_parent_dir = tempfile.mkdtemp(dir=TMP)
clone_name = os.path.basename(self.repo)
# Change to newly-created temp dir
self.assertTrue(
@ -587,7 +588,7 @@ class GitModuleTest(integration.ModuleCase):
'''
Use git.init to init a new repo
'''
new_repo = tempfile.mkdtemp(dir=integration.TMP)
new_repo = tempfile.mkdtemp(dir=TMP)
# `tempfile.mkdtemp` gets the path to the Temp directory using
# environment variables. As a result, folder names longer than 8
@ -939,9 +940,9 @@ class GitModuleTest(integration.ModuleCase):
else:
worktree_add_prefix = 'Enter '
worktree_path = tempfile.mkdtemp(dir=integration.TMP)
worktree_path = tempfile.mkdtemp(dir=TMP)
worktree_basename = os.path.basename(worktree_path)
worktree_path2 = tempfile.mkdtemp(dir=integration.TMP)
worktree_path2 = tempfile.mkdtemp(dir=TMP)
# Even though this is Windows, git commands return a unix style path
if salt.utils.is_windows():
@ -962,7 +963,7 @@ class GitModuleTest(integration.ModuleCase):
# Check if the main repo is a worktree
self.assertFalse(self.run_function('git.is_worktree', [self.repo]))
# Check if a non-repo directory is a worktree
empty_dir = tempfile.mkdtemp(dir=integration.TMP)
empty_dir = tempfile.mkdtemp(dir=TMP)
self.assertFalse(self.run_function('git.is_worktree', [empty_dir]))
shutil.rmtree(empty_dir)
# Remove the first worktree

View file

@ -9,12 +9,12 @@ import os
import time
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
class TestModulesGrains(integration.ModuleCase):
class TestModulesGrains(ModuleCase):
'''
Test the grains module
'''
@ -140,7 +140,7 @@ class TestModulesGrains(integration.ModuleCase):
@destructiveTest
class GrainsAppendTestCase(integration.ModuleCase):
class GrainsAppendTestCase(ModuleCase):
'''
Tests written specifically for the grains.append function.
'''

View file

@ -6,7 +6,7 @@ import string
import random
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
# Import salt libs
@ -14,7 +14,7 @@ from salt.ext.six.moves import range
import salt.utils
class GroupModuleTest(integration.ModuleCase):
class GroupModuleTest(ModuleCase):
'''
Validate the linux group system module
'''

View file

@ -8,15 +8,16 @@ import os
import shutil
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.paths import FILES, TMP
# Import salt libs
import salt.utils
HFN = os.path.join(integration.TMP, 'hosts')
HFN = os.path.join(TMP, 'hosts')
class HostsModuleTest(integration.ModuleCase):
class HostsModuleTest(ModuleCase):
'''
Test the hosts module
'''
@ -27,7 +28,7 @@ class HostsModuleTest(integration.ModuleCase):
'''
Clean out the hosts file
'''
shutil.copyfile(os.path.join(integration.FILES, 'hosts'), HFN)
shutil.copyfile(os.path.join(FILES, 'hosts'), HFN)
def __clear_hosts(self):
'''

View file

@ -5,10 +5,10 @@ from __future__ import absolute_import
import re
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class KeyModuleTest(integration.ModuleCase):
class KeyModuleTest(ModuleCase):
def test_key_finger(self):
'''
test key.finger to ensure we receive a valid fingerprint

View file

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import tests.integration as integration
from tests.support.case import ModuleCase
class LibcloudDNSTest(integration.ModuleCase):
class LibcloudDNSTest(ModuleCase):
'''
Validate the libcloud_dns module
'''

View file

@ -6,7 +6,9 @@ import os
import shutil
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.paths import TMP
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
from tests.support.helpers import skip_if_binaries_missing
# Import salt libs
@ -19,25 +21,24 @@ import salt.utils
# Doesn't work. Why?
# @requires_salt_modules('acl')
# @requires_salt_modules('linux_acl')
class LinuxAclModuleTest(integration.ModuleCase,
integration.AdaptedConfigurationTestCaseMixin):
class LinuxAclModuleTest(ModuleCase, AdaptedConfigurationTestCaseMixin):
'''
Validate the linux_acl module
'''
def setUp(self):
# Blindly copied from tests.integration.modules.file; Refactoring?
self.myfile = os.path.join(integration.TMP, 'myfile')
self.myfile = os.path.join(TMP, 'myfile')
with salt.utils.fopen(self.myfile, 'w+') as fp:
fp.write('Hello\n')
self.mydir = os.path.join(integration.TMP, 'mydir/isawesome')
self.mydir = os.path.join(TMP, 'mydir/isawesome')
if not os.path.isdir(self.mydir):
# left behind... Don't fail because of this!
os.makedirs(self.mydir)
self.mysymlink = os.path.join(integration.TMP, 'mysymlink')
self.mysymlink = os.path.join(TMP, 'mysymlink')
if os.path.islink(self.mysymlink):
os.remove(self.mysymlink)
os.symlink(self.myfile, self.mysymlink)
self.mybadsymlink = os.path.join(integration.TMP, 'mybadsymlink')
self.mybadsymlink = os.path.join(TMP, 'mybadsymlink')
if os.path.islink(self.mybadsymlink):
os.remove(self.mybadsymlink)
os.symlink('/nonexistentpath', self.mybadsymlink)

View file

@ -4,7 +4,7 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import (
requires_salt_modules,
@ -23,7 +23,7 @@ def _find_new_locale(current_locale):
@skipIf(salt.utils.is_windows(), 'minion is windows')
@requires_salt_modules('locale')
class LocaleModuleTest(integration.ModuleCase):
class LocaleModuleTest(ModuleCase):
def test_get_locale(self):
locale = self.run_function('locale.get_locale')
self.assertNotEqual(None, locale)

View file

@ -8,7 +8,7 @@ Test the lxc module
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.helpers import (
skip_if_not_root,
skip_if_binaries_missing
@ -24,7 +24,7 @@ import salt.ext.six as six
'function destroys ALL containers on the box, which is BAD.')
@skip_if_not_root
@skip_if_binaries_missing('lxc-start', message='LXC is not installed or minimal version not met')
class LXCModuleTest(integration.ModuleCase):
class LXCModuleTest(ModuleCase):
'''
Test the lxc module
'''

View file

@ -8,7 +8,7 @@ from __future__ import absolute_import
import os
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -17,7 +17,7 @@ OSA_SCRIPT = '/usr/bin/osascript'
@destructiveTest
@skipIf(os.geteuid() != 0, 'You must be logged in as root to run this test')
class MacAssistiveTest(integration.ModuleCase):
class MacAssistiveTest(ModuleCase):
'''
Integration tests for the mac_assistive module.
'''

View file

@ -8,7 +8,7 @@ from __future__ import absolute_import
import os
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -29,7 +29,7 @@ DEL_PKG = 'acme'
@skipIf(not salt.utils.is_darwin(), 'Test only applies to macOS')
@skipIf(os.geteuid() != 0, 'You must be logged in as root to run this test')
@skipIf(not salt.utils.which('brew'), 'This test requires the brew binary')
class BrewModuleTest(integration.ModuleCase):
class BrewModuleTest(ModuleCase):
'''
Integration tests for the brew module
'''

View file

@ -8,7 +8,7 @@ from __future__ import absolute_import
import os
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -19,7 +19,7 @@ DEFAULT_VALUE = '0'
@destructiveTest
@skipIf(os.geteuid() != 0, 'You must be logged in as root to run this test')
class MacDefaultsModuleTest(integration.ModuleCase):
class MacDefaultsModuleTest(ModuleCase):
'''
Integration tests for the mac_default module
'''

View file

@ -8,14 +8,14 @@ from __future__ import absolute_import
import os
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@destructiveTest
@skipIf(os.geteuid() != 0, 'You must be logged in as root to run this test')
class MacDesktopTestCase(integration.ModuleCase):
class MacDesktopTestCase(ModuleCase):
'''
Integration tests for the mac_desktop module.
'''

View file

@ -10,7 +10,7 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -40,7 +40,7 @@ REP_USER_GROUP = __random_string()
@destructiveTest
@skipIf(os.geteuid() != 0, 'You must be logged in as root to run this test')
class MacGroupModuleTest(integration.ModuleCase):
class MacGroupModuleTest(ModuleCase):
'''
Integration tests for the mac_group module
'''

View file

@ -8,15 +8,16 @@ from __future__ import absolute_import
import os
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import FILES
from tests.support.helpers import destructiveTest
# Import Salt Libs
from salt.exceptions import CommandExecutionError
CERT = os.path.join(
integration.FILES,
FILES,
'file',
'base',
'certs',
@ -28,7 +29,7 @@ PASSWD = 'salttest'
@destructiveTest
@skipIf(os.geteuid() != 0, 'You must be logged in as root to run this test')
class MacKeychainModuleTest(integration.ModuleCase):
class MacKeychainModuleTest(ModuleCase):
'''
Integration tests for the mac_keychain module
'''

View file

@ -8,7 +8,8 @@ from __future__ import absolute_import
import os
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.paths import TMP
from tests.support.helpers import destructiveTest
# Import salt libs
@ -16,10 +17,10 @@ import salt.utils
TEST_PKG_URL = 'https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.11-ElCapitan.pkg'
TEST_PKG_NAME = 'org.macports.MacPorts'
TEST_PKG = os.path.join(integration.TMP, 'MacPorts-2.3.4-10.11-ElCapitan.pkg')
TEST_PKG = os.path.join(TMP, 'MacPorts-2.3.4-10.11-ElCapitan.pkg')
class MacPkgutilModuleTest(integration.ModuleCase):
class MacPkgutilModuleTest(ModuleCase):
'''
Validate the mac_pkgutil module
'''

View file

@ -7,14 +7,14 @@ integration tests for mac_ports
from __future__ import absolute_import, print_function
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
# Import salt libs
import salt.utils
class MacPortsModuleTest(integration.ModuleCase):
class MacPortsModuleTest(ModuleCase):
'''
Validate the mac_ports module
'''

View file

@ -7,7 +7,7 @@ integration tests for mac_power
from __future__ import absolute_import, print_function
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -18,7 +18,7 @@ import salt.utils
@skipIf(not salt.utils.is_darwin()
or not salt.utils.which('systemsetup')
or salt.utils.get_uid(salt.utils.get_user()) != 0, 'Test requirements not met')
class MacPowerModuleTest(integration.ModuleCase):
class MacPowerModuleTest(ModuleCase):
'''
Validate the mac_power module
'''
@ -142,7 +142,7 @@ class MacPowerModuleTest(integration.ModuleCase):
@skipIf(not salt.utils.is_darwin()
or not salt.utils.which('systemsetup')
or salt.utils.get_uid(salt.utils.get_user()) != 0, 'Test requirements not met')
class MacPowerModuleTestSleepOnPowerButton(integration.ModuleCase):
class MacPowerModuleTestSleepOnPowerButton(ModuleCase):
'''
Test power.get_sleep_on_power_button
Test power.set_sleep_on_power_button
@ -192,7 +192,7 @@ class MacPowerModuleTestSleepOnPowerButton(integration.ModuleCase):
@skipIf(not salt.utils.is_darwin()
or not salt.utils.which('systemsetup')
or salt.utils.get_uid(salt.utils.get_user()) != 0, 'Test requirements not met')
class MacPowerModuleTestRestartPowerFailure(integration.ModuleCase):
class MacPowerModuleTestRestartPowerFailure(ModuleCase):
'''
Test power.get_restart_power_failure
Test power.set_restart_power_failure
@ -241,7 +241,7 @@ class MacPowerModuleTestRestartPowerFailure(integration.ModuleCase):
@skipIf(not salt.utils.is_darwin()
or not salt.utils.which('systemsetup')
or salt.utils.get_uid(salt.utils.get_user()) != 0, 'Test requirements not met')
class MacPowerModuleTestWakeOnNet(integration.ModuleCase):
class MacPowerModuleTestWakeOnNet(ModuleCase):
'''
Test power.get_wake_on_network
Test power.set_wake_on_network
@ -287,7 +287,7 @@ class MacPowerModuleTestWakeOnNet(integration.ModuleCase):
@skipIf(not salt.utils.is_darwin()
or not salt.utils.which('systemsetup')
or salt.utils.get_uid(salt.utils.get_user()) != 0, 'Test requirements not met')
class MacPowerModuleTestWakeOnModem(integration.ModuleCase):
class MacPowerModuleTestWakeOnModem(ModuleCase):
'''
Test power.get_wake_on_modem
Test power.set_wake_on_modem

View file

@ -7,7 +7,7 @@ integration tests for mac_service
from __future__ import absolute_import, print_function
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -20,7 +20,7 @@ import salt.utils
@skipIf(not salt.utils.which('plutil'), 'Test requires plutil binary')
@skipIf(salt.utils.get_uid(salt.utils.get_user()) != 0,
'Test requires root')
class MacServiceModuleTest(integration.ModuleCase):
class MacServiceModuleTest(ModuleCase):
'''
Validate the mac_service module
'''

View file

@ -10,7 +10,7 @@ import random
import string
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
# Import salt libs
@ -32,7 +32,7 @@ TEST_USER = __random_string()
NO_USER = __random_string()
class MacShadowModuleTest(integration.ModuleCase):
class MacShadowModuleTest(ModuleCase):
'''
Validate the mac_system module
'''

View file

@ -7,14 +7,14 @@ integration tests for mac_softwareupdate
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
# Import salt libs
import salt.utils
class MacSoftwareUpdateModuleTest(integration.ModuleCase):
class MacSoftwareUpdateModuleTest(ModuleCase):
'''
Validate the mac_softwareupdate module
'''

View file

@ -9,7 +9,7 @@ import random
import string
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -35,7 +35,7 @@ SET_SUBNET_NAME = __random_string()
@skipIf(not salt.utils.is_darwin()
or not salt.utils.which('systemsetup')
or salt.utils.get_uid(salt.utils.get_user()) != 0, 'Test requirements not met')
class MacSystemModuleTest(integration.ModuleCase):
class MacSystemModuleTest(ModuleCase):
'''
Validate the mac_system module
'''

View file

@ -15,7 +15,7 @@ from __future__ import absolute_import
import datetime
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -23,7 +23,7 @@ from tests.support.helpers import destructiveTest
import salt.utils
class MacTimezoneModuleTest(integration.ModuleCase):
class MacTimezoneModuleTest(ModuleCase):
'''
Validate the mac_timezone module
'''

View file

@ -10,7 +10,7 @@ import random
import string
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -39,7 +39,7 @@ CHANGE_USER = __random_string()
@destructiveTest
@skipIf(os.geteuid() != 0, 'You must be logged in as root to run this test')
class MacUserModuleTest(integration.ModuleCase):
class MacUserModuleTest(ModuleCase):
'''
Integration tests for the mac_user module
'''

View file

@ -8,16 +8,17 @@ from __future__ import absolute_import
import os
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.paths import TMP
# Import salt libs
import salt.utils
TEST_FILE = os.path.join(integration.TMP, 'xattr_test_file.txt')
NO_FILE = os.path.join(integration.TMP, 'xattr_no_file.txt')
TEST_FILE = os.path.join(TMP, 'xattr_test_file.txt')
NO_FILE = os.path.join(TMP, 'xattr_no_file.txt')
class MacXattrModuleTest(integration.ModuleCase):
class MacXattrModuleTest(ModuleCase):
'''
Validate the mac_xattr module
'''

View file

@ -7,10 +7,10 @@ from __future__ import absolute_import
import time
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class MineTest(integration.ModuleCase):
class MineTest(ModuleCase):
'''
Test the mine system
'''

View file

@ -5,7 +5,7 @@ from __future__ import absolute_import
import logging
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
from tests.support.mixins import SaltReturnAssertsMixin
@ -35,7 +35,7 @@ if not salt.utils.which('mysqladmin'):
'Please install MySQL bindings and a MySQL Server before running'
'MySQL integration tests.'
)
class MysqlModuleDbTest(integration.ModuleCase, SaltReturnAssertsMixin):
class MysqlModuleDbTest(ModuleCase, SaltReturnAssertsMixin):
'''
Module testing database creation on a real MySQL Server.
'''
@ -615,7 +615,7 @@ class MysqlModuleDbTest(integration.ModuleCase, SaltReturnAssertsMixin):
'Please install MySQL bindings and a MySQL Server before running'
'MySQL integration tests.'
)
class MysqlModuleUserTest(integration.ModuleCase, SaltReturnAssertsMixin):
class MysqlModuleUserTest(ModuleCase, SaltReturnAssertsMixin):
'''
User Creation and connection tests
'''
@ -1268,7 +1268,7 @@ class MysqlModuleUserTest(integration.ModuleCase, SaltReturnAssertsMixin):
'Please install MySQL bindings and a MySQL Server before running'
'MySQL integration tests.'
)
class MysqlModuleUserGrantTest(integration.ModuleCase, SaltReturnAssertsMixin):
class MysqlModuleUserGrantTest(ModuleCase, SaltReturnAssertsMixin):
'''
User Creation and connection tests
'''

View file

@ -8,7 +8,7 @@ from __future__ import absolute_import
import time
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -17,7 +17,7 @@ import salt.utils
@skipIf(not salt.utils.is_linux(), 'These tests can only be run on linux')
class Nilrt_ipModuleTest(integration.ModuleCase):
class Nilrt_ipModuleTest(ModuleCase):
'''
Validate the nilrt_ip module
'''

View file

@ -4,8 +4,9 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import TMP_STATE_TREE
from tests.support.helpers import requires_network
# Import salt libs
@ -22,7 +23,7 @@ except ImportError:
pass
class PillarModuleTest(integration.ModuleCase):
class PillarModuleTest(ModuleCase):
'''
Validate the pillar module
'''
@ -73,7 +74,7 @@ class PillarModuleTest(integration.ModuleCase):
the pillar back to the minion.
'''
self.assertIn(
integration.TMP_STATE_TREE,
TMP_STATE_TREE,
self.run_function('pillar.data')['master']['file_roots']['base']
)
@ -87,7 +88,7 @@ class PillarModuleTest(integration.ModuleCase):
def test_issue_5951_actual_file_roots_in_opts(self):
self.assertIn(
integration.TMP_STATE_TREE,
TMP_STATE_TREE,
self.run_function('pillar.data')['test_ext_pillar_opts']['file_roots']['base']
)

View file

@ -15,8 +15,9 @@ import re
import tempfile
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import TMP
# Import salt libs
import salt.utils
@ -24,12 +25,12 @@ from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES
@skipIf(salt.utils.which_bin(KNOWN_BINARY_NAMES) is None, 'virtualenv not installed')
class PipModuleTest(integration.ModuleCase):
class PipModuleTest(ModuleCase):
def setUp(self):
super(PipModuleTest, self).setUp()
self.venv_test_dir = tempfile.mkdtemp(dir=integration.SYS_TMP_DIR)
self.venv_test_dir = tempfile.mkdtemp(dir=TMP)
self.venv_dir = os.path.join(self.venv_test_dir, 'venv')
for key in os.environ.copy():
if key.startswith('PIP_'):

View file

@ -3,7 +3,7 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.helpers import (
destructiveTest,
@ -12,7 +12,7 @@ from tests.support.helpers import (
)
class PkgModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin):
'''
Validate the pkg module
'''

View file

@ -4,11 +4,11 @@
from __future__ import absolute_import, print_function
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
class PublishModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
class PublishModuleTest(ModuleCase, SaltReturnAssertsMixin):
'''
Validate the publish module
'''

View file

@ -12,7 +12,7 @@ import string
import random
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -20,7 +20,7 @@ from tests.support.helpers import destructiveTest
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
class PwUserModuleTest(integration.ModuleCase):
class PwUserModuleTest(ModuleCase):
def setUp(self):
super(PwUserModuleTest, self).setUp()

View file

@ -5,14 +5,14 @@ from __future__ import absolute_import
import os
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import requires_salt_modules
@skipIf(os.geteuid() != 0, 'You must be root to run this test')
@requires_salt_modules('rabbitmq')
class RabbitModuleTest(integration.ModuleCase):
class RabbitModuleTest(ModuleCase):
'''
Validates the rabbitmqctl functions.
To run these tests, you will need to be able to access the rabbitmqctl

View file

@ -8,10 +8,10 @@ from __future__ import absolute_import
import time
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class SaltUtilModuleTest(integration.ModuleCase):
class SaltUtilModuleTest(ModuleCase):
'''
Testcase for the saltutil execution module
'''
@ -56,7 +56,7 @@ class SaltUtilModuleTest(integration.ModuleCase):
self.assertIn('priv', ret['return'])
class SaltUtilSyncModuleTest(integration.ModuleCase):
class SaltUtilSyncModuleTest(ModuleCase):
'''
Testcase for the saltutil sync execution module
'''

View file

@ -10,7 +10,7 @@ import string
import os
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -20,7 +20,7 @@ from salt.ext.six.moves import range
@skipIf(not salt.utils.is_linux(), 'These tests can only be run on linux')
class ShadowModuleTest(integration.ModuleCase):
class ShadowModuleTest(ModuleCase):
'''
Validate the linux shadow system module
'''

View file

@ -9,15 +9,16 @@ import os
import shutil
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import FILES, TMP
from tests.support.helpers import skip_if_binaries_missing
# Import salt libs
import salt.utils
import salt.utils.http
SUBSALT_DIR = os.path.join(integration.TMP, 'subsalt')
SUBSALT_DIR = os.path.join(TMP, 'subsalt')
AUTHORIZED_KEYS = os.path.join(SUBSALT_DIR, 'authorized_keys')
KNOWN_HOSTS = os.path.join(SUBSALT_DIR, 'known_hosts')
GITHUB_FINGERPRINT = '16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48'
@ -32,7 +33,7 @@ def check_status():
@skip_if_binaries_missing(['ssh', 'ssh-keygen'], check_all=True)
@skipIf(not check_status(), 'External source, github.com is down')
class SSHModuleTest(integration.ModuleCase):
class SSHModuleTest(ModuleCase):
'''
Test the ssh module
'''
@ -44,7 +45,7 @@ class SSHModuleTest(integration.ModuleCase):
if not os.path.isdir(SUBSALT_DIR):
os.makedirs(SUBSALT_DIR)
ssh_raw_path = os.path.join(integration.FILES, 'ssh', 'raw')
ssh_raw_path = os.path.join(FILES, 'ssh', 'raw')
with salt.utils.fopen(ssh_raw_path) as fd:
self.key = fd.read().strip()
@ -62,7 +63,7 @@ class SSHModuleTest(integration.ModuleCase):
test ssh.auth_keys
'''
shutil.copyfile(
os.path.join(integration.FILES, 'ssh', 'authorized_keys'),
os.path.join(FILES, 'ssh', 'authorized_keys'),
AUTHORIZED_KEYS)
ret = self.run_function('ssh.auth_keys', ['root', AUTHORIZED_KEYS])
self.assertEqual(len(list(ret.items())), 1) # exactly one key is found
@ -87,7 +88,7 @@ class SSHModuleTest(integration.ModuleCase):
invalid key entry in authorized_keys
'''
shutil.copyfile(
os.path.join(integration.FILES, 'ssh', 'authorized_badkeys'),
os.path.join(FILES, 'ssh', 'authorized_badkeys'),
AUTHORIZED_KEYS)
ret = self.run_function('ssh.auth_keys', ['root', AUTHORIZED_KEYS])
@ -103,7 +104,7 @@ class SSHModuleTest(integration.ModuleCase):
Check that known host information is returned from ~/.ssh/config
'''
shutil.copyfile(
os.path.join(integration.FILES, 'ssh', 'known_hosts'),
os.path.join(FILES, 'ssh', 'known_hosts'),
KNOWN_HOSTS)
arg = ['root', 'github.com']
kwargs = {'config': KNOWN_HOSTS}
@ -150,7 +151,7 @@ class SSHModuleTest(integration.ModuleCase):
ssh.check_known_host update verification
'''
shutil.copyfile(
os.path.join(integration.FILES, 'ssh', 'known_hosts'),
os.path.join(FILES, 'ssh', 'known_hosts'),
KNOWN_HOSTS)
arg = ['root', 'github.com']
kwargs = {'config': KNOWN_HOSTS}
@ -168,7 +169,7 @@ class SSHModuleTest(integration.ModuleCase):
Verify check_known_host_exists
'''
shutil.copyfile(
os.path.join(integration.FILES, 'ssh', 'known_hosts'),
os.path.join(FILES, 'ssh', 'known_hosts'),
KNOWN_HOSTS)
arg = ['root', 'github.com']
kwargs = {'config': KNOWN_HOSTS}
@ -186,7 +187,7 @@ class SSHModuleTest(integration.ModuleCase):
ssh.rm_known_host
'''
shutil.copyfile(
os.path.join(integration.FILES, 'ssh', 'known_hosts'),
os.path.join(FILES, 'ssh', 'known_hosts'),
KNOWN_HOSTS)
arg = ['root', 'github.com']
kwargs = {'config': KNOWN_HOSTS, 'key': self.key}

View file

@ -9,8 +9,9 @@ import threading
import time
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import TMP
from tests.support.mixins import SaltReturnAssertsMixin
# Import salt libs
@ -21,7 +22,7 @@ from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES
import salt.ext.six as six
class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
'''
Validate the state module
'''
@ -33,7 +34,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
state.show_highstate
'''
high = self.run_function('state.show_highstate')
destpath = os.path.join(integration.SYS_TMP_DIR, 'testfile')
destpath = os.path.join(TMP, 'testfile')
self.assertTrue(isinstance(high, dict))
self.assertTrue(destpath in high)
self.assertEqual(high[destpath]['__env__'], 'base')
@ -183,7 +184,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
'''
Verify that we can append a file's contents
'''
testfile = os.path.join(integration.TMP, 'test.append')
testfile = os.path.join(TMP, 'test.append')
if os.path.isfile(testfile):
os.unlink(testfile)
@ -250,7 +251,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
- text: foo
'''
testfile = os.path.join(integration.TMP, 'issue-1876')
testfile = os.path.join(TMP, 'issue-1876')
sls = self.run_function('state.sls', mods='issue-1876')
self.assertIn(
'ID \'{0}\' in SLS \'issue-1876\' contains multiple state '
@ -275,7 +276,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
expected = os.linesep.join(new_contents)
expected += os.linesep
testfile = os.path.join(integration.TMP, 'issue-1879')
testfile = os.path.join(TMP, 'issue-1879')
# Delete if exiting
if os.path.isfile(testfile):
os.unlink(testfile)
@ -325,11 +326,11 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
def test_include(self):
fnames = (
os.path.join(integration.SYS_TMP_DIR, 'include-test'),
os.path.join(integration.SYS_TMP_DIR, 'to-include-test')
os.path.join(TMP, 'include-test'),
os.path.join(TMP, 'to-include-test')
)
exclude_test_file = os.path.join(
integration.SYS_TMP_DIR, 'exclude-test'
TMP, 'exclude-test'
)
try:
ret = self.run_function('state.sls', mods='include-test')
@ -345,11 +346,11 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
def test_exclude(self):
fnames = (
os.path.join(integration.SYS_TMP_DIR, 'include-test'),
os.path.join(integration.SYS_TMP_DIR, 'exclude-test')
os.path.join(TMP, 'include-test'),
os.path.join(TMP, 'exclude-test')
)
to_include_test_file = os.path.join(
integration.SYS_TMP_DIR, 'to-include-test'
TMP, 'to-include-test'
)
try:
ret = self.run_function('state.sls', mods='exclude-test')
@ -366,7 +367,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
@skipIf(salt.utils.which_bin(KNOWN_BINARY_NAMES) is None, 'virtualenv not installed')
def test_issue_2068_template_str(self):
venv_dir = os.path.join(
integration.SYS_TMP_DIR, 'issue-2068-template-str'
TMP, 'issue-2068-template-str'
)
try:
@ -965,7 +966,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
#])
def test_get_file_from_env_in_top_match(self):
tgt = os.path.join(integration.SYS_TMP_DIR, 'prod-cheese-file')
tgt = os.path.join(TMP, 'prod-cheese-file')
try:
ret = self.run_function(
'state.highstate', minion_tgt='sub_minion'
@ -1217,7 +1218,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
'''
test a state with the retry option that should return True immedietly (i.e. no retries)
'''
testfile = os.path.join(integration.TMP, 'retry_file')
testfile = os.path.join(TMP, 'retry_file')
state_run = self.run_function(
'state.sls',
mods='retry.retry_success'
@ -1230,7 +1231,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
'''
helper function to wait 30 seconds and then create the temp retry file
'''
testfile = os.path.join(integration.TMP, 'retry_file')
testfile = os.path.join(TMP, 'retry_file')
time.sleep(30)
open(testfile, 'a').close()
@ -1239,7 +1240,7 @@ class StateModuleTest(integration.ModuleCase, SaltReturnAssertsMixin):
test a state with the retry option that should return True after at least 4 retry attmempt
but never run 15 attempts
'''
testfile = os.path.join(integration.TMP, 'retry_file')
testfile = os.path.join(TMP, 'retry_file')
create_thread = threading.Thread(target=self.run_create)
create_thread.start()
state_run = self.run_function(

View file

@ -7,8 +7,9 @@ import time
import subprocess
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import TMP
# Import salt libs
import salt.utils
@ -21,14 +22,14 @@ import salt.ext.six as six
@skipIf(six.PY3, 'supervisor does not work under python 3')
@skipIf(salt.utils.which_bin(KNOWN_BINARY_NAMES) is None, 'virtualenv not installed')
@skipIf(salt.utils.which('supervisorctl') is None, 'supervisord not installed')
class SupervisordModuleTest(integration.ModuleCase):
class SupervisordModuleTest(ModuleCase):
'''
Validates the supervisorctl functions.
'''
def setUp(self):
super(SupervisordModuleTest, self).setUp()
self.venv_test_dir = os.path.join(integration.TMP, 'supervisortests')
self.venv_test_dir = os.path.join(TMP, 'supervisortests')
self.venv_dir = os.path.join(self.venv_test_dir, 'venv')
self.supervisor_sock = os.path.join(self.venv_dir, 'supervisor.sock')

View file

@ -5,11 +5,11 @@ from __future__ import absolute_import
import sys
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
class SysctlModuleTest(integration.ModuleCase):
class SysctlModuleTest(ModuleCase):
def setUp(self):
super(SysctlModuleTest, self).setUp()
ret = self.run_function('cmd.has_exec', ['sysctl'])

View file

@ -4,10 +4,10 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class SysModuleTest(integration.ModuleCase):
class SysModuleTest(ModuleCase):
'''
Validate the sys module
'''

View file

@ -9,7 +9,7 @@ import signal
import subprocess
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
@ -22,7 +22,7 @@ log = logging.getLogger(__name__)
@skipIf(not salt.utils.is_linux(), 'These tests can only be run on linux')
class SystemModuleTest(integration.ModuleCase):
class SystemModuleTest(ModuleCase):
'''
Validate the date/time functions in the system module
'''

View file

@ -4,15 +4,15 @@
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
# Import salt libs
import salt.version
import salt.config
class TestModuleTest(integration.ModuleCase,
integration.AdaptedConfigurationTestCaseMixin):
class TestModuleTest(ModuleCase, AdaptedConfigurationTestCaseMixin):
'''
Validate the test module
'''

View file

@ -9,10 +9,10 @@ Linux and Solaris are supported
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
class TimezoneLinuxModuleTest(integration.ModuleCase):
class TimezoneLinuxModuleTest(ModuleCase):
def setUp(self):
'''
Set up Linux test environment
@ -28,7 +28,7 @@ class TimezoneLinuxModuleTest(integration.ModuleCase):
self.assertIn(ret, timescale)
class TimezoneSolarisModuleTest(integration.ModuleCase):
class TimezoneSolarisModuleTest(ModuleCase):
def setUp(self):
'''
Set up Solaris test environment

View file

@ -6,7 +6,7 @@ import string
import random
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import (
destructiveTest,
@ -24,7 +24,7 @@ from salt.ext.six.moves import range # pylint: disable=import-error,redefined-b
@destructiveTest
@skipIf(not salt.utils.is_linux(), 'These tests can only be run on linux')
@skip_if_not_root
class UseraddModuleTestLinux(integration.ModuleCase):
class UseraddModuleTestLinux(ModuleCase):
def setUp(self):
super(UseraddModuleTestLinux, self).setUp()
@ -110,7 +110,7 @@ class UseraddModuleTestLinux(integration.ModuleCase):
@destructiveTest
@skipIf(not salt.utils.is_windows(), 'These tests can only be run on Windows')
@skip_if_not_root
class UseraddModuleTestWindows(integration.ModuleCase):
class UseraddModuleTestWindows(ModuleCase):
def __random_string(self, size=6):
return 'RS-' + ''.join(

View file

@ -7,12 +7,12 @@ Validate the virt module
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.helpers import requires_salt_modules
@requires_salt_modules('virt.get_profiles')
class VirtTest(integration.ModuleCase):
class VirtTest(ModuleCase):
'''
Test virt routines
'''

View file

@ -6,8 +6,9 @@ import os
import tempfile
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.paths import TMP
# Import salt libs
import salt.utils
@ -15,13 +16,13 @@ from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES
@skipIf(salt.utils.which_bin(KNOWN_BINARY_NAMES) is None, 'virtualenv not installed')
class VirtualenvModuleTest(integration.ModuleCase):
class VirtualenvModuleTest(ModuleCase):
'''
Validate the virtualenv module
'''
def setUp(self):
super(VirtualenvModuleTest, self).setUp()
self.venv_test_dir = tempfile.mkdtemp(dir=integration.SYS_TMP_DIR)
self.venv_test_dir = tempfile.mkdtemp(dir=TMP)
self.venv_dir = os.path.join(self.venv_test_dir, 'venv')
def test_create_defaults(self):

View file

@ -8,7 +8,7 @@ from __future__ import absolute_import
import os
# Import test support libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
import tests.support.cherrypy_testclasses as cptc
@ -32,7 +32,7 @@ AUTH_CREDS = {
@skipIf(cptc.HAS_CHERRYPY is False, 'CherryPy not installed')
class TestAuthPAM(cptc.BaseRestCherryPyTest, integration.ModuleCase):
class TestAuthPAM(cptc.BaseRestCherryPyTest, ModuleCase):
'''
Test auth with pam using salt-api
'''

View file

@ -9,7 +9,7 @@ import os
import traceback
# Import Salt Testing Libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.mixins import RUNTIME_VARS
# Import Salt libs
@ -17,7 +17,7 @@ import salt.config
from salt.output import display_output
class OutputReturnTest(integration.ShellCase):
class OutputReturnTest(ShellCase):
'''
Integration tests to ensure outputters return their expected format.
Tests against situations where the loader might not be returning the
@ -87,8 +87,7 @@ class OutputReturnTest(integration.ShellCase):
'''
opts = salt.config.minion_config(os.path.join(RUNTIME_VARS.TMP_CONF_DIR, 'minion'))
opts['output_file'] = os.path.join(
integration.SYS_TMP_DIR,
'salt-tests-tmpdir',
RUNTIME_VARS.TMP,
'outputtest'
)
data = {'foo': {'result': False,

View file

@ -11,14 +11,15 @@
from __future__ import absolute_import
# Import Salt testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
from tests.support.helpers import flaky
from tests.support.mixins import SaltMinionEventAssertsMixin
# Import Salt libs
import salt.utils.event
class ReactorTest(integration.ModuleCase, integration.SaltMinionEventAssertsMixin):
class ReactorTest(ModuleCase, SaltMinionEventAssertsMixin):
'''
Test Salt's reactor system
'''

View file

@ -6,13 +6,13 @@ import os
import textwrap
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ModuleCase
# Import Salt libs
import salt.utils
class PyDSLRendererIncludeTestCase(integration.ModuleCase):
class PyDSLRendererIncludeTestCase(ModuleCase):
def test_rendering_includes(self):
'''

View file

@ -7,7 +7,7 @@ from __future__ import absolute_import
import logging
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ShellCase
# Import salt libs
from salt.returners import librato_return
@ -47,7 +47,7 @@ MOCK_RET_OBJ = {
}
class libratoTest(integration.ShellCase):
class libratoTest(ShellCase):
'''
Test the librato returner
'''

View file

@ -6,10 +6,10 @@ Tests for the salt-run command
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ShellCase
class ManageTest(integration.ShellCase):
class ManageTest(ShellCase):
'''
Test the manage runner
'''

View file

@ -7,14 +7,14 @@ from __future__ import absolute_import
import contextlib
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.unit import skipIf
# Import salt libs
import salt.utils
class FileserverTest(integration.ShellCase):
class FileserverTest(ShellCase):
'''
Test the fileserver runner
'''

View file

@ -6,11 +6,11 @@ Tests for the salt-run command
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ShellCase
from tests.support.unit import skipIf
class ManageTest(integration.ShellCase):
class ManageTest(ShellCase):
'''
Test the manage runner
'''

View file

@ -6,10 +6,10 @@ Tests for the salt-run command
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ShellCase
class ManageTest(integration.ShellCase):
class ManageTest(ShellCase):
'''
Test the manage runner
'''

View file

@ -10,7 +10,7 @@ import tempfile
import yaml
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ShellCase
# Import salt libs
import salt.payload
@ -18,7 +18,7 @@ import salt.utils
import salt.utils.jid
class RunnerReturnsTest(integration.ShellCase):
class RunnerReturnsTest(ShellCase):
'''
Test the "runner_returns" feature
'''

View file

@ -8,10 +8,10 @@ Tests for the salt runner
from __future__ import absolute_import
# Import Salt Testing libs
import tests.integration as integration
from tests.support.case import ShellCase
class SaltRunnerTest(integration.ShellCase):
class SaltRunnerTest(ShellCase):
'''
Test the salt runner
'''

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