benchbuild.projects.gentoo.portage_gen module

Generic experiment to test portage packages within gentoo chroot.

class benchbuild.projects.gentoo.portage_gen.FuncClass(name, domain, _container)[source]

Bases: object

Finds out the current version number of a gentoo package.

The package name is created by combining the domain and the name. Then uchroot is used to switch into a gentoo shell where the ‘emerge’ command is used to recieve the version number. The function then parses the version number back into the file.

  • Name – Name of the project.
  • Domain – Categorie of the package.
benchbuild.projects.gentoo.portage_gen.PortageFactory(name, NAME, DOMAIN, BaseClass=<class 'benchbuild.projects.gentoo.autoportage.AutoPortage'>)[source]

Create a new dynamic portage project.

Auto-Generated projects can only be used for compilie-time experiments, because there simply is no run-time test defined for it. Therefore, we implement the run symbol as a noop (with minor logging).

This way we avoid the default implementation for run() that all projects inherit.

  • name – Name of the dynamic class.
  • NAME – NAME property of the dynamic class.
  • DOMAIN – DOMAIN property of the dynamic class.
  • BaseClass – Base class to use for the dynamic class.

A new class with NAME,DOMAIN properties set, unable to perform run-time tests.


>>> from benchbuild.projects.gentoo.portage_gen import PortageFactory
>>> from benchbuild.experiments.empty import Empty
>>> c = PortageFactory("test", "NAME", "DOMAIN")
>>> c
<class '__main__.test'>
>>> i = c(Empty())
>>> i.NAME
>>> i.DOMAIN