avocado_i2n

avocado_i2n package

Subpackages

avocado_i2n.cartgraph package

Submodules
avocado_i2n.cartgraph.graph module
avocado_i2n.cartgraph.node module
avocado_i2n.cartgraph.object module
SUMMARY

Utility for the main test suite substructures like test objects.

Copyright: Intra2net AG

INTERFACE
class avocado_i2n.cartgraph.object.TestObject(suffix, config)[source]

Bases: object

A wrapper for a test object used in one or more test nodes.

params

Parameters (cache) property.

final_restr

Final restriction to make the object parsing variant unique.

long_suffix

Sufficiently unique suffix to identify a variantless test object.

id

Unique ID to identify a test object.

__init__(suffix, config)[source]

Construct a test object (vm) for any test nodes (tests).

Parameters:
  • name (str) – name of the test object
  • config (param.Reparsable) – variant configuration for the test object
__repr__()[source]

Return repr(self).

is_permanent()[source]

If the test object is permanent, it can only be created manually (possibly through the use of manual setup steps).

On states on permanent test object are treated differently than on states on normal test object since they are preserved through test runs and even host shutdowns.

object_typed_params(params)[source]

Return object and type filtered parameters using the current object type.

Parameters:params (param_utils.Params) – whether to show generated parameter dictionaries
regenerate_params(verbose=False)[source]

Regenerate all parameters from the current reparsable config.

Parameters:verbose (bool) – whether to show generated parameter dictionaries
class avocado_i2n.cartgraph.object.NetObject(name, config)[source]

Bases: avocado_i2n.cartgraph.object.TestObject

A Net wrapper for a test object used in one or more test nodes.

__init__(name, config)[source]

Construct a test object (vm) for any test nodes (tests).

All arguments are inherited from the base class.

class avocado_i2n.cartgraph.object.VMObject(name, config)[source]

Bases: avocado_i2n.cartgraph.object.TestObject

A VM wrapper for a test object used in one or more test nodes.

__init__(name, config)[source]

Construct a test object (vm) for any test nodes (tests).

All arguments are inherited from the base class.

class avocado_i2n.cartgraph.object.ImageObject(name, config)[source]

Bases: avocado_i2n.cartgraph.object.TestObject

An image wrapper for a test object used in one or more test nodes.

id

Sufficiently unique ID to identify a test object.

__init__(name, config)[source]

Construct a test object (vm) for any test nodes (tests).

All arguments are inherited from the base class.

Module contents

avocado_i2n.plugins package

Submodules
avocado_i2n.plugins.auto module
avocado_i2n.plugins.manu module
avocado_i2n.plugins.settings module

Avocado plugin that extends the settings path of our config paths.

class avocado_i2n.plugins.settings.I2NSettings[source]

Bases: avocado.core.plugin_interfaces.Settings

adjust_settings_paths(paths)[source]

Entry point where plugin can modify the list of configuration paths.

__abstractmethods__ = frozenset()
Module contents

avocado_i2n.states package

Submodules
avocado_i2n.states.btrfs module
avocado_i2n.states.lvm module
avocado_i2n.states.lxc module
avocado_i2n.states.pool module
avocado_i2n.states.qcow2 module
avocado_i2n.states.ramfile module
avocado_i2n.states.setup module
avocado_i2n.states.vmnet module
Module contents

avocado_i2n.vmnet package

Submodules
avocado_i2n.vmnet.interface module
avocado_i2n.vmnet.netconfig module
avocado_i2n.vmnet.network module
avocado_i2n.vmnet.node module
avocado_i2n.vmnet.tunnel module
Module contents

Submodules

avocado_i2n.cmd_parser module

avocado_i2n.intertest_setup module

avocado_i2n.loader module

avocado_i2n.params_parser module

SUMMARY

Module for handling all Cartesian config parsing and making it reusable and maximally performant.

Copyright: Intra2net AG

INTERFACE
exception avocado_i2n.params_parser.EmptyCartesianProduct(message)[source]

Bases: Exception

Empty Cartesian product of variants

__init__(message)[source]

Initialize an empty Cartesian product exception.

Parameters:message (str) – additional message about the exception
avocado_i2n.params_parser.custom_configs_dir()[source]

Custom directory for all config files.

avocado_i2n.params_parser.tests_ovrwrt_file()[source]

Overwrite config file for all tests (nodes).

avocado_i2n.params_parser.vms_ovrwrt_file()[source]

Overwrite config file for all vms (objects).

class avocado_i2n.params_parser.ParsedContent(content)[source]

Bases: object

Class for parsed content of a general type.

__init__(content)[source]

