Merge pull request #31171 from Ch3LL/megan-20158

added logic to check for installed package
This commit is contained in:
Mike Place 2016-02-12 15:10:21 -07:00
commit c5e5af827c
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,3 @@
nova_packages:
pkg.latest:
- name: libguestfs-tools
- name: bash-completion

View File

@ -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 installed 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)