Merge branch 'master' into master

This commit is contained in:
leifliddy 2020-04-18 05:53:33 +02:00 committed by GitHub
commit 22edef4bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
121 changed files with 713 additions and 482 deletions

View file

@ -7,9 +7,8 @@ codecov:
# require_ci_to_pass: yes # Less spammy. Only notify on passing builds.
notify: off # Disable Notifications
# notify:
# after_n_builds: 46 # Only notify after N builds
# after_n_builds: 25 # Only notify after N builds
# # This value is the output of:
# # sh -c 'echo "$(ls .ci/ | grep kitchen | wc -l)"'
# wait_for_ci: yes # Should Codecov wait for all CI statuses to complete before sending ours.
@ -28,9 +27,13 @@ coverage:
status:
project: # measuring the overall project coverage
default: false # disable the default status that measures entire project
default:
informational: true # Use Codecov in informational mode. Default is false. If true is specified the
# resulting status will pass no matter what the coverage is or what other settings
# are specified. Informational mode is great to use if you want to expose codecov
# information to other developers in your pull request without necessarily gating
# PRs on that information.
salt: # declare a new status context "salt"
enabled: no # must be yes|true to enable this status
paths: "!tests/" # remove all files in "tests/"
target: auto # will use the coverage from the base commit (pull request base or parent commit) coverage to compare against.
base: auto # will use the pull request base if the commit is on a pull request. If not, the parent commit will be used.
@ -39,7 +42,6 @@ coverage:
if_not_found: success # if parent is not found report status as success, error, or failure
if_ci_failed: error # if ci fails report status as success, error, or failure
tests: # declare a new status context "tests"
enabled: no # must be yes|true to enable this status
#target: 100% # we always want 100% coverage here
target: auto # auto while we get this going
base: auto # will use the pull request base if the commit is on a pull request. If not, the parent commit will be used.
@ -53,7 +55,11 @@ coverage:
# entire pull requests Coverage Diff. Checking if the lines
# adjusted are covered at least X%.
default:
enabled: no # must be yes|true to enable this status
informational: true # Use Codecov in informational mode. Default is false. If true is specified the
# resulting status will pass no matter what the coverage is or what other settings
# are specified. Informational mode is great to use if you want to expose codecov
# information to other developers in your pull request without necessarily gating
# PRs on that information.
target: 100% # Newly added lines must have 100% coverage
if_no_uploads: error # will post commit status of "error" if no coverage reports were uploaded
# options: success, error, failure
@ -62,7 +68,11 @@ coverage:
changes: # if there are any unexpected changes in coverage
default:
enabled: no # must be yes|true to enable this status
informational: true # Use Codecov in informational mode. Default is false. If true is specified the
# resulting status will pass no matter what the coverage is or what other settings
# are specified. Informational mode is great to use if you want to expose codecov
# information to other developers in your pull request without necessarily gating
# PRs on that information.
if_no_uploads: error
if_not_found: success
if_ci_failed: error

View file