Initialize the parsed content.

reportable_form()[source]

Parsed content representation used in reports of parsing steps.

Returns:resulting report-compatible string
Return type:str
Raises:NotImlementedError as this is an abstract method
parsable_form()[source]

Convert parameter content into parsable string.

Returns:resulting parsable string
Return type:str
Raises:NotImlementedError as this is an abstract method
class avocado_i2n.params_parser.ParsedFile(content)[source]

Bases: avocado_i2n.params_parser.ParsedContent

Class for parsed content of file type.

__init__(content)[source]

Initialize the parsed content.

reportable_form()[source]

Parsed file representation used in reports of parsing steps.

Arguments are identical to the ones of the parent class.

parsable_form()[source]

Convert parameter file name into parsable string.

Returns:resulting parsable string
Return type:str
class avocado_i2n.params_parser.ParsedStr(content)[source]

Bases: avocado_i2n.params_parser.ParsedContent

Class for parsed content of string type.

reportable_form()[source]

Parsed string representation used in reports of parsing steps.

Arguments are identical to the ones of the parent class.

parsable_form()[source]

Convert parameter string into parsable string.

Returns:resulting parsable string
Return type:str

This is equivalent to the string since the string is parsable by definition.

class avocado_i2n.params_parser.ParsedDict(content)[source]

Bases: avocado_i2n.params_parser.ParsedContent

Class for parsed content of dictionary type.

reportable_form()[source]

Parsed dictionary representation used in reports of parsing steps.

Arguments are identical to the ones of the parent class.

parsable_form()[source]

Convert parameter dictionary into parsable string.

Returns:resulting parsable string
Return type:str
class avocado_i2n.params_parser.Reparsable[source]

Bases: object

Class to represent quickly parsable Cartesian configuration, producing both parser and parameters (parser dicts) on demand.

__init__()[source]

Initialize the parsable structure.

parse_next_file(pfile)[source]

Add a file parsing step.

Parameters:pfile (str) – file to be parsed next

If the parsable file has a relative form (not and absolute path), it will be searched in the relative test suite config directory.

parse_next_str(pstring)[source]

Add a string parsing step.

Parameters:pstring (str) – string to be parsed next
parse_next_dict(pdict)[source]

Add a dictionary parsing step.

Parameters:pdict ({str, str}) – dictionary to be parsed next
parse_next_batch(base_file=None, base_str='', base_dict=None, ovrwrt_file=None, ovrwrt_str='', ovrwrt_dict=None)[source]

Parse a batch of base file, string, and dictionary, and possibly an overwrite file (with custom parameters at the user’s home location).

Parameters:
  • base_file (str or None) – file to be parsed first
  • base_str (str or None) – string to be parsed first
  • base_dict ({str, str} or None) – params to be added first
  • ovrwrt_file (str or None) – file to be parsed last
  • ovrwrt_str (str or None) – string to be parsed last
  • ovrwrt_dict ({str, str} or None) – params to be added last

The priority of the setting follows the order of the arguments: Dictionary with some parameters is topmost, string with some parameters is next and the file with parameters is taken as a base. The overwriting version is taken last, the base version first.

print_parsed()[source]

Return printable information about what was parsed so far.

Returns:structured text of the base/ovrwrt file/str/dict parse steps
Return type:str
avocado_i2n.params_parser.all_restrictions()[source]

Return all restrictions that can be passed for any test configuration.

Returns:all available (from configuration) vms
Return type:[str]
avocado_i2n.params_parser.all_objects(key='vms', composites=None)[source]

Return all test objects that can be passed for any test configuration.

Param:str key: key to extract parametric objects from
Parameters:composites ([str]) – composite restriction of the returned objects
Returns:all available (from configuration) objects of a given type
Return type:[str]
avocado_i2n.params_parser.main_vm()[source]

Return the default main vm that can be passed for any test configuration.

Returns:main available (from configuration) vm
Return type:str or None
avocado_i2n.params_parser.re_str(variant_str, base_str='', tag='')[source]

Add a variant restriction to the base string, optionally adding a custom tag as well.

Parameters:
  • variant_str (str) – variant restriction
  • base_str (str) – string where the variant restriction will be added
  • tag (str) – additional tag to the variant combination
Returns:

restricted parameter string

Return type:

str

avocado_i2n.params_parser.join_str(variant_strs, base_str='')[source]

Join all object variant restrictions over the base string.

Parameters:
  • variant_strs ({str, str}) – variant restrictions for each object as key, value pair
  • base_str (str) – string where the variant restriction will be added
Returns:

restricted parameter string

Return type:

str

avocado_i2n.runner module

Module contents