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, OutputInterface)
QAInterface constructor.
source code
bool
test_depends_linking(self, idpackages, dbconn, repo=None)
Scan for broken shared objects linking for the given idpackages on the given entropy.db.EntropyRepository based instance.
source code
bool
test_missing_dependencies(self, idpackages, dbconn, ask=True, self_check=False, repo=None, black_list=None, black_list_adder=None)
Scan missing dependencies for the given idpackages on the given entropy.db.EntropyRepository "dbconn" instance.
source code
tuple
test_shared_objects(self, dbconn, broken_symbols=False, task_bombing_func=None, self_dir_check=True)
Scan system looking for broken shared object ELF library dependencies.
source code
list or set
get_deep_dependency_list(self, dbconn, idpackage, atoms=False)
Service method which returns a complete, expanded list of dependencies for the given idpackage on the given entropy.db.EntropyRepository "dbconn" instance.
source code
bool
entropy_package_checks(self, package_path)
Main method for the execution of QA tests on physical Entropy package files.
source code
Method Details

__init__(self, OutputInterface)
(Constructor)

source code 

QAInterface constructor.

Parameters:
  • OutputInterface (TextInterface class or subclass instance) - class instance used to print output. Even if not enforced at the moment, it should be a subclass of entropy.qa.TextInterface exposing the updateProgress() method with proper signature.

test_depends_linking(self, idpackages, dbconn, repo=None)

source code 

Scan for broken shared objects linking for the given idpackages on the given entropy.db.EntropyRepository based instance. 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:
  • idpackages (list) - list of valid idpackages (int) on the given dbconn argument passed
  • dbconn (entropy.db.EntropyRepository) - entropy.db.EntropyRepository instance containing the given idpackages list
  • repo (string) - repository identifer from which dbconn and idpackages arguments belong. Note: at the moment it's only used for output purposes.
Returns: bool
True if any breakage is found, otherwise False

test_missing_dependencies(self, idpackages, dbconn, ask=True, self_check=False, repo=None, black_list=None, black_list_adder=None)

source code 

Scan missing dependencies for the given idpackages on the given entropy.db.EntropyRepository "dbconn" instance. In addition, this method will allow the user through OutputInterface to interactively add (if ask == True) missing dependencies or blacklist them.

Parameters:
  • idpackages (list) - list of valid idpackages (int) on the given dbconn argument passed
  • dbconn (entropy.db.EntropyRepository) - entropy.db.EntropyRepository instance containing the given idpackages list
  • ask (bool) - request user interaction when finding missing dependencies
  • self_check (bool) - also introspect inside the complaining package (to avoid reporting false positives when circular dependencies occur)
  • repo (string) - repository identifier of the given entropy.db.EntropyRepository dbconn instance. It is used to correctly place blacklisted items.
  • black_list (set) - list of dependencies already blacklisted.
  • black_list_adder (callable) - callable function that accepts two arguments: (1) list (set) of new dependencies to blacklist for the given (2) repository identifier.
Returns: bool
tainting status, if any dependency has been added

test_shared_objects(self, dbconn, broken_symbols=False, task_bombing_func=None, self_dir_check=True)

source code 

Scan system looking for broken shared object ELF library dependencies.

Parameters:
  • dbconn (entropy.db.EntropyRepository instance) - entropy.db.EntropyRepository instance which contains information on packages installed on the system (for example: entropy.client.interfaces.Client.clientDbconn ).
  • 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 packagesMatched, plain_brokenexecs, 0) - callable that will be called on every scan iteration to allow external routines to cleanly stop the execution of this function.
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, dbconn, idpackage, atoms=False)

source code 

Service method which returns a complete, expanded list of dependencies for the given idpackage on the given entropy.db.EntropyRepository "dbconn" instance.

Parameters:
  • dbconn (entropy.db.EntropyRepository instance) - entropy.db.EntropyRepository instance which contains the given idpackage item.
  • idpackage (int) - Entropy database package key
  • atoms (bool) - !! return type modifier !! , make method returning a list of atom strings instead of list of db match tuples.
Returns: list or set
list of dependencies in form of matching tuple list ( [(idpackage, repoid,) ... ] ) or plain dependency list (if atom == True -- set([atom_string1, atom_string2, atom_string3])

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