mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
added logic to check for installed package
This commit is contained in:
parent
7f49fbb70d
commit
a123efd4ef
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,3 @@
|
|||
nova_packages:
|
||||
pkg.latest:
|
||||
- name: libguestfs-tools
|
||||
- name: bash-completion
|
||||
|
|
|
@ -46,7 +46,7 @@ _PKG_TARGETS_DOT = {
|
|||
}
|
||||
|
||||
|
||||
@requires_salt_modules('pkg.version', 'pkg.latest_version')
|
||||
@requires_salt_modules('pkg.version', 'pkg.latest_version', 'pkg.info_installed')
|
||||
class PkgTest(integration.ModuleCase,
|
||||
integration.SaltReturnAssertsMixIn):
|
||||
'''
|
||||
|
@ -293,9 +293,17 @@ class PkgTest(integration.ModuleCase,
|
|||
|
||||
This is a destructive test as it installs a package
|
||||
'''
|
||||
package = 'bash-completion'
|
||||
pkgquery= 'version'
|
||||
|
||||
ret = self.run_function('state.sls', mods='pkg_latest_epoch')
|
||||
self.assertSaltTrueReturn(ret)
|
||||
|
||||
#After the pkg has been instlaled by the sls file above we
|
||||
#need to verify that it actually installed
|
||||
ret = self.run_function('pkg.info_installed', [package])
|
||||
self.assertTrue(pkgquery in str(ret))
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
run_tests(PkgTest)
|
||||
|
|
Loading…
Add table
Reference in a new issue