mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Update test from #58883 to work with new work
This commit is contained in:
parent
3059796b48
commit
d3788da120
1 changed files with 11 additions and 2 deletions
|
@ -632,7 +632,9 @@ class PkgTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
@pytest.mark.slow_test
|
||||
def test_pkg_017_installed_held_equals_false(self, grains=None):
|
||||
"""
|
||||
Tests that a package installed with held set to False
|
||||
Tests that a package is installed when hold is explicitly False.
|
||||
|
||||
See https://github.com/saltstack/salt/issues/58801.
|
||||
"""
|
||||
versionlock_pkg = None
|
||||
if grains["os_family"] == "RedHat":
|
||||
|
@ -680,7 +682,14 @@ class PkgTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
# On Centos 7 package is already installed, no change happened
|
||||
if target_ret[tag].get("changes"):
|
||||
self.assertIn(target, target_ret[tag]["changes"])
|
||||
self.assertIn("held", target_ret[tag]["comment"])
|
||||
if grains["os_family"] == "Suse":
|
||||
self.assertIn("packages were installed", target_ret[tag]["comment"])
|
||||
else:
|
||||
# The "held" string is part of a longer comment that may look
|
||||
# like:
|
||||
#
|
||||
# Package units is not being held.
|
||||
self.assertIn("held", target_ret[tag]["comment"])
|
||||
finally:
|
||||
# Clean up, unhold package and remove
|
||||
ret = self.run_state("pkg.removed", name=target)
|
||||
|
|
Loading…
Add table
Reference in a new issue