mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Updated to remove RHEL 5 support and single RHEL 6 instance too
This commit is contained in:
parent
2478e75dca
commit
98422f3848
2 changed files with 14 additions and 46 deletions
|
@ -75,10 +75,7 @@ def PKG_32_TARGETS(grains):
|
|||
_PKG_32_TARGETS = []
|
||||
if grains["os_family"] == "RedHat":
|
||||
if grains["os"] == "CentOS":
|
||||
if grains["osmajorrelease"] == 5:
|
||||
_PKG_32_TARGETS = ["xz-devel.i386"]
|
||||
else:
|
||||
_PKG_32_TARGETS.append("xz-devel.i686")
|
||||
_PKG_32_TARGETS.append("xz-devel.i686")
|
||||
if not _PKG_32_TARGETS:
|
||||
pytest.skip("No 32 bit packages have been specified for testing")
|
||||
return _PKG_32_TARGETS
|
||||
|
@ -88,11 +85,7 @@ def PKG_32_TARGETS(grains):
|
|||
def PKG_DOT_TARGETS(grains):
|
||||
_PKG_DOT_TARGETS = []
|
||||
if grains["os_family"] == "RedHat":
|
||||
if grains["osmajorrelease"] == 5:
|
||||
_PKG_DOT_TARGETS = ["python-migrate0.5"]
|
||||
elif grains["osmajorrelease"] == 6:
|
||||
_PKG_DOT_TARGETS = ["tomcat6-el-2.1-api"]
|
||||
elif grains["osmajorrelease"] == 7:
|
||||
if grains["osmajorrelease"] == 7:
|
||||
_PKG_DOT_TARGETS = ["tomcat-el-2.2-api"]
|
||||
elif grains["osmajorrelease"] == 8:
|
||||
_PKG_DOT_TARGETS = ["aspnetcore-runtime-6.0"]
|
||||
|
@ -455,9 +448,10 @@ def test_pkg_011_latest_only_upgrade(
|
|||
new_version = modules.pkg.version(target, use_context=False)
|
||||
assert new_version == updates[target]
|
||||
ret = states.pkg.latest(name=target, refresh=False, only_upgrade=True)
|
||||
assert ret.raw["pkg_|-{0}_|-{0}_|-latest".format(target)][
|
||||
"comment"
|
||||
] == "Package {} is already up-to-date".format(target)
|
||||
assert (
|
||||
ret.raw["pkg_|-{0}_|-{0}_|-latest".format(target)]["comment"]
|
||||
== f"Package {target} is already up-to-date"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("WILDCARDS_SUPPORTED")
|
||||
|
@ -605,7 +599,7 @@ def test_pkg_015_installed_held(grains, modules, states, PKG_TARGETS):
|
|||
except AssertionError as exc:
|
||||
log.debug("Versionlock package not found:\n%s", exc)
|
||||
else:
|
||||
pytest.fail("Could not install versionlock package from {}".format(pkgs))
|
||||
pytest.fail(f"Could not install versionlock package from {pkgs}")
|
||||
|
||||
target = PKG_TARGETS[0]
|
||||
|
||||
|
@ -624,7 +618,7 @@ def test_pkg_015_installed_held(grains, modules, states, PKG_TARGETS):
|
|||
)
|
||||
|
||||
if versionlock_pkg and "-versionlock is not installed" in str(ret):
|
||||
pytest.skip("{} `{}` is installed".format(ret, versionlock_pkg))
|
||||
pytest.skip(f"{ret} `{versionlock_pkg}` is installed")
|
||||
|
||||
# changes from pkg.hold for Red Hat family are different
|
||||
target_changes = {}
|
||||
|
@ -724,7 +718,7 @@ def test_pkg_017_installed_held_equals_false(grains, modules, states, PKG_TARGET
|
|||
except AssertionError as exc:
|
||||
log.debug("Versionlock package not found:\n%s", exc)
|
||||
else:
|
||||
pytest.fail("Could not install versionlock package from {}".format(pkgs))
|
||||
pytest.fail(f"Could not install versionlock package from {pkgs}")
|
||||
|
||||
target = PKG_TARGETS[0]
|
||||
|
||||
|
@ -737,7 +731,7 @@ def test_pkg_017_installed_held_equals_false(grains, modules, states, PKG_TARGET
|
|||
assert target_ret.result is True
|
||||
|
||||
if versionlock_pkg and "-versionlock is not installed" in str(target_ret):
|
||||
pytest.skip("{} `{}` is installed".format(target_ret, versionlock_pkg))
|
||||
pytest.skip(f"{target_ret} `{versionlock_pkg}` is installed")
|
||||
|
||||
try:
|
||||
tag = "pkg_|-{0}_|-{0}_|-installed".format(target)
|
||||
|
@ -789,7 +783,7 @@ def test_pkg_cap_001_installed(PKG_CAP_TARGETS, modules, states):
|
|||
test=True,
|
||||
)
|
||||
assert (
|
||||
"The following packages would be installed/updated: {}".format(realpkg)
|
||||
f"The following packages would be installed/updated: {realpkg}"
|
||||
in ret.comment
|
||||
)
|
||||
ret = states.pkg.installed(
|
||||
|
@ -887,7 +881,7 @@ def test_pkg_cap_003_installed_multipkg_with_version(
|
|||
test=True,
|
||||
)
|
||||
assert "packages would be installed/updated" in ret.comment
|
||||
assert "{}={}".format(realpkg, realver) in ret.comment
|
||||
assert f"{realpkg}={realver}" in ret.comment
|
||||
|
||||
ret = states.pkg.installed(
|
||||
name="test_pkg_cap_003_installed_multipkg_with_version-install-capability",
|
||||
|
@ -931,7 +925,7 @@ def test_pkg_cap_004_latest(PKG_CAP_TARGETS, modules, states):
|
|||
test=True,
|
||||
)
|
||||
assert (
|
||||
"The following packages would be installed/upgraded: {}".format(realpkg)
|
||||
f"The following packages would be installed/upgraded: {realpkg}"
|
||||
in ret.comment
|
||||
)
|
||||
ret = states.pkg.latest(name=target, refresh=False, resolve_capabilities=True)
|
||||
|
@ -971,9 +965,7 @@ def test_pkg_cap_005_downloaded(PKG_CAP_TARGETS, modules, states):
|
|||
resolve_capabilities=True,
|
||||
test=True,
|
||||
)
|
||||
assert (
|
||||
"The following packages would be downloaded: {}".format(realpkg) in ret.comment
|
||||
)
|
||||
assert f"The following packages would be downloaded: {realpkg}" in ret.comment
|
||||
|
||||
ret = states.pkg.downloaded(name=target, refresh=False, resolve_capabilities=True)
|
||||
assert ret.result is True
|
||||
|
|
|
@ -185,14 +185,6 @@ def test_adduser():
|
|||
Tests if specified user gets added in the group.
|
||||
"""
|
||||
os_version_list = [
|
||||
{
|
||||
"grains": {
|
||||
"kernel": "Linux",
|
||||
"os_family": "RedHat",
|
||||
"osmajorrelease": "5",
|
||||
},
|
||||
"cmd": ["/bin/gpasswd", "-a", "root", "test"],
|
||||
},
|
||||
{
|
||||
"grains": {
|
||||
"kernel": "Linux",
|
||||
|
@ -242,14 +234,6 @@ def test_deluser():
|
|||
Tests if specified user gets deleted from the group.
|
||||
"""
|
||||
os_version_list = [
|
||||
{
|
||||
"grains": {
|
||||
"kernel": "Linux",
|
||||
"os_family": "RedHat",
|
||||
"osmajorrelease": "5",
|
||||
},
|
||||
"cmd": ["/bin/gpasswd", "-d", "root", "test"],
|
||||
},
|
||||
{
|
||||
"grains": {
|
||||
"kernel": "Linux",
|
||||
|
@ -325,14 +309,6 @@ def test_members():
|
|||
Tests if members of the group, get replaced with a provided list.
|
||||
"""
|
||||
os_version_list = [
|
||||
{
|
||||
"grains": {
|
||||
"kernel": "Linux",
|
||||
"os_family": "RedHat",
|
||||
"osmajorrelease": "5",
|
||||
},
|
||||
"cmd": ["/bin/gpasswd", "-M", "foo", "test"],
|
||||
},
|
||||
{
|
||||
"grains": {
|
||||
"kernel": "Linux",
|
||||
|
|
Loading…
Add table
Reference in a new issue