summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Schiffer <pschiffe@redhat.com>2013-07-29 15:51:51 +0200
committerPeter Schiffer <pschiffe@redhat.com>2013-07-29 15:51:51 +0200
commit256ef2af4d28a6836aaca8b9fa57b6924130eee4 (patch)
treea41d0a886701df64389b2ed7ffb7258ea040f581
parent9fdfb5cd97fdb803246bc5fa63b962faae4c7b47 (diff)
parentf58b98ddbf805825b8701fdfbfa9d89ce504ed18 (diff)
downloadopenlmi-providers-256ef2af4d28a6836aaca8b9fa57b6924130eee4.tar.gz
openlmi-providers-256ef2af4d28a6836aaca8b9fa57b6924130eee4.tar.xz
openlmi-providers-256ef2af4d28a6836aaca8b9fa57b6924130eee4.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/openlmi-providers
-rwxr-xr-xsrc/software/test/test_software_identity.py38
-rwxr-xr-xsrc/software/test/test_software_identity_file_check.py6
-rw-r--r--src/software/test/util.py2
3 files changed, 6 insertions, 40 deletions
diff --git a/src/software/test/test_software_identity.py b/src/software/test/test_software_identity.py
index 47eee28..ea60afe 100755
--- a/src/software/test/test_software_identity.py
+++ b/src/software/test/test_software_identity.py
@@ -106,44 +106,6 @@ class TestSoftwareIdentity(base.SoftwareBaseTestCase): #pylint: disable=R0904
InstanceName=op_no_epoch, LocalOnly=False)
self.assertIn(inst.path, (objpath, op_no_epoch))
- @base.mark_tedious
- def test_enum_instance_names_safe(self):
- """
- Tests EnumInstanceNames call on installed packages.
- """
- inames = self.conn.EnumerateInstanceNames(ClassName=self.CLASS_NAME)
- self.assertGreater(len(inames), 0)
- for iname in inames:
- self.assertIsInstance(iname, pywbem.CIMInstanceName)
- self.assertEqual(iname.namespace, 'root/cimv2')
- self.assertEqual(sorted(iname.keys()), sorted(self.KEYS))
- nevra_set = set(i["InstanceID"] for i in inames)
- for pkg in self.safe_pkgs:
- self.assertIn('LMI:LMI_SoftwareIdentity:'+pkg.get_nevra(with_epoch="ALWAYS"),
- nevra_set)
-
-# @base.mark_tedious
-# def test_enum_instances(self):
-# """
-# Tests EnumInstances call on installed packages.
-# """
-# insts = self.conn.EnumerateInstances(ClassName=self.CLASS_NAME)
-# self.assertGreater(len(insts), 0)
-# for inst in insts:
-# self.assertIsInstance(inst, pywbem.CIMInstance)
-# self.assertEqual(inst.namespace, 'root/cimv2')
-# self.assertEqual(sorted(inst.keys()), sorted(self.KEYS))
-# self.assertEqual(inst["InstanceID"], inst.path["InstanceID"])
-# nevra_set = set()
-# name_set = set()
-# for inst in insts:
-# nevra_set.add(inst["InstanceID"])
-# name_set.add(inst["Name"])
-# for pkg in self.safe_pkgs:
-# self.assertIn("LMI:LMI_SoftwareIdentity:"+pkg.get_nevra(with_epoch="ALWAYS"),
-# nevra_set)
-# self.assertIn(pkg.name, name_set)
-
def suite():
"""For unittest loaders."""
return unittest.TestLoader().loadTestsFromTestCase(
diff --git a/src/software/test/test_software_identity_file_check.py b/src/software/test/test_software_identity_file_check.py
index 49cd97d..3242113 100755
--- a/src/software/test/test_software_identity_file_check.py
+++ b/src/software/test/test_software_identity_file_check.py
@@ -31,6 +31,7 @@ import unittest
import base
import rpmcache
+import util
RE_CHECKSUM = re.compile(r'^([0-9a-fA-F]+)\s+.*')
@@ -396,8 +397,11 @@ class TestSoftwareIdentityFileCheck(
Tests Invoke method invocation.
"""
for pkg in self.dangerous_pkgs:
+ if ( rpmcache.is_pkg_installed(pkg.name)
+ and not util.verify_pkg(pkg.name)):
+ rpmcache.remove_pkg(pkg.name)
if not rpmcache.is_pkg_installed(pkg.name):
- rpmcache.install_pkg(pkg.name)
+ rpmcache.install_pkg(pkg)
for filepath in self.pkgdb_files[pkg.name]:
objpath = self.make_op(pkg, filepath)
diff --git a/src/software/test/util.py b/src/software/test/util.py
index e72add1..6de8169 100644
--- a/src/software/test/util.py
+++ b/src/software/test/util.py
@@ -24,7 +24,7 @@ Common test utilities.
"""
import re
-from subprocess import check_output
+from subprocess import call, check_output
RE_NEVRA = re.compile(
r'^(?P<name>.+)-(?P<evra>(?P<epoch>\d+):(?P<ver>[^-]+)'