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.

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.LocalRepository based instance.
source code
bool
scan_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.LocalRepository "dbconn" instance.
source code
 
libraries_test(self, dbconn, broken_symbols=False, task_bombing_func=None) source code
string
resolve_dynamic_library(self, library, requiring_executable)
Resolve given library name (as contained into ELF metadata) to a library path.
source code
tuple
get_missing_rdepends(self, dbconn, idpackage, self_check=False)
Service method able to determine whether dependencies are missing on the given idpackage (belonging to the given entropy.db.LocalRepository "dbconn" argument) using shared objects linking information between packages.
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.LocalRepository "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.LocalRepository 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.LocalRepository) - entropy.db.LocalRepository 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

scan_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.LocalRepository "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.LocalRepository) - entropy.db.LocalRepository 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.LocalRepository 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

resolve_dynamic_library(self, library, requiring_executable)

source code 

Resolve given library name (as contained into ELF metadata) to a library path.

Parameters:
  • library (string) - library name (as contained into ELF metadata)
  • requiring_executable (string) - path to ELF object that contains the given library name
Returns: string
resolved library path

get_missing_rdepends(self, dbconn, idpackage, self_check=False)

source code 

Service method able to determine whether dependencies are missing on the given idpackage (belonging to the given entropy.db.LocalRepository "dbconn" argument) using shared objects linking information between packages.

Parameters:
  • dbconn (entropy.db.LocalRepository instance) - entropy.db.LocalRepository instance from which idpackage argument belongs
  • idpackage (int) - entropy.db.LocalRepository package identifier
  • self_check (bool) - also check inside the given package (idpackage) itself
Returns: tuple
tuple of length 2, composed by a dictionary with the following structure: {('KEY', 'SLOT': set([list of missing deps for the given key])} and a "plain" list (set) of missing dependencies set([list of missing dependencies])

To Do: swap the first two arguments?

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.LocalRepository "dbconn" instance.

Parameters:
  • dbconn (entropy.db.LocalRepository instance) - entropy.db.LocalRepository 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