mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Make sure system installed packages are up-to-date before running tests.
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
464c4e5eb2
commit
28d2987b63
2 changed files with 16 additions and 0 deletions
|
@ -44,6 +44,21 @@ def grains(sminion):
|
|||
return sminion.opts["grains"].copy()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module", autouse=True)
|
||||
def _system_up_to_date(
|
||||
grains,
|
||||
shell,
|
||||
):
|
||||
if grains["os_family"] == "Debian":
|
||||
ret = shell.run("apt", "update")
|
||||
assert ret.returncode == 0
|
||||
ret = shell.run("apt", "upgrade", "-y")
|
||||
assert ret.returncode == 0
|
||||
elif grains["os_family"] == "Redhat":
|
||||
ret = shell.run("yum", "update", "-y")
|
||||
assert ret.returncode == 0
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
"""
|
||||
register argparse-style options and ini-style config values.
|
||||
|
|
|
@ -19,6 +19,7 @@ def test_salt_upgrade(salt_call_cli, salt_minion, install_salt):
|
|||
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")
|
||||
|
|
Loading…
Add table
Reference in a new issue