Add downgrade option for the install salt fixture

This commit is contained in:
MKLeb 2023-07-18 16:49:39 -04:00 committed by Pedro Algarvio
parent b167d2aa2a
commit afb229431c
2 changed files with 8 additions and 0 deletions

View file

@ -87,6 +87,12 @@ def pytest_addoption(parser):
action="store_true",
help="Install previous version and then upgrade then run tests",
)
test_selection_group.addoption(
"--downgrade",
default=False,
action="store_true",
help="Install current version and then downgrade to the previous version and run tests",
)
test_selection_group.addoption(
"--no-install",
default=False,
@ -168,6 +174,7 @@ def install_salt(request, salt_factories_root_dir):
conf_dir=salt_factories_root_dir / "etc" / "salt",
system_service=request.config.getoption("--system-service"),
upgrade=request.config.getoption("--upgrade"),
downgrade=request.config.getoption("--downgrade"),
no_uninstall=request.config.getoption("--no-uninstall"),
no_install=request.config.getoption("--no-install"),
classic=request.config.getoption("--classic"),

View file

@ -74,6 +74,7 @@ class SaltPkgInstall:
# The artifact is an installer (exe, msi, pkg, rpm, deb)
installer_pkg: bool = attr.ib(default=False)
upgrade: bool = attr.ib(default=False)
downgrade: bool = attr.ib(default=False)
# install salt or not. This allows someone
# to test a currently installed version of salt
no_install: bool = attr.ib(default=False)