@ -67,19 +67,19 @@ Fixing issues
=============
If you wish to help us fix the issue you're reporting,
[Salt's documentation](http://docs.saltstack.com/en/latest/index.html)
[Salt's documentation](http://docs.saltstack.com/en/master/index.html)
already includes information to help you setup a development environment,
under [Developing Salt](http://docs.saltstack.com/en/latest/topics/development/hacking.html).
under [Developing Salt](http://docs.saltstack.com/en/master/topics/development/hacking.html).
[SaltStack's Contributing documentation](https://docs.saltstack.com/en/latest/topics/development/contributing.html)
[SaltStack's Contributing documentation](https://docs.saltstack.com/en/master/topics/development/contributing.html)
is also helpful, as it explains sending in pull requests, keeping your
salt branches in sync, and knowing
[which branch](https://docs.saltstack.com/en/latest/topics/development/contributing.html#which-salt-branch)
[which branch](https://docs.saltstack.com/en/master/topics/development/contributing.html#which-salt-branch)
new features or bug fixes should be submitted against.
Fix the issue you have in hand and, if possible, also add a test case to Salt's
testing suite. Then, create a
[pull request](http://docs.saltstack.com/en/latest/topics/development/contributing.html#sending-a-github-pull-request),
[pull request](http://docs.saltstack.com/en/master/topics/development/contributing.html#sending-a-github-pull-request),
and **that's it**!
Salt's development team will review your fix and if everything is OK, your fix

View file

@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
labels: Bug
assignees: ''
---

108
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,108 @@
---
stages:
- lint
- test
include:
- local: 'cicd/kitchen_template.yml'
- local: 'cicd/kitchen_testruns.yml'
# pre-commit-run-all:
# image:
# name: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
# entrypoint: [""]
# stage: lint
# variables:
# PRE_COMMIT_HOME: "${CI_PROJECT_DIR}/pre-commit-cache"
# only:
# refs:
# - merge_requests
# cache:
# key: pre-commit-cache
# paths:
# - pre-commit-cache/
# script:
# - pip3 install pre-commit
# - pre-commit run -a -v --color always
lint-salt-full:
image: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
stage: lint
tags:
- saltstack-internal
cache:
key: nox-lint-cache
paths:
- .nox
only:
refs:
- schedules
script:
- python --version
- pip3 install -U nox-py2==2019.6.25
- nox --version
- nox --install-only -e lint-salt
- EC=254
- export PYLINT_REPORT=pylint-report-salt-full.log
- nox -e lint-salt
- EC=$?
- exit $EC
lint-tests-full:
image: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
stage: lint
tags:
- saltstack-internal
cache:
key: nox-lint-cache
paths:
- .nox
only:
refs:
- schedules
script:
- python --version
- pip3 install -U nox-py2==2019.6.25
- nox --version
- nox --install-only -e lint-tests
- EC=254
- export PYLINT_REPORT=pylint-report-tests-full.log
- nox -e lint-tests
- EC=$?
- exit $EC
docs-build-html:
image: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
stage: test
tags:
- saltstack-internal
cache:
key: nox-docs-cache
paths:
- .nox
only:
refs:
- schedules
script:
- python --version
- pip install -U nox-py2==2019.6.25
- nox --version
- nox -e 'docs-html(compress=True)'
docs-build-man-pages:
image: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
stage: test
tags:
- saltstack-internal
cache:
key: nox-docs-cache
paths:
- .nox
only:
refs:
- schedules
script:
- python --version
- pip install -U nox-py2==2019.6.25
- nox --version
- nox -e 'docs-man(compress=True, update=False)'

View file

@ -106,7 +106,6 @@ repos:
- --py-version=3.5
- --platform=linux
- id: pip-tools-compile
alias: compile-linux-py3.6-zmq-requirements
name: Linux Py3.6 ZeroMQ Requirements
@ -206,7 +205,6 @@ repos:
- --py-version=3.6
- --platform=linux
- id: pip-tools-compile
alias: compile-linux-py3.7-zmq-requirements
name: Linux Py3.7 ZeroMQ Requirements
@ -307,7 +305,7 @@ repos:
- --platform=linux
- repo: https://github.com/timothycrosley/isort
rev: '1e78a9acf3110e1f9721feb591f89a451fc9876a'
rev: "1e78a9acf3110e1f9721feb591f89a451fc9876a"
hooks:
- id: isort
additional_dependencies: ['toml']
@ -321,7 +319,7 @@ repos:
)$
- repo: https://github.com/psf/black
rev: stable
rev: 19.10b0
hooks:
- id: black
# This tells pre-commit not to pass files to black.

View file

@ -6,7 +6,7 @@ This changelog follows [keepachangelog](https://keepachangelog.com/en/1.0.0/) fo
This project versioning is _similar_ to [Semantic Versioning](https://semver.org), and is documented in [SEP 14](https://github.com/saltstack/salt-enhancement-proposals/pull/20/files).
Versions are `MAJOR.PATCH`.
### 3000.1
## 3001 - Sodium
### Removed
@ -15,7 +15,20 @@ Versions are `MAJOR.PATCH`.
### Changed
### Fixed
- [#56237](https://github.com/saltstack/salt/pull/56237) - Fix alphabetical ordering and remove duplicates across all documentation indexes - [@myii](https://github.com/myii)
- [#56325](https://github.com/saltstack/salt/pull/56325) - Fix hyperlinks to `salt.serializers` and other documentation issues - [@myii](https://github.com/myii)
## 3000.1
### Removed
### Deprecated
### Changed
### Fixed
- [#56082](https://github.com/saltstack/salt/pull/56082) - Fix saltversioninfo grain for new version
- [#56143](https://github.com/saltstack/salt/pull/56143) - Use encoding when caching pillar data
- [#56172](https://github.com/saltstack/salt/pull/56172) - Only change mine data if using new allow_tgt feature
@ -46,6 +59,7 @@ Versions are `MAJOR.PATCH`.
- [#56418](https://github.com/saltstack/salt/pull/56418) - Ensure version.py included before we install
- [#56435](https://github.com/saltstack/salt/pull/56435) - Update mac build scripts
### Added
## 3000 - Neon [2020-02-10]

50
cicd/kitchen_template.yml Normal file
View file

@ -0,0 +1,50 @@
.run-kitchen:
image: ruby:2.6.3
stage: test
tags:
- saltstack-kitchen
only:
refs:
- schedules
variables:
FORCE_FULL: 'true'
GOLDEN_IMAGES_CI_BRANCH: master
NOX_ENABLE_FROM_FILENAMES: 'true'
NOX_ENV_NAME: runtests-zeromq
NOX_PASSTHROUGH_OPTS: '--ssh-tests'
SALT_KITCHEN_DRIVER: kitchen-conf/driver.yml
SALT_KITCHEN_PLATFORMS: kitchen-conf/nox-platforms.yml
SALT_KITCHEN_VERIFIER: kitchen-conf/nox-verifier.yml
TEST_SUITE: py3
USE_SPOT_INSTANCES: 'true'
script:
- apt update
- apt -y install moreutils rsync dos2unix
- mkdir -p ~/.ssh
- echo "${KITCHEN_SSHKEY}" | tr -d '\r' > ~/.ssh/kitchen.pem
- chmod 700 ~/.ssh/
- chmod 600 ~/.ssh/kitchen.pem
- git clone https://gitlab.com/saltstack/open/cicd/kitchen-conf.git
- bundle install --with ec2 windows --without docker vagrant
- t=$(shuf -i 30-150 -n 1); echo "Sleeping $t seconds"; sleep $t
- if [ "${USE_SPOT_INSTANCES}" == "true" ]; then cp -f kitchen-conf/spot.yml .kitchen.local.yml; fi
- 'bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM)'
- bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM > kitchen-diagnose-info.txt
- grep 'image_id:' kitchen-diagnose-info.txt
- grep 'instance_type:' -A5 kitchen-diagnose-info.txt
- rm -f kitchen-diagnose-info.txt
- rm -f .kitchen.local.yml
- ssh-agent /bin/bash -xc 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM'
- TEST_EXIT_CODE=0
- 'DONT_DOWNLOAD_ARTEFACTS=1 bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM|ts -s || TEST_EXIT_CODE=$?'
- 'ONLY_DOWNLOAD_ARTEFACTS=1 bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM|ts -s || true'
- bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM
- exit $TEST_EXIT_CODE
artifacts:
when: always
paths:
- artifacts/
- .kitchen/
expire_in: 6 months

123
cicd/kitchen_testruns.yml Normal file
View file

@ -0,0 +1,123 @@
kitchen-amazon2-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: amazon-2
kitchen-archlts-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: arch-lts
kitchen-archlts-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: arch-lts
NOX_PASSTHROUGH_OPTS: '-n integration.modules.test_pkg'
kitchen-centos7-py3-m2crypto:
extends: .run-kitchen
variables:
TEST_PLATFORM: centos-7
NOX_ENV_NAME: runtests-zeromq-m2crypto
kitchen-centos7-py3-proxy:
extends: .run-kitchen
variables:
TEST_PLATFORM: centos-7
NOX_PASSTHROUGH_OPTS: '--proxy'
kitchen-centos7-py3-pycryptodomex:
extends: .run-kitchen
variables:
TEST_PLATFORM: centos-7
NOX_ENV_NAME: runtests-zeromq-pycryptodomex
kitchen-centos7-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: centos-7
kitchen-centos7-py3-tcp:
extends: .run-kitchen
variables:
TEST_PLATFORM: centos-7
NOX_ENV_NAME: runtests-tcp
kitchen-centos8-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: centos-8
kitchen-debian9-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: debian-9
kitchen-debian10-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: debian-10
kitchen-fedora30-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: fedora-30
kitchen-fedora31-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: fedora-31
kitchen-opensuse15-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: opensuse-15
kitchen-ubuntu1604-py3-m2crypto:
extends: .run-kitchen
variables:
TEST_PLATFORM: ubuntu-1604
NOX_ENV_NAME: runtests-zeromq-m2crypto
kitchen-ubuntu1604-py3-proxy:
extends: .run-kitchen
variables:
TEST_PLATFORM: ubuntu-1604
NOX_PASSTHROUGH_OPTS: '--proxy'
kitchen-ubuntu1604-py3-pycryptodomex:
extends: .run-kitchen
variables:
TEST_PLATFORM: ubuntu-1604
NOX_ENV_NAME: runtests-zeromq-pycryptodomex
kitchen-ubuntu1604-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: ubuntu-1604
kitchen-ubuntu1604-py3-tcp:
extends: .run-kitchen
variables:
TEST_PLATFORM: ubuntu-1604
NOX_ENV_NAME: runtests-tcp
kitchen-ubuntu1804-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: ubuntu-1804
kitchen-windows2016-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: windows-2016
NOX_PASSTHROUGH_OPTS: '--unit'
USE_SPOT_INSTANCES: 'false'
kitchen-windows2019-py3:
extends: .run-kitchen
variables:
TEST_PLATFORM: windows-2019
NOX_PASSTHROUGH_OPTS: '--unit'
USE_SPOT_INSTANCES: 'false'

View file

@ -52,6 +52,11 @@ processes that used to be manual. Rather than having to remember to run several
different tools before you commit, you only have to run ``git commit``, and you
will be notified about style and lint issues before you ever open a PR.
.. warning::
Currently there is an issue with the pip-tools-compile pre-commit hook on windows.
The details around this issue are included here:
https://github.com/saltstack/salt/issues/56642.
Please ensure you export ``SKIP=pip-tools-compile`` to skip pip-tools-compile.
Salt Coding Style
-----------------
@ -139,7 +144,7 @@ Fork a Repo Guide_>`_ and is well worth reading.
GOOD
.. code-block:: none
.. code-block:: bash
Fix broken things in file1 and file2
@ -157,7 +162,7 @@ Fork a Repo Guide_>`_ and is well worth reading.
BAD
.. code-block:: none
.. code-block:: bash
Fixes broken things

View file

@ -306,7 +306,7 @@ Documentation Changes and Fixes
Documentation changes and fixes should be made against the earliest supported
release branch that the update applies to. The practice of updating a release
branch instead of making all documentation changes against Salt's main, default
branch, ``develop``, is necessary in order for the docs to be as up-to-date as
branch, ``master``, is necessary in order for the docs to be as up-to-date as
possible when the docs are built.
The workflow mentioned above is also in line with the recommendations outlined

View file

@ -555,7 +555,7 @@ the ``engine_module`` parameter in the engine configuration.
host: localhost
port: 24224
.. code-block::
.. code-block:: none
<source>
@type forward

View file

@ -3932,11 +3932,11 @@ def get_selinux_context(path):
salt '*' file.get_selinux_context /etc/hosts
"""
out = __salt__["cmd.run"](["ls", "-Z", path], python_shell=False)
cmd_ret = __salt__["cmd.run_all"](["stat", "-c", "%C", path], python_shell=False)
try:
ret = re.search(r"\w+:\w+:\w+:\w+", out).group(0)
except AttributeError:
if cmd_ret["retcode"] == 0:
ret = cmd_ret["stdout"]
else:
ret = "No selinux context information is available for {0}".format(path)
return ret

View file

@ -201,8 +201,8 @@ def _get_serialize_fn(serializer, fn_name):
def serialize(serializer, obj, **mod_kwargs):
"""
Serialize a Python object using a :py:mod:`serializer module
<salt.serializers>`
Serialize a Python object using one of the available
:ref:`all-salt.serializers`.
CLI Example:
@ -223,8 +223,8 @@ def serialize(serializer, obj, **mod_kwargs):
def deserialize(serializer, stream_or_string, **mod_kwargs):
"""
Deserialize a Python object using a :py:mod:`serializer module
<salt.serializers>`
Deserialize a Python object using one of the available
:ref:`all-salt.serializers`.
CLI Example:

View file

@ -6949,8 +6949,8 @@ def serialize(
.. versionadded:: 2015.8.0
formatter
Write the data as this format. See the list of :py:mod:`serializer
modules <salt.serializers>` for supported output formats.
Write the data as this format. See the list of
:ref:`all-salt.serializers` for supported output formats.
encoding
If specified, then the specified encoding will be used. Otherwise, the

View file

@ -255,7 +255,7 @@ def create_object_model(module_name, object_name, **kwargs):
if "_attribute_map" in dir(Model):
for attr, items in Model._attribute_map.items():
param = kwargs.get(attr)
if param:
if param is not None:
if items["type"][0].isupper() and isinstance(param, dict):
object_kwargs[attr] = create_object_model(
module_name, items["type"], **param

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,12 +7,11 @@ import os
import shutil
import sys
# Import salt libs
import pytest
import salt.utils.files
import salt.utils.platform
from tests.support.case import ModuleCase
# Import Salt Testing libs
from tests.support.helpers import requires_system_grains
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@ -41,6 +39,7 @@ def symlink(source, link_name):
os.symlink(source, link_name)
@pytest.mark.windows_whitelisted
class FileModuleTest(ModuleCase):
"""
Validate the file module
@ -74,6 +73,52 @@ class FileModuleTest(ModuleCase):
shutil.rmtree(self.mydir, ignore_errors=True)
super(FileModuleTest, self).tearDown()
@skipIf(salt.utils.platform.is_windows(), "No security context on Windows")
@requires_system_grains
def test_get_selinux_context(self, grains):
if grains.get("selinux", {}).get("enabled", False):
NEW_CONTEXT = "system_u:object_r:system_conf_t:s0"
self.run_function(
"file.set_selinux_context", arg=[self.myfile, *(NEW_CONTEXT.split(":"))]
)
ret_file = self.run_function("file.get_selinux_context", arg=[self.myfile])
self.assertEqual(ret_file, NEW_CONTEXT)
# Issue #56557. Ensure that the context of the directory
# containing one file is the context of the directory itself, and
# not the context of the first file in the directory.
self.run_function(
"file.set_selinux_context", arg=[self.mydir, *(NEW_CONTEXT.split(":"))]
)
ret_dir = self.run_function("file.get_selinux_context", arg=[self.mydir])
self.assertEqual(ret_dir, NEW_CONTEXT)
ret_updir = self.run_function(
"file.get_selinux_context",
arg=[os.path.abspath(os.path.join(self.mydir, ".."))],
)
self.assertNotEqual(ret_updir, NEW_CONTEXT)
else:
ret_file = self.run_function("file.get_selinux_context", arg=[self.myfile])
self.assertIn("No selinux context information is available", ret_file)
@skipIf(salt.utils.platform.is_windows(), "No security context on Windows")
@requires_system_grains
def test_set_selinux_context(self, grains):
if not grains.get("selinux", {}).get("enabled", False):
self.skipTest("selinux not available")
FILE_CONTEXT = "system_u:object_r:system_conf_t:s0"
ret_file = self.run_function(
"file.set_selinux_context", arg=[self.myfile, *(FILE_CONTEXT.split(":"))]
)
self.assertEqual(ret_file, FILE_CONTEXT)
DIR_CONTEXT = "system_u:object_r:user_home_t:s0"
ret_dir = self.run_function(
"file.set_selinux_context", arg=[self.mydir, *(DIR_CONTEXT.split(":"))]
)
self.assertEqual(ret_dir, DIR_CONTEXT)
@skipIf(salt.utils.platform.is_windows(), "No chgrp on Windows")
def test_chown(self):
user = getpass.getuser()

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

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