Initial setup of package tests (migrated from salt-pkg)

This commit is contained in:
Megan Wilhite 2023-01-17 11:21:32 -07:00 committed by Pedro Algarvio
parent 64afd87958
commit 1a2c2bb443
37 changed files with 3598 additions and 0 deletions

View file

@ -1067,6 +1067,62 @@ repos:
- requirements/static/ci/invoke.in
# <---- Invoke -----------------------------------------------------------------------------------------------------
# <---- PKG ci requirements-----------------------------------------------------------------------------------------
- id: pip-tools-compile
alias: compile-ci-pkg-3.7-requirements
name: PKG tests CI Py3.7 Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/(pkg/linux\.in|ci/((pkg|common)\.in|py3\.7/pkg\.txt)))$
pass_filenames: false
args:
- -v
- --py-version=3.7
- --include=requirements/base.txt
- --include=requirements/zeromq.txt
- --include=requirements/pytest.txt
- requirements/static/ci/pkgtests.in
- id: pip-tools-compile
alias: compile-ci-pkg-3.8-requirements
name: PKG tests CI Py3.8 Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/(pkg/linux\.in|ci/((pkg|common)\.in|py3\.7/pkg\.txt)))$
pass_filenames: false
args:
- -v
- --py-version=3.8
- --include=requirements/base.txt
- --include=requirements/zeromq.txt
- --include=requirements/pytest.txt
- requirements/static/ci/pkgtests.in
- id: pip-tools-compile
alias: compile-ci-pkg-3.9-requirements
name: PKG tests CI Py3.9 Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/(pkg/linux\.in|ci/((pkg|common)\.in|py3\.7/pkg\.txt)))$
pass_filenames: false
args:
- -v
- --py-version=3.9
- --include=requirements/base.txt
- --include=requirements/zeromq.txt
- --include=requirements/pytest.txt
- requirements/static/ci/pkgtests.in
- id: pip-tools-compile
alias: compile-ci-pkg-3.10-requirements
name: PKG tests CI Py3.10 Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/(pkg/linux\.in|ci/((pkg|common)\.in|py3\.7/pkg\.txt)))$
pass_filenames: false
args:
- -v
- --py-version=3.10
- --include=requirements/base.txt
- --include=requirements/zeromq.txt
- --include=requirements/pytest.txt
- requirements/static/ci/pkgtests.in
# ----- Tools ---------------------------------------------------------------------------------------------------->
- id: pip-tools-compile
alias: compile-ci-tools-3.9-requirements

View file

@ -1760,3 +1760,25 @@ def build(session):
]
session.run("sha256sum", *packages, external=True)
session.run("python", "-m", "twine", "check", "dist/*")
@nox.session(python=_PYTHON_VERSIONS, name="test-pkgs")
@nox.parametrize("coverage", [False, True])
def test_pkgs(session, coverage):
"""
pytest pkg tests session
"""
pydir = _get_pydir(session)
# Install requirements
if _upgrade_pip_setuptools_and_wheel(session):
requirements_file = os.path.join(
"requirements", "static", "ci", _get_pydir(session), "pkgtests.txt"
)
install_command = ["--progress-bar=off", "-r", requirements_file]
session.install(*install_command, silent=PIP_INSTALL_SILENT)
cmd_args = [
"pkg/tests/",
] + session.posargs
_pytest(session, coverage, cmd_args)

0
pkg/tests/__init__.py Normal file
View file

341
pkg/tests/conftest.py Normal file
View file

