Package entropy :: Module qa :: Class QAInterface

Class QAInterface

source code


Entropy QA interface. This class contains all the Entropy QA routines used by Entropy Server and Entropy Client.

An instance of QAInterface can be easily retrieved from entropy.client.interfaces.Client or entropy.server.interfaces.Server through an exposed QA() method. This is anyway a stand-alone class.


To Do: remove non-QA methods

Instance Methods
 
__init__(self)
QAInterface constructor.
source code
 
add_plugin(self, plugin)
Add a QAInterface plugin to the testing list.
source code
bool
test_reverse_dependencies_linking(self, entropy_client, package_matches)
Scan for broken shared objects linking.
source code
dict
test_missing_dependencies(self, entropy_client, package_matches, blacklist=None)
Scan given package matches looking for missing dependencies (checking ELF metadata).
source code
set
test_missing_runtime_libraries(self, entropy_client, package_matches, base_repository_id=None, excluded_libraries=None, silent=False)
Use collected packages ELF metadata (retrieveNeededLibraries(), resolveNeeded()) to look for potentially missing shared libraries.
source code
tuple
test_shared_objects(self, entropy_repository, broken_symbols=False, task_bombing_func=None, self_dir_check=True, dump_results_to_file=False, silent=False)
Scan system looking for broken shared object ELF library dependencies.
source code
 
get_deep_dependency_list(self, entropy_client, package_match, atoms=False, match_repo=None)
Service method which returns a complete, expanded list of dependencies.
source code
bool
entropy_package_checks(self, package_path)
Main method for the execution of QA tests on physical Entropy package files.
source code

Inherited from core.EntropyPluginStore: drop_plugins, get_plugins, has_plugin, remove_plugin

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods

Inherited from output.TextInterface: ask_question, edit_file, input_box, output, set_title

Class Variables

Inherited from output.TextInterface: OUTPUT_LOCK

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

QAInterface constructor.

Overrides: object.__init__

add_plugin(self, plugin)

source code 

Add a QAInterface plugin to the testing list.

Parameters:
  • plugin (QAInterface based instance) - QAInterfacePlugin based instance
Raises:
  • AttributeError - if plugin is not a QAInterfacePlugin instance
Overrides: core.EntropyPluginStore.add_plugin

test_reverse_dependencies_linking(self, entropy_client, package_matches)

source code 

Scan for broken shared objects linking. Note: this only works for packages actually installed on the running system. It is used by Entropy Server during packages injection into database to warn about potentially broken packages.

Parameters:
  • entropy_client (entropy.client.interfaces.client.Client based instance object) - Entropy Client instance
  • package_matches (list) - list of entropy package matches tuples (package id, repo id)
Returns: bool
True if any breakage is found, otherwise False

test_missing_dependencies(self, entropy_client, package_matches, blacklist=None)

source code 

Scan given package matches looking for missing dependencies (checking ELF metadata).

Parameters:
  • entropy_client (entropy.client.interfaces.client.Client based instance object) - Entropy Client instance
  • package_matches (list) - list of entropy package matches tuples (package id, repo id)
  • blacklist (set) - list of dependencies already blacklisted.
Returns: dict
dict of missing dependencies to add, key is package match, value is a dict, with library name + ELF class as key, and potential missing deps as value

test_missing_runtime_libraries(self, entropy_client, package_matches, base_repository_id=None, excluded_libraries=None, silent=False)

source code 

Use collected packages ELF metadata (retrieveNeededLibraries(), resolveNeeded()) to look for potentially missing shared libraries. This is very handy in case of library breakages across multiple server-side repositories. For example: you bump libfoo, which provides new library, the SPM forces you to rebuild foouser, which uses libfoo. You put both into a testing repository but then you only move foouser to the base repository without realizing the potential breakage users could run into. However, since there can be false positives, this routine cannot block you from doing this mistakes. Please note that the base repository is the first listed in server.conf and will always be considered as self-contained, meaning that all the dependencies and sonames must be available within the same. The code first tries to resolve the soname inside the same repository, then falls back to other ones, if any.

Parameters:
  • entropy_client (entropy.client.interfaces.client.Client based instance object) - Entropy Client instance
  • package_matches (list) - list of Entropy package matches
  • base_repository_id (string) - repository identifier supposed to be used as main (or base) repository
  • excluded_libraries (set) - list of libraries that should not be verified (perhaps, libGL.so.1 in Gentoo/Sabayon)
  • silent (bool) - no output is print to stdout
Returns: set
list (set) of tuples of length 2 of missing sonames [(soname, elfclass), ...]

test_shared_objects(self, entropy_repository, broken_symbols=False, task_bombing_func=None, self_dir_check=True, dump_results_to_file=False, silent=False)

source code 

Scan system looking for broken shared object ELF library dependencies.

Parameters:
  • entropy_repository (entropy.db.EntropyRepository instance) - entropy.db.EntropyRepository instance
  • broken_symbols (bool) - enable or disable broken symbols extra check. Symbols which are going to be checked have to be listed into: /etc/entropy/brokensyms.conf (regexp supported).
  • task_bombing_func (callable) - callable that will be called on every scan iteration to allow external routines to cleanly stop the execution of this function.
  • dump_results_to_file (bool) - dump test results to files (printed)
  • silent (bool) - do not print anything to stdout
Returns: tuple
tuple of length 3, composed by (1) a dict of matched packages, (2) a list (set) of broken ELF objects and (3) the execution status (int, 0 means success).

get_deep_dependency_list(self, entropy_client, package_match, atoms=False, match_repo=None)

source code 
Service method which returns a complete, expanded list of dependencies.

NOTE: this method will only return dependencies that are NOT build
    dependencies.

@param entropy_client: Entropy Client instance
@type entropy_client: entropy.client.interfaces.client.Client based
    instance object
@param package_match: Entropy package match (package id, repo id)
@type package_match: tuple
@keyword atoms: !! return type modifier !! , make method returning
    a list of atom strings instead of list of db match tuples.
@type atoms: bool
@keyword match_repo: list of repositories to match, if None,
    all repositories will be used for matching.
@param match_repo: list
@return: list of package matches (of dependencies) or plain dependency
    string list if "atom" is True
@rtype: set

entropy_package_checks(self, package_path)

source code 

Main method for the execution of QA tests on physical Entropy package files.

Parameters:
  • package_path (string) - path to physical Entropy package file path
Returns: bool
True, if all checks passed
Raises: