diff options
-rw-r--r-- | src/software/test/rpmcache.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/software/test/rpmcache.py b/src/software/test/rpmcache.py index c6205d2..bce5778 100644 --- a/src/software/test/rpmcache.py +++ b/src/software/test/rpmcache.py @@ -88,6 +88,17 @@ class MissingRPM(InvalidTestCache): InvalidTestCache.__init__(self, "Missing package '%s' in test cache!"%pkg_name) +def _is_sane_package(pkg_name): + """ + :returns: Whether the given package can be included among tested ones. + :rtype: boolean + """ + if pkg_name.startswith('openlmi'): + return False + if pkg_name in ('sblim-sfcb', 'tog-pegasus', 'sblim-cmpi-base'): + return False + return True + def _match_nevr(match): """ @param match is a regexp match object with parsed rpm package @@ -143,7 +154,8 @@ def _filter_duplicates(installed, avail_str): or ( ( not prev_match or prev_match.group('name') in [m.group('name') for m in cur_package_matches]) - and match.group('arch') not in ('noarch', system_arch))): + and match.group('arch') not in ('noarch', system_arch)) + or not _is_sane_package(match.group('name'))): continue if prev_match and prev_match.group('name') != match.group('name'): if ( len(cur_package_matches) > 1 @@ -440,18 +452,13 @@ def make_dangerous_list(installed, repolist=None): """ This makes a list of instances of Package for dangerous tests. """ - #print "Getting all available packages" avail_str = util.run_yum('list', 'available', '--showduplicates', repolist=repolist) # list of lists of packages with the same name, longer than 2 - #print "Finding duplicates" dups_list = _filter_duplicates(installed, avail_str) - #print "Selecting only those (from %d) with installed dependencies" % \ - #len(dups_list) selected = _check_pkg_dependencies(installed, dups_list, number_of_packages=MAX_PKG_DB_SIZE*5, repolist=repolist) - #print "Selecting the smallest ones" return _sorted_db_by_size(selected, repolist=repolist) def make_safe_list(installed, exclude=None): @@ -469,7 +476,7 @@ def make_safe_list(installed, exclude=None): while len(res) < MAX_PKG_DB_SIZE and i < len(base): name = base[i] i += 1 - if name in exclude: + if name in exclude or not _is_sane_package(name): continue cmd = [ "rpm", "-q", "--qf", "%{EPOCH}:%{NVRA}\n", name ] envra = check_output(cmd).splitlines()[0] |