@ -0,0 +1,341 @@
import logging
import pathlib
import re
import shutil
import pytest
from pytestskipmarkers.utils import platform
from saltfactories.utils import random_string
from saltfactories.utils.tempfiles import SaltPillarTree, SaltStateTree
from tests.support.helpers import (
ARTIFACTS_DIR,
CODE_DIR,
TESTS_DIR,
ApiRequest,
SaltMaster,
SaltPkgInstall,
TestUser,
)
log = logging.getLogger(__name__)
@pytest.fixture(scope="session")
def version():
"""
get version number from artifact
"""
_version = ""
for artifact in ARTIFACTS_DIR.glob("**/*.*"):
_version = re.search(
r"([0-9].*)(\-[0-9].fc|\-[0-9].el|\+ds|\-[0-9].am|\-[0-9]-[a-z]*-[a-z]*[0-9_]*.(tar.gz|zip|exe|pkg|rpm))",
artifact.name,
)
if _version:
_version = _version.groups()[0].replace("_", "-").replace("~", "")
break
return _version
def pytest_addoption(parser):
"""
register argparse-style options and ini-style config values.
"""
test_selection_group = parser.getgroup("Tests Runtime Selection")
# test_selection_group.addoption(
# "--system-service",
# default=False,
# action="store_true",
# help="Run the daemons as system services",
# )
test_selection_group.addoption(
"--upgrade",
default=False,
action="store_true",
help="Install previous version and then upgrade then run tests",
)
test_selection_group.addoption(
"--no-install",
default=False,
action="store_true",
help="Do not install salt and use a previous install Salt package",
)
test_selection_group.addoption(
"--no-uninstall",
default=False,
action="store_true",
help="Do not uninstall salt packages after test run is complete",
)
@pytest.fixture(scope="session")
def salt_factories_root_dir(request, tmp_path_factory):
root_dir = SaltPkgInstall.salt_factories_root_dir(
request.config.getoption("--system-service")
)
if root_dir is not None:
yield root_dir
else:
root_dir = tmp_path_factory.mktemp("salt-tests")
try:
yield root_dir
finally:
shutil.rmtree(str(root_dir), ignore_errors=True)
@pytest.fixture(scope="session")
def salt_factories_config(salt_factories_root_dir):
return {
"code_dir": CODE_DIR,
"root_dir": salt_factories_root_dir,
"system_install": True,
}
@pytest.fixture(scope="session")
def install_salt(request, salt_factories_root_dir):
with SaltPkgInstall(
conf_dir=salt_factories_root_dir / "etc" / "salt",
system_service=request.config.getoption("--system-service"),
upgrade=request.config.getoption("--upgrade"),
no_uninstall=request.config.getoption("--no-uninstall"),
no_install=request.config.getoption("--no-install"),
) as fixture:
yield fixture
@pytest.fixture(scope="session")
def salt_factories(salt_factories, salt_factories_root_dir):
salt_factories.root_dir = salt_factories_root_dir
return salt_factories
@pytest.fixture(scope="session")
def state_tree():
if platform.is_windows():
file_root = pathlib.Path("C:/salt/srv/salt")
elif platform.is_darwin():
file_root = pathlib.Path("/opt/srv/salt")
else:
file_root = pathlib.Path("/srv/salt")
envs = {
"base": [
str(file_root),
str(TESTS_DIR / "files"),
],
}
tree = SaltStateTree(envs=envs)
test_sls_contents = """
test_foo:
test.succeed_with_changes:
- name: foo
"""
states_sls_contents = """
update:
pkg.installed:
- name: bash
salt_dude:
user.present:
- name: dude
- fullname: Salt Dude
"""
win_states_sls_contents = """
create_empty_file:
file.managed:
- name: C://salt/test/txt
salt_dude:
user.present:
- name: dude
- fullname: Salt Dude
"""
with tree.base.temp_file("test.sls", test_sls_contents), tree.base.temp_file(
"states.sls", states_sls_contents
), tree.base.temp_file("win_states.sls", win_states_sls_contents):
yield tree
@pytest.fixture(scope="session")
def pillar_tree():
"""
Add pillar files
"""
if platform.is_windows():
pillar_root = pathlib.Path("C:/salt/srv/pillar")
elif platform.is_darwin():
pillar_root = pathlib.Path("/opt/srv/pillar")
else:
pillar_root = pathlib.Path("/srv/pillar")
pillar_root.mkdir(mode=0o777, parents=True, exist_ok=True)
tree = SaltPillarTree(
envs={
"base": [
str(pillar_root),
]
},
)
top_file_contents = """
base:
'*':
- test
"""
test_file_contents = """
info: test
"""
with tree.base.temp_file("top.sls", top_file_contents), tree.base.temp_file(
"test.sls", test_file_contents
):
yield tree
@pytest.fixture(scope="module")
def sls(state_tree):
"""
Add an sls file
"""
test_sls_contents = """
test_foo:
test.succeed_with_changes:
- name: foo
"""
states_sls_contents = """
update:
pkg.installed:
- name: bash
salt_dude:
user.present:
- name: dude
- fullname: Salt Dude
"""
win_states_sls_contents = """
create_empty_file:
file.managed:
- name: C://salt/test/txt
salt_dude:
user.present:
- name: dude
- fullname: Salt Dude
"""
with state_tree.base.temp_file(
"tests.sls", test_sls_contents
), state_tree.base.temp_file(
"states.sls", states_sls_contents
), state_tree.base.temp_file(
"win_states.sls", win_states_sls_contents
):
yield
@pytest.fixture(scope="session")
def salt_master(salt_factories, install_salt, state_tree, pillar_tree):
"""
Start up a master
"""
start_timeout = None
# Since the daemons are "packaged" with tiamat, the salt plugins provided
# by salt-factories won't be discovered. Provide the required `*_dirs` on
# the configuration so that they can still be used.
config_defaults = {
"engines_dirs": [
str(salt_factories.get_salt_engines_path()),
],
"log_handlers_dirs": [
str(salt_factories.get_salt_log_handlers_path()),
],
}
config_overrides = {
"timeout": 30,
"file_roots": state_tree.as_dict(),
"pillar_roots": pillar_tree.as_dict(),
"rest_cherrypy": {"port": 8000, "disable_ssl": True},
"external_auth": {"auto": {"saltdev": [".*"]}},
}
if (platform.is_windows() or platform.is_darwin()) and install_salt.singlebin:
start_timeout = 240
# For every minion started we have to accept it's key.
# On windows, using single binary, it has to decompress it and run the command. Too slow.
# So, just in this scenario, use open mode
config_overrides["open_mode"] = True
factory = salt_factories.salt_master_daemon(
random_string("master-"),
defaults=config_defaults,
overrides=config_overrides,
factory_class=SaltMaster,
salt_pkg_install=install_salt,
)
factory.after_terminate(pytest.helpers.remove_stale_master_key, factory)
with factory.started(start_timeout=start_timeout):
yield factory
@pytest.fixture(scope="session")
def salt_minion(salt_master, install_salt):
"""
Start up a minion
"""
start_timeout = None
if (platform.is_windows() or platform.is_darwin()) and install_salt.singlebin:
start_timeout = 240
minion_id = random_string("minion-")
# Since the daemons are "packaged" with tiamat, the salt plugins provided
# by salt-factories won't be discovered. Provide the required `*_dirs` on
# the configuration so that they can still be used.
config_defaults = {
"engines_dirs": salt_master.config["engines_dirs"].copy(),
"log_handlers_dirs": salt_master.config["log_handlers_dirs"].copy(),
}
config_overrides = {
"id": minion_id,
"file_roots": salt_master.config["file_roots"].copy(),
"pillar_roots": salt_master.config["pillar_roots"].copy(),
}
factory = salt_master.salt_minion_daemon(
minion_id,
overrides=config_overrides,
defaults=config_defaults,
)
factory.after_terminate(
pytest.helpers.remove_stale_minion_key, salt_master, factory.id
)
with factory.started(start_timeout=start_timeout):
yield factory
@pytest.fixture(scope="module")
def salt_cli(salt_master):
return salt_master.salt_cli()
@pytest.fixture(scope="module")
def salt_key_cli(salt_master):
return salt_master.salt_key_cli()
@pytest.fixture(scope="module")
def salt_call_cli(salt_minion):
return salt_minion.salt_call_cli()
@pytest.fixture(scope="module")
def test_account(salt_call_cli):
with TestUser(salt_call_cli=salt_call_cli) as account:
yield account
@pytest.fixture(scope="module")
def salt_api(salt_master, install_salt):
"""
start up and configure salt_api
"""
start_timeout = None
if platform.is_windows() and install_salt.singlebin:
start_timeout = 240
factory = salt_master.salt_api_daemon()
with factory.started(start_timeout=start_timeout):
yield factory
@pytest.fixture(scope="module")
def api_request(test_account, salt_api):
with ApiRequest(salt_api=salt_api, test_account=test_account) as session:
yield session

View file

@ -0,0 +1,53 @@
#!py
import importlib
def run():
config = {}
for test_import in [
'templates', 'platform', 'cli', 'executors', 'config', 'wheel', 'netapi',
'cache', 'proxy', 'transport', 'metaproxy', 'modules', 'tokens', 'matchers',
'acl', 'auth', 'log', 'engines', 'client', 'returners', 'runners', 'tops',
'output', 'daemons', 'thorium', 'renderers', 'states', 'cloud', 'roster',
'beacons', 'pillar', 'spm', 'utils', 'sdb', 'fileserver', 'defaults',
'ext', 'queues', 'grains', 'serializers'
]:
try:
import_name = "salt.{}".format(test_import)
importlib.import_module(import_name)
config['test_imports_succeeded'] = {
'test.succeed_without_changes': [
{
'name': import_name
},
],
}
except ModuleNotFoundError as err:
config['test_imports_failed'] = {
'test.fail_without_changes': [
{
'name': import_name,
'comment': "The imports test failed. The error was: {}".format(err)
},
],
}
for stdlib_import in ["telnetlib"]:
try:
importlib.import_module(stdlib_import)
config['stdlib_imports_succeeded'] = {
'test.succeed_without_changes': [
{
'name': stdlib_import
},
],
}
except ModuleNotFoundError as err:
config['stdlib_imports_failed'] = {
'test.fail_without_changes': [
{
'name': stdlib_import,
'comment': "The stdlib imports test failed. The error was: {}".format(err)
},
],
}
return config

View file

@ -0,0 +1,13 @@
import sys
import salt.utils.data
user_arg = sys.argv
if user_arg[1] == "raise":
raise Exception("test")
if salt.utils.data.is_true(user_arg[1]):
sys.exit(0)
else:
sys.exit(1)

View file

@ -0,0 +1,24 @@
{% set services_enabled = ['salt-master', 'salt-minion', 'salt-syndic', 'salt-api'] %}
{% set services_disabled = [] %}
{% for service in services_enabled %}
check_services_enabled_{{ service }}:
service.enabled:
- name: {{ service }}
run_if_changes_{{ service }}:
cmd.run:
- name: failtest service is enabled
- onchanges:
- service: check_services_enabled_{{ service }}
{% endfor %}
{% for service in services_disabled %}
check_services_disabled_{{ service }}:
service.disabled:
- name: {{ service }}
run_if_changes_{{ service }}:
cmd.run:
- name: failtest service is disabled
- onchanges:
- service: check_services_disabled_{{ service }}
{% endfor %}

View file

@ -0,0 +1,24 @@
{% set services_enabled = [] %}
{% set services_disabled = ['salt-master', 'salt-minion', 'salt-syndic', 'salt-api'] %}
{% for service in services_enabled %}
check_services_enabled_{{ service }}:
service.enabled:
- name: {{ service }}
run_if_changes_{{ service }}:
cmd.run:
- name: failtest service is enabled
- onchanges:
- service: check_services_enabled_{{ service }}
{% endfor %}
{% for service in services_disabled %}
check_services_disabled_{{ service }}:
service.disabled:
- name: {{ service }}
run_if_changes_{{ service }}:
cmd.run:
- name: failtest service is disabled
- onchanges:
- service: check_services_disabled_{{ service }}
{% endfor %}

View file

View file

@ -0,0 +1,17 @@
import logging
from saltfactories.utils.functional import MultiStateResult
log = logging.getLogger(__name__)
def test_check_imports(salt_cli, salt_minion):
"""
Test imports
"""
ret = salt_cli.run("state.sls", "check_imports", minion_tgt=salt_minion.id)
assert ret.returncode == 0
assert ret.data
result = MultiStateResult(raw=ret.data)
for state_ret in result:
assert state_ret.result is True

View file

@ -0,0 +1,43 @@
import pytest
from saltfactories.utils.functional import MultiStateResult
@pytest.mark.skip_on_windows(reason="Linux test only")
def test_services(install_salt, salt_cli, salt_minion):
"""
Check if Services are enabled/disabled
"""
if install_salt.compressed:
pytest.skip("Skip test on single binary and onedir package")
ret = salt_cli.run("grains.get", "os_family", minion_tgt=salt_minion.id)
assert ret.returncode == 0
assert ret.data
state_name = desired_state = None
os_family = ret.data
if os_family == "Debian":
state_name = "debianbased"
desired_state = "enabled"
elif os_family == "RedHat":
state_name = "redhatbased"
desired_state = "disabled"
else:
pytest.fail(f"Don't know how to handle os_family={os_family}")
ret = salt_cli.run("state.apply", state_name, minion_tgt=salt_minion.id)
assert ret.returncode == 0
assert ret.data
expected_in_comment = f"is already {desired_state}, and is in the desired state"
result = MultiStateResult(raw=ret.data)
for state_ret in result:
assert state_ret.result is True
if "__id__" not in state_ret.full_return:
# This is a state requirement
# For example:
# State was not run because none of the onchanges reqs changed
continue
assert expected_in_comment in state_ret.comment

View file

@ -0,0 +1,42 @@
import hashlib
import logging
import sys
import pytest
log = logging.getLogger(__name__)
@pytest.mark.usefixtures("version")
def test_hashes(install_salt, salt_cli, salt_minion):
"""
Test the hashes generated for both single binary
and the onedir packages.
"""
if not install_salt.compressed:
pytest.skip("This test requires the single binary or onedir package")
hashes = install_salt.salt_hashes
pkg = install_salt.pkgs[0]
with open(pkg, "rb") as fh:
file_bytes = fh.read()
delimiter = "/"
if sys.platform.startswith("win"):
delimiter = "\\"
for _hash in hashes.keys():
hash_file = hashes[_hash]["file"]
found_hash = False
with open(hash_file) as fp:
for line in fp:
if pkg.rsplit(delimiter, 1)[-1] in line:
found_hash = True
assert (
getattr(hashlib, _hash.lower())(file_bytes).hexdigest()
== line.split()[0]
)
if not found_hash:
assert False, f"A {_hash} hash was not found in {hash_file} for pkg {pkg}"

View file

@ -0,0 +1,13 @@
def test_help(install_salt):
"""
Test --help works for all salt cmds
"""
for cmd in install_salt.binary_paths.values():
if "salt-cloud" in cmd:
assert True
elif "salt-ssh" in cmd:
assert True
else:
ret = install_salt.proc.run(*cmd, "--help")
assert "Usage" in ret.stdout
assert ret.returncode == 0

View file

@ -0,0 +1,125 @@
import os
import pathlib
import shutil
import subprocess
import pytest
from pytestskipmarkers.utils import platform
@pytest.fixture
def pypath():
if platform.is_windows():
return pathlib.Path(os.getenv("LocalAppData"), "salt", "pypath")
return pathlib.Path(f"{os.sep}opt", "saltstack", "salt", "pypath")
@pytest.fixture(autouse=True)
def wipe_pypath(pypath):
try:
yield
finally:
# Let's make sure pypath is clean after each test, since it's contents
# are not actually part of the test suite, and they break other test
# suite assumptions
for path in pypath.glob("*"):
if path.is_dir():
shutil.rmtree(path, ignore_errors=True)
else:
path.unlink()
def test_pip_install(salt_call_cli):
"""
Test pip.install and ensure
module can use installed library
"""
dep = "PyGithub"
repo = "https://github.com/saltstack/salt.git"
try:
install = salt_call_cli.run("--local", "pip.install", dep)
assert install.returncode == 0
use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo)
assert "Authentication information could" in use_lib.stderr
finally:
ret = salt_call_cli.run("--local", "pip.uninstall", dep)
assert ret.returncode == 0
use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo)
assert "The github execution module cannot be loaded" in use_lib.stderr
def demote(user_uid, user_gid):
def result():
os.setgid(user_gid)
os.setuid(user_uid)
return result
@pytest.mark.skip_on_windows(reason="We can't easily demote users on Windows")
def test_pip_non_root(install_salt, test_account, pypath):
# Let's make sure pypath does not exist
shutil.rmtree(pypath)
assert not pypath.exists()
# We should be able to issue a --help without being root
ret = subprocess.run(
install_salt.binary_paths["salt"] + ["--help"],
preexec_fn=demote(test_account.uid, test_account.gid),
env=test_account.env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False,
universal_newlines=True,
)
assert ret.returncode == 0, ret.stderr
assert "Usage" in ret.stdout
assert not pypath.exists()
# Try to pip install something, should fail
ret = subprocess.run(
install_salt.binary_paths["pip"] + ["install", "pep8"],
preexec_fn=demote(test_account.uid, test_account.gid),
env=test_account.env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False,
universal_newlines=True,
)
assert ret.returncode == 1, ret.stderr
assert f"The path '{pypath}' does not exist or could not be created." in ret.stderr
assert not pypath.exists()
# Let tiamat-pip create the pypath directory for us
ret = subprocess.run(
install_salt.binary_paths["pip"] + ["install", "-h"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False,
universal_newlines=True,
)
assert ret.returncode == 0, ret.stderr
# Now, we should still not be able to install as non-root
ret = subprocess.run(
install_salt.binary_paths["pip"] + ["install", "pep8"],
preexec_fn=demote(test_account.uid, test_account.gid),
env=test_account.env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False,
universal_newlines=True,
)
assert ret.returncode != 0, ret.stderr
# But we should be able to install as root
ret = subprocess.run(
install_salt.binary_paths["pip"] + ["install", "pep8"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False,
universal_newlines=True,
)
assert ret.returncode == 0, ret.stderr

View file

@ -0,0 +1,92 @@
import logging
import subprocess
import pytest
log = logging.getLogger(__name__)
def test_pip_install(install_salt, salt_call_cli):
"""
Test pip.install and ensure that a package included in the tiamat build can be upgraded
"""
ret = subprocess.run(
install_salt.binary_paths["salt"] + ["--versions-report"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
check=True,
shell=False,
)
assert ret.returncode == 0
possible_upgrades = [
"docker-py",
"msgpack",
"pycparser",
"python-gnupg",
"pyyaml",
"pyzmq",
"jinja2",
]
found_new = False
for dep in possible_upgrades:
get_latest = salt_call_cli.run("--local", "pip.list_all_versions", dep)
if not get_latest.data:
# No information available
continue
dep_version = get_latest.data[-1]
installed_version = None
for line in ret.stdout.splitlines():
if dep in line.lower():
installed_version = line.lower().strip().split(":")[-1].strip()
break
else:
pytest.fail(f"Failed to find {dep} in the versions report output")
if dep_version == installed_version:
log.warning(f"The {dep} dependency is already latest")
else:
found_new = True
break
if found_new:
try:
install = salt_call_cli.run(
"--local", "pip.install", f"{dep}=={dep_version}"
)
assert install
log.warning(install)
# The assert is commented out because pip will actually trigger a failure since
# we're breaking the dependency tree, but, for the purpose of this test, we can
# ignore it.
#
# assert install.returncode == 0
ret = subprocess.run(
install_salt.binary_paths["salt"] + ["--versions-report"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
check=True,
shell=False,
)
assert ret.returncode == 0
for line in ret.stdout.splitlines():
if dep in line.lower():
new_version = line.lower().strip().split(":")[-1].strip()
if new_version == installed_version:
pytest.fail(
f"The newly installed version of {dep} does not show in the versions report"
)
assert new_version == dep_version
break
else:
pytest.fail(f"Failed to find {dep} in the versions report output")
finally:
log.info(f"Uninstalling {dep_version}")
assert salt_call_cli.run(
"--local", "pip.uninstall", f"{dep}=={dep_version}"
)
else:
pytest.skip("Did not find an upgrade version for any of the dependencies")

View file

@ -0,0 +1,32 @@
import sys
import pytest
pytestmark = [
pytest.mark.skip_unless_on_linux,
]
@pytest.fixture(scope="module")
def grains(salt_call_cli):
ret = salt_call_cli.run("--local", "grains.items")
assert ret.data, ret
return ret.data
@pytest.fixture(scope="module")
def pkgname(grains):
if sys.platform.startswith("win"):
return "putty"
elif grains["os_family"] == "RedHat":
if grains["os"] == "VMware Photon OS":
return "snoopy"
return "units"
elif grains["os_family"] == "Debian":
return "ifenslave"
return "figlet"
def test_pkg_install(salt_call_cli, pkgname):
ret = salt_call_cli.run("--local", "state.single", "pkg.installed", pkgname)
assert ret.returncode == 0

View file

@ -0,0 +1,31 @@
import subprocess
import pytest
from tests.support.helpers import TESTS_DIR
@pytest.mark.parametrize("exp_ret,user_arg", [(1, "false"), (0, "true")])
def test_python_script(install_salt, exp_ret, user_arg):
ret = subprocess.run(
install_salt.binary_paths["salt"]
+ ["python", str(TESTS_DIR / "files" / "check_python.py"), user_arg],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False,
universal_newlines=True,
)
assert ret.returncode == exp_ret, ret.stderr
def test_python_script_exception(install_salt):
ret = subprocess.run(
install_salt.binary_paths["salt"]
+ ["python", str(TESTS_DIR / "files" / "check_python.py"), "raise"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False,
universal_newlines=True,
)
assert "Exception: test" in ret.stderr

View file

@ -0,0 +1,14 @@
def test_salt_api(api_request):
"""
Test running a command against the salt api
"""
ret = api_request.post(
"/run",
data={
"client": "local",
"tgt": "*",
"fun": "test.arg",
"arg": ["foo", "bar"],
},
)
assert ret["args"] == ["foo", "bar"]

View file

@ -0,0 +1,59 @@
import pytest
def test_salt_call_local(salt_call_cli):
"""
Test salt-call --local test.ping
"""
ret = salt_call_cli.run("--local", "test.ping")
assert ret.data is True
assert ret.returncode == 0
def test_salt_call(salt_call_cli):
"""
Test salt-call test.ping
"""
ret = salt_call_cli.run("test.ping")
assert ret.data is True
assert ret.returncode == 0
def test_sls(salt_call_cli):
"""
Test calling a sls file
"""
ret = salt_call_cli.run("state.apply", "test")
assert ret.data, ret
sls_ret = ret.data[next(iter(ret.data))]
assert sls_ret["changes"]["testing"]["new"] == "Something pretended to change"
assert ret.returncode == 0
def test_salt_call_local_sys_doc_none(salt_call_cli):
"""
Test salt-call --local sys.doc none
"""
ret = salt_call_cli.run("--local", "sys.doc", "none")
assert not ret.data
assert ret.returncode == 0
def test_salt_call_local_sys_doc_aliasses(salt_call_cli):
"""
Test salt-call --local sys.doc aliasses
"""
ret = salt_call_cli.run("--local", "sys.doc", "aliases.list_aliases")
assert "aliases.list_aliases" in ret.data
assert ret.returncode == 0
@pytest.mark.skip_on_windows()
def test_salt_call_cmd_run_id_runas(salt_call_cli, test_account, caplog):
"""
Test salt-call --local cmd_run id with runas
"""
ret = salt_call_cli.run("--local", "cmd.run", "id", runas=test_account.username)
assert "Environment could not be retrieved for user" not in caplog.text
assert str(test_account.uid) in ret.stdout
assert str(test_account.gid) in ret.stdout

View file

@ -0,0 +1,25 @@
from sys import platform
def test_salt_cmd_run(salt_cli, salt_minion):
"""
Test salt cmd.run 'ipconfig' or 'ls -lah /'
"""
ret = None
if platform.startswith("win"):
ret = salt_cli.run("cmd.run", "ipconfig", minion_tgt=salt_minion.id)
else:
ret = salt_cli.run("cmd.run", "ls -lah /", minion_tgt=salt_minion.id)
assert ret
assert ret.stdout
def test_salt_list_users(salt_cli, salt_minion):
"""
Test salt user.list_users
"""
ret = salt_cli.run("user.list_users", minion_tgt=salt_minion.id)
if platform.startswith("win"):
assert "Administrator" in ret.stdout
else:
assert "root" in ret.stdout

View file

@ -0,0 +1,34 @@
def test_grains_items(salt_cli, salt_minion):
"""
Test grains.items
"""
ret = salt_cli.run("grains.items", minion_tgt=salt_minion.id)
assert ret.data, ret
assert "osrelease" in ret.data
def test_grains_item_os(salt_cli, salt_minion):
"""
Test grains.item os
"""
ret = salt_cli.run("grains.item", "os", minion_tgt=salt_minion.id)
assert ret.data, ret
assert "os" in ret.data
def test_grains_item_pythonversion(salt_cli, salt_minion):
"""
Test grains.item pythonversion
"""
ret = salt_cli.run("grains.item", "pythonversion", minion_tgt=salt_minion.id)
assert ret.data, ret
assert "pythonversion" in ret.data
def test_grains_setval_key_val(salt_cli, salt_minion):
"""
Test grains.setval key val
"""
ret = salt_cli.run("grains.setval", "key", "val", minion_tgt=salt_minion.id)
assert ret.data, ret
assert "key" in ret.data

View file

@ -0,0 +1,7 @@
def test_salt_key(salt_key_cli, salt_minion):
"""
Test running salt-key -L
"""
ret = salt_key_cli.run("-L")
assert ret.data
assert salt_minion.id in ret.data["minions"]

View file

@ -0,0 +1,19 @@
def test_salt_minion_ping(salt_cli, salt_minion):
"""
Test running a command against a targeted minion
"""
ret = salt_cli.run("test.ping", minion_tgt=salt_minion.id)
assert ret.returncode == 0
assert ret.data is True
def test_salt_minion_setproctitle(salt_cli, salt_minion):
"""
Test that setproctitle is working
for the running Salt minion
"""
ret = salt_cli.run(
"ps.pgrep", "MinionProcessManager", full=True, minion_tgt=salt_minion.id
)
assert ret.returncode == 0
assert ret.data != ""

View file

@ -0,0 +1,15 @@
import pytest
@pytest.mark.parametrize("output_fmt", ["yaml", "json"])
def test_salt_output(salt_cli, salt_minion, output_fmt):
"""
Test --output
"""
ret = salt_cli.run(
f"--output={output_fmt}", "test.fib", "7", minion_tgt=salt_minion.id
)
if output_fmt == "json":
assert 13 in ret.data
else:
ret.stdout.matcher.fnmatch_lines(["*- 13*"])

View file

@ -0,0 +1,6 @@
def test_salt_pillar(salt_cli, salt_minion):
"""
Test pillar.items
"""
ret = salt_cli.run("pillar.items", minion_tgt=salt_minion.id)
assert "info" in ret.data

View file

@ -0,0 +1,16 @@
import sys
def test_salt_state_file(salt_cli, salt_minion):
"""
Test state file
"""
if sys.platform.startswith("win"):
ret = salt_cli.run("state.apply", "win_states", minion_tgt=salt_minion.id)
else:
ret = salt_cli.run("state.apply", "states", minion_tgt=salt_minion.id)
assert ret.data, ret
sls_ret = ret.data[next(iter(ret.data))]
assert "changes" in sls_ret
assert "name" in sls_ret

View file

@ -0,0 +1,43 @@
import subprocess
import pytest
@pytest.mark.skip_on_windows(reason="Linux test only")
def test_system_config(salt_cli, salt_minion):
"""
Test system config
"""
get_family = salt_cli.run("grains.get", "os_family", minion_tgt=salt_minion.id)
assert get_family.returncode == 0
get_finger = salt_cli.run("grains.get", "osfinger", minion_tgt=salt_minion.id)
assert get_finger.returncode == 0
if get_family.data == "RedHat":
if get_finger.data in (
"CentOS Stream-8",
"CentOS Linux-8",
"CentOS Stream-9",
"Fedora Linux-36",
):
ret = subprocess.call(
"systemctl show -p ${config} salt-minion.service", shell=True
)
assert ret == 0
else:
ret = subprocess.call(
"systemctl show -p ${config} salt-minion.service", shell=True
)
assert ret == 1
elif "Debian" in get_family.stdout:
if "Debian-9" in get_finger.stdout:
ret = subprocess.call(
"systemctl show -p ${config} salt-minion.service", shell=True
)
assert ret == 1
else:
ret = subprocess.call(
"systemctl show -p ${config} salt-minion.service", shell=True
)
assert ret == 0

View file

@ -0,0 +1,110 @@
import sys
import pytest
from pytestskipmarkers.utils import platform
def test_salt_version(version, install_salt):
"""
Test version outputed from salt --version
"""
ret = install_salt.proc.run(*install_salt.binary_paths["salt"], "--version")
assert ret.stdout.strip() == f"salt {version}"
def test_salt_versions_report_master(install_salt):
"""
Test running --versions-report on master
"""
ret = install_salt.proc.run(
*install_salt.binary_paths["master"], "--versions-report"
)
ret.stdout.matcher.fnmatch_lines(["*Salt Version:*"])
if sys.platform == "win32":
ret.stdout.matcher.fnmatch_lines(["*Python: 3.8.16*"])
else:
ret.stdout.matcher.fnmatch_lines(["*Python: 3.9.16*"])
def test_salt_versions_report_minion(salt_cli, salt_minion):
"""
Test running test.versions_report on minion
"""
ret = salt_cli.run("test.versions_report", minion_tgt=salt_minion.id)
ret.stdout.matcher.fnmatch_lines(["*Salt Version:*"])
@pytest.mark.parametrize(
"binary", ["master", "cloud", "syndic", "minion", "call", "api"]
)
def test_compare_versions(version, binary, install_salt):
"""
Test compare versions
"""
if platform.is_windows() and install_salt.singlebin:
pytest.skip(
"Already tested in `test_salt_version`. No need to repeat "
"for windows single binary installs."
)
if binary in ["master", "cloud", "syndic"]:
if sys.platform.startswith("win"):
pytest.skip(f"{binary} not installed on windows")
ret = install_salt.proc.run(*install_salt.binary_paths[binary], "--version")
ret.stdout.matcher.fnmatch_lines([f"*{version}*"])
@pytest.mark.skip_unless_on_darwin()
@pytest.mark.parametrize(
"symlink",
[
# We can't create a salt symlink because there is a salt directory
# "salt",
"salt-api",
"salt-call",
"salt-cloud",
"salt-cp",
"salt-key",
"salt-master",
"salt-minion",
"salt-proxy",
"salt-run",
"salt-spm",
"salt-ssh",
"salt-syndic",
],
)
def test_symlinks_created(version, symlink, install_salt):
"""
Test symlinks created
"""
if not install_salt.installer_pkg:
pytest.skip(
"This test is for the installer package only (pkg). It does not "
"apply to the tarball"
)
ret = install_salt.proc.run(install_salt.bin_dir / symlink, "--version")
ret.stdout.matcher.fnmatch_lines([f"*{version}*"])
def test_compare_pkg_versions_redhat_rc(version, install_salt):
"""
Test compare pkg versions for redhat RC packages.
A tilde should be included in RC Packages and it
should test to be a lower version than a non RC package
of the same version. For example, v3004~rc1 should be
less than v3004.
"""
if install_salt.distro_id not in ("centos", "redhat", "amzn", "fedora"):
pytest.skip("Only tests rpm packages")
pkg = [x for x in install_salt.pkgs if "rpm" in x]
if not pkg:
pytest.skip("Not testing rpm packages")
pkg = pkg[0].split("/")[-1]
if "rc" not in pkg:
pytest.skip("Not testing an RC package")
assert "~" in pkg
comp_pkg = pkg.split("~")[0]
ret = install_salt.proc.run("rpmdev-vercmp", pkg, comp_pkg)
ret.stdout.matcher.fnmatch_lines([f"{pkg} < {comp_pkg}"])

View file

View file

@ -0,0 +1,11 @@
"""
Python will always try to import sitecustomize.
We use that fact to try and support code coverage for sub-processes
"""
try:
import coverage
coverage.process_startup()
except ImportError:
pass

1404
pkg/tests/support/helpers.py Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,70 @@
import pytest
@pytest.mark.skip_on_windows(
reason="Salt Master scripts not included in old windows packages"
)
def test_salt_upgrade(salt_call_cli, salt_minion, install_salt):
"""
Test upgrade of Salt
"""
if not install_salt.upgrade:
pytest.skip("Not testing an upgrade, do not run")
# verify previous install version is setup correctly and works
ret = salt_call_cli.run("test.ping")
assert ret.returncode == 0
assert ret.data
# test pip install before an upgrade
dep = "PyGithub"
repo = "https://github.com/saltstack/salt.git"
install = salt_call_cli.run("--local", "pip.install", dep)
assert install.returncode == 0
use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo)
assert "Authentication information could" in use_lib.stderr
# upgrade Salt from previous version and test
install_salt.install(upgrade=True)
ret = salt_call_cli.run("test.ping")
assert ret.returncode == 0
assert ret.data
# test pip install after an upgrade
use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo)
assert "Authentication information could" in use_lib.stderr
@pytest.mark.skip_unless_on_windows()
def test_salt_upgrade_windows_1(install_salt, salt_call_cli):
"""
Test upgrade of Salt on windows
"""
if not install_salt.upgrade:
pytest.skip("Not testing an upgrade, do not run")
# verify previous install version is setup correctly and works
ret = salt_call_cli.run("--local", "test.ping")
assert ret.data is True
assert ret.returncode == 0
# test pip install before an upgrade
dep = "PyGithub"
repo = "https://github.com/saltstack/salt.git"
install = salt_call_cli.run("--local", "pip.install", dep)
assert install.returncode == 0
use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo)
assert "Authentication information could" in use_lib.stderr
@pytest.mark.skip_unless_on_windows()
def test_salt_upgrade_windows_2(salt_call_cli, salt_minion, install_salt):
"""
Test upgrade of Salt on windows
"""
if install_salt.no_uninstall:
pytest.skip("Not testing an upgrade, do not run")
# upgrade Salt from previous version and test
install_salt.install(upgrade=True)
ret = salt_call_cli.run("test.ping")
assert ret.returncode == 0
assert ret.data
repo = "https://github.com/saltstack/salt.git"
use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo)
assert "Authentication information could" in use_lib.stderr

View file

@ -0,0 +1,2 @@
pytest-pudb
cherrypy

View file

@ -0,0 +1,204 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=requirements/static/ci/py3.10/pkgtests.txt requirements/base.txt requirements/pytest.txt requirements/static/ci/pkgtests.in requirements/zeromq.txt
#
attrs==22.2.0
# via
# pytest
# pytest-salt-factories
# pytest-shell-utilities
# pytest-skip-markers
# pytest-system-statistics
autocommand==2.2.2
# via jaraco.text
certifi==2022.12.7
# via requests
charset-normalizer==3.0.1
# via requests
cheroot==9.0.0
# via cherrypy
cherrypy==18.8.0
# via
# -r requirements/base.txt
# -r requirements/static/ci/pkgtests.in
contextvars==2.4
# via -r requirements/base.txt
distlib==0.3.6
# via virtualenv
distro==1.8.0
# via
# -r requirements/base.txt
# pytest-skip-markers
docker==6.0.1
# via pytest-salt-factories
exceptiongroup==1.1.0
# via pytest
filelock==3.9.0
# via virtualenv
flaky==3.7.0
# via -r requirements/pytest.txt
idna==3.4
# via requests
immutables==0.19
# via contextvars
inflect==6.0.2
# via jaraco.text
iniconfig==2.0.0
# via pytest
jaraco.classes==3.2.3
# via jaraco.collections
jaraco.collections==3.8.0
# via cherrypy
jaraco.context==4.2.0
# via jaraco.text
jaraco.functools==3.5.2
# via
# cheroot
# jaraco.text
jaraco.text==3.11.0
# via jaraco.collections
jedi==0.18.2
# via pudb
jinja2==3.1.2
# via -r requirements/base.txt
jmespath==1.0.1
# via -r requirements/base.txt
looseversion==1.0.3
# via -r requirements/base.txt
markupsafe==2.1.1
# via
# -r requirements/base.txt
# jinja2
# werkzeug
mock==5.0.1
# via -r requirements/pytest.txt
more-itertools==9.0.0
# via
# cheroot
# cherrypy
# jaraco.classes
# jaraco.functools
# jaraco.text
msgpack==1.0.4
# via
# -r requirements/base.txt
# pytest-salt-factories
packaging==23.0
# via
# -r requirements/base.txt
# docker
# pudb
# pytest
parso==0.8.3
# via jedi
platformdirs==2.6.2
# via virtualenv
pluggy==1.0.0
# via pytest
portend==3.1.0
# via cherrypy
psutil==5.9.4
# via
# -r requirements/base.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
pudb==2022.1.3
# via pytest-pudb
pycryptodomex==3.16.0
# via -r requirements/crypto.txt
pydantic==1.10.4
# via inflect
pygments==2.14.0
# via pudb
pytest-custom-exit-code==0.3.0
# via -r requirements/pytest.txt
pytest-helpers-namespace==2021.12.29
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
pytest-httpserver==1.0.6
# via -r requirements/pytest.txt
pytest-pudb==0.7.0
# via -r requirements/static/ci/pkgtests.in
pytest-salt-factories[docker]==1.0.0rc23 ; sys_platform != "win32"
# via -r requirements/pytest.txt
pytest-shell-utilities==1.7.0
# via pytest-salt-factories
pytest-skip-markers==1.4.0
# via
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
pytest-subtests==0.9.0
# via -r requirements/pytest.txt
pytest-system-statistics==1.0.2
# via pytest-salt-factories
pytest-tempdir==2019.10.12
# via
# -r requirements/pytest.txt
# pytest-salt-factories
pytest-timeout==2.1.0
# via -r requirements/pytest.txt
pytest==7.2.1 ; python_version > "3.6"
# via
# -r requirements/pytest.txt
# pytest-custom-exit-code
# pytest-helpers-namespace
# pytest-pudb
# pytest-salt-factories
# pytest-shell-utilities
# pytest-skip-markers
# pytest-subtests
# pytest-system-statistics
# pytest-tempdir
# pytest-timeout
pytz==2022.7.1
# via tempora
pyyaml==6.0
# via
# -r requirements/base.txt
# pytest-salt-factories
pyzmq==25.0.0 ; python_version >= "3.9"
# via
# -r requirements/zeromq.txt
# pytest-salt-factories
requests==2.28.2
# via
# -r requirements/base.txt
# docker
six==1.16.0
# via cheroot
tempora==5.2.0
# via portend
tomli==2.0.1
# via pytest
typing-extensions==4.4.0
# via
# pydantic
# pytest-shell-utilities
# pytest-system-statistics
urllib3==1.26.14
# via
# docker
# requests
urwid-readline==0.13
# via pudb
urwid==2.1.2
# via
# pudb
# urwid-readline
virtualenv==20.17.1
# via pytest-salt-factories
websocket-client==1.4.2
# via docker
werkzeug==2.2.2
# via pytest-httpserver
zc.lockfile==2.0
# via cherrypy
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -0,0 +1,219 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=requirements/static/ci/py3.7/pkgtests.txt requirements/base.txt requirements/pytest.txt requirements/static/ci/pkgtests.in requirements/zeromq.txt
#
attrs==22.2.0
# via
# pytest
# pytest-salt-factories
# pytest-shell-utilities
# pytest-skip-markers
# pytest-system-statistics
autocommand==2.2.2
# via jaraco.text
certifi==2022.12.7
# via requests
charset-normalizer==3.0.1
# via requests
cheroot==9.0.0
# via cherrypy
cherrypy==18.8.0
# via
# -r requirements/base.txt
# -r requirements/static/ci/pkgtests.in
contextvars==2.4
# via -r requirements/base.txt
distlib==0.3.6
# via virtualenv
distro==1.8.0
# via
# -r requirements/base.txt
# pytest-skip-markers
docker==6.0.1
# via pytest-salt-factories
exceptiongroup==1.1.0
# via pytest
filelock==3.9.0
# via virtualenv
flaky==3.7.0
# via -r requirements/pytest.txt
idna==3.4
# via requests
immutables==0.19
# via contextvars
importlib-metadata==6.0.0
# via
# cheroot
# pluggy
# pytest
# virtualenv
importlib-resources==5.10.2
# via jaraco.text
inflect==6.0.2
# via jaraco.text
iniconfig==2.0.0
# via pytest
jaraco.classes==3.2.3
# via jaraco.collections
jaraco.collections==3.8.0
# via cherrypy
jaraco.context==4.2.0
# via jaraco.text
jaraco.functools==3.5.2
# via
# cheroot
# jaraco.text
jaraco.text==3.11.0
# via jaraco.collections
jedi==0.18.2
# via pudb
jinja2==3.1.2
# via -r requirements/base.txt
jmespath==1.0.1
# via -r requirements/base.txt
looseversion==1.0.3
# via -r requirements/base.txt
markupsafe==2.1.1
# via
# -r requirements/base.txt
# jinja2
# werkzeug
mock==5.0.1
# via -r requirements/pytest.txt
more-itertools==9.0.0
# via
# cheroot
# cherrypy
# jaraco.classes
# jaraco.functools
# jaraco.text
msgpack==1.0.4
# via
# -r requirements/base.txt
# pytest-salt-factories
packaging==23.0
# via
# -r requirements/base.txt
# docker
# pudb
# pytest
parso==0.8.3
# via jedi
platformdirs==2.6.2
# via virtualenv
pluggy==1.0.0
# via pytest
portend==3.1.0
# via cherrypy
psutil==5.9.4
# via
# -r requirements/base.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
pudb==2022.1.3
# via pytest-pudb
pycryptodomex==3.16.0
# via -r requirements/crypto.txt
pydantic==1.10.4
# via inflect
pygments==2.14.0
# via pudb
pytest-custom-exit-code==0.3.0
# via -r requirements/pytest.txt
pytest-helpers-namespace==2021.12.29
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
pytest-httpserver==1.0.6
# via -r requirements/pytest.txt
pytest-pudb==0.7.0
# via -r requirements/static/ci/pkgtests.in
pytest-salt-factories[docker]==1.0.0rc23 ; sys_platform != "win32"
# via -r requirements/pytest.txt
pytest-shell-utilities==1.7.0
# via pytest-salt-factories
pytest-skip-markers==1.4.0
# via
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
pytest-subtests==0.9.0
# via -r requirements/pytest.txt
pytest-system-statistics==1.0.2
# via pytest-salt-factories
pytest-tempdir==2019.10.12
# via
# -r requirements/pytest.txt
# pytest-salt-factories
pytest-timeout==2.1.0
# via -r requirements/pytest.txt
pytest==7.2.1 ; python_version > "3.6"
# via
# -r requirements/pytest.txt
# pytest-custom-exit-code
# pytest-helpers-namespace
# pytest-pudb
# pytest-salt-factories
# pytest-shell-utilities
# pytest-skip-markers
# pytest-subtests
# pytest-system-statistics
# pytest-tempdir
# pytest-timeout
pytz==2022.7.1
# via tempora
pyyaml==6.0
# via
# -r requirements/base.txt
# pytest-salt-factories
pyzmq==25.0.0 ; python_version < "3.9"
# via
# -r requirements/zeromq.txt
# pytest-salt-factories
requests==2.28.2
# via
# -r requirements/base.txt
# docker
six==1.16.0
# via cheroot
tempora==5.2.0
# via portend
tomli==2.0.1
# via pytest
typing-extensions==4.4.0
# via
# immutables
# importlib-metadata
# platformdirs
# pydantic
# pytest-shell-utilities
# pytest-system-statistics
urllib3==1.26.14
# via
# docker
# requests
urwid-readline==0.13
# via pudb
urwid==2.1.2
# via
# pudb
# urwid-readline
virtualenv==20.17.1
# via pytest-salt-factories
websocket-client==1.4.2
# via docker
werkzeug==2.2.2
# via pytest-httpserver
zc.lockfile==2.0
# via cherrypy
zipp==3.11.0
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -0,0 +1,208 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=requirements/static/ci/py3.8/pkgtests.txt requirements/base.txt requirements/pytest.txt requirements/static/ci/pkgtests.in requirements/zeromq.txt
#
attrs==22.2.0
# via
# pytest
# pytest-salt-factories
# pytest-shell-utilities
# pytest-skip-markers
# pytest-system-statistics
autocommand==2.2.2
# via jaraco.text
certifi==2022.12.7
# via requests
charset-normalizer==3.0.1
# via requests
cheroot==9.0.0
# via cherrypy
cherrypy==18.8.0
# via
# -r requirements/base.txt
# -r requirements/static/ci/pkgtests.in
contextvars==2.4
# via -r requirements/base.txt
distlib==0.3.6
# via virtualenv
distro==1.8.0
# via
# -r requirements/base.txt
# pytest-skip-markers
docker==6.0.1
# via pytest-salt-factories
exceptiongroup==1.1.0
# via pytest
filelock==3.9.0
# via virtualenv
flaky==3.7.0
# via -r requirements/pytest.txt
idna==3.4
# via requests
immutables==0.19
# via contextvars
importlib-resources==5.10.2
# via jaraco.text
inflect==6.0.2
# via jaraco.text
iniconfig==2.0.0
# via pytest
jaraco.classes==3.2.3
# via jaraco.collections
jaraco.collections==3.8.0
# via cherrypy
jaraco.context==4.2.0
# via jaraco.text
jaraco.functools==3.5.2
# via
# cheroot
# jaraco.text
jaraco.text==3.11.0
# via jaraco.collections
jedi==0.18.2
# via pudb
jinja2==3.1.2
# via -r requirements/base.txt
jmespath==1.0.1
# via -r requirements/base.txt
looseversion==1.0.3
# via -r requirements/base.txt
markupsafe==2.1.1
# via
# -r requirements/base.txt
# jinja2
# werkzeug
mock==5.0.1
# via -r requirements/pytest.txt
more-itertools==9.0.0
# via
# cheroot
# cherrypy
# jaraco.classes
# jaraco.functools
# jaraco.text
msgpack==1.0.4
# via
# -r requirements/base.txt
# pytest-salt-factories
packaging==23.0
# via
# -r requirements/base.txt
# docker
# pudb
# pytest
parso==0.8.3
# via jedi
platformdirs==2.6.2
# via virtualenv
pluggy==1.0.0
# via pytest
portend==3.1.0
# via cherrypy
psutil==5.9.4
# via
# -r requirements/base.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
pudb==2022.1.3
# via pytest-pudb
pycryptodomex==3.16.0
# via -r requirements/crypto.txt
pydantic==1.10.4
# via inflect
pygments==2.14.0
# via pudb
pytest-custom-exit-code==0.3.0
# via -r requirements/pytest.txt
pytest-helpers-namespace==2021.12.29
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
pytest-httpserver==1.0.6
# via -r requirements/pytest.txt
pytest-pudb==0.7.0
# via -r requirements/static/ci/pkgtests.in
pytest-salt-factories[docker]==1.0.0rc23 ; sys_platform != "win32"
# via -r requirements/pytest.txt
pytest-shell-utilities==1.7.0
# via pytest-salt-factories
pytest-skip-markers==1.4.0
# via
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
pytest-subtests==0.9.0
# via -r requirements/pytest.txt
pytest-system-statistics==1.0.2
# via pytest-salt-factories
pytest-tempdir==2019.10.12
# via
# -r requirements/pytest.txt
# pytest-salt-factories
pytest-timeout==2.1.0
# via -r requirements/pytest.txt
pytest==7.2.1 ; python_version > "3.6"
# via
# -r requirements/pytest.txt
# pytest-custom-exit-code
# pytest-helpers-namespace
# pytest-pudb
# pytest-salt-factories
# pytest-shell-utilities
# pytest-skip-markers
# pytest-subtests
# pytest-system-statistics
# pytest-tempdir
# pytest-timeout
pytz==2022.7.1
# via tempora
pyyaml==6.0
# via
# -r requirements/base.txt
# pytest-salt-factories
pyzmq==25.0.0 ; python_version < "3.9"
# via
# -r requirements/zeromq.txt
# pytest-salt-factories
requests==2.28.2
# via
# -r requirements/base.txt
# docker
six==1.16.0
# via cheroot
tempora==5.2.0
# via portend
tomli==2.0.1
# via pytest
typing-extensions==4.4.0
# via
# pydantic
# pytest-shell-utilities
# pytest-system-statistics
urllib3==1.26.14
# via
# docker
# requests
urwid-readline==0.13
# via pudb
urwid==2.1.2
# via
# pudb
# urwid-readline
virtualenv==20.17.1
# via pytest-salt-factories
websocket-client==1.4.2
# via docker
werkzeug==2.2.2
# via pytest-httpserver
zc.lockfile==2.0
# via cherrypy
zipp==3.11.0
# via importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -0,0 +1,204 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=requirements/static/ci/py3.9/pkgtests.txt requirements/base.txt requirements/pytest.txt requirements/static/ci/pkgtests.in requirements/zeromq.txt
#
attrs==22.2.0
# via
# pytest
# pytest-salt-factories
# pytest-shell-utilities
# pytest-skip-markers
# pytest-system-statistics
autocommand==2.2.2
# via jaraco.text
certifi==2022.12.7
# via requests
charset-normalizer==3.0.1
# via requests
cheroot==9.0.0
# via cherrypy
cherrypy==18.8.0
# via
# -r requirements/base.txt
# -r requirements/static/ci/pkgtests.in
contextvars==2.4
# via -r requirements/base.txt
distlib==0.3.6
# via virtualenv
distro==1.8.0
# via
# -r requirements/base.txt
# pytest-skip-markers
docker==6.0.1
# via pytest-salt-factories
exceptiongroup==1.1.0
# via pytest
filelock==3.9.0
# via virtualenv
flaky==3.7.0
# via -r requirements/pytest.txt
idna==3.4
# via requests
immutables==0.19
# via contextvars
inflect==6.0.2
# via jaraco.text
iniconfig==2.0.0
# via pytest
jaraco.classes==3.2.3
# via jaraco.collections
jaraco.collections==3.8.0
# via cherrypy
jaraco.context==4.2.0
# via jaraco.text
jaraco.functools==3.5.2
# via
# cheroot
# jaraco.text
jaraco.text==3.11.0
# via jaraco.collections
jedi==0.18.2
# via pudb
jinja2==3.1.2
# via -r requirements/base.txt
jmespath==1.0.1
# via -r requirements/base.txt
looseversion==1.0.3
# via -r requirements/base.txt
markupsafe==2.1.1
# via
# -r requirements/base.txt
# jinja2
# werkzeug
mock==5.0.1
# via -r requirements/pytest.txt
more-itertools==9.0.0
# via
# cheroot
# cherrypy
# jaraco.classes
# jaraco.functools
# jaraco.text
msgpack==1.0.4
# via
# -r requirements/base.txt
# pytest-salt-factories
packaging==23.0
# via
# -r requirements/base.txt
# docker
# pudb
# pytest
parso==0.8.3
# via jedi
platformdirs==2.6.2
# via virtualenv
pluggy==1.0.0
# via pytest
portend==3.1.0
# via cherrypy
psutil==5.9.4
# via
# -r requirements/base.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
pudb==2022.1.3
# via pytest-pudb
pycryptodomex==3.16.0
# via -r requirements/crypto.txt
pydantic==1.10.4
# via inflect
pygments==2.14.0
# via pudb
pytest-custom-exit-code==0.3.0
# via -r requirements/pytest.txt
pytest-helpers-namespace==2021.12.29
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
pytest-httpserver==1.0.6
# via -r requirements/pytest.txt
pytest-pudb==0.7.0
# via -r requirements/static/ci/pkgtests.in
pytest-salt-factories[docker]==1.0.0rc23 ; sys_platform != "win32"
# via -r requirements/pytest.txt
pytest-shell-utilities==1.7.0
# via pytest-salt-factories
pytest-skip-markers==1.4.0
# via
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
pytest-subtests==0.9.0
# via -r requirements/pytest.txt
pytest-system-statistics==1.0.2
# via pytest-salt-factories
pytest-tempdir==2019.10.12
# via
# -r requirements/pytest.txt
# pytest-salt-factories
pytest-timeout==2.1.0
# via -r requirements/pytest.txt
pytest==7.2.1 ; python_version > "3.6"
# via
# -r requirements/pytest.txt
# pytest-custom-exit-code
# pytest-helpers-namespace
# pytest-pudb
# pytest-salt-factories
# pytest-shell-utilities
# pytest-skip-markers
# pytest-subtests
# pytest-system-statistics
# pytest-tempdir
# pytest-timeout
pytz==2022.7.1
# via tempora
pyyaml==6.0
# via
# -r requirements/base.txt
# pytest-salt-factories
pyzmq==25.0.0 ; python_version >= "3.9"
# via
# -r requirements/zeromq.txt
# pytest-salt-factories
requests==2.28.2
# via
# -r requirements/base.txt
# docker
six==1.16.0
# via cheroot
tempora==5.2.0
# via portend
tomli==2.0.1
# via pytest
typing-extensions==4.4.0
# via
# pydantic
# pytest-shell-utilities
# pytest-system-statistics
urllib3==1.26.14
# via
# docker
# requests
urwid-readline==0.13
# via pudb
urwid==2.1.2
# via
# pudb
# urwid-readline
virtualenv==20.17.1
# via pytest-salt-factories
websocket-client==1.4.2
# via docker
werkzeug==2.2.2
# via pytest-httpserver
zc.lockfile==2.0
# via cherrypy
# The following packages are considered to be unsafe in a requirements file:
# setuptools