ocs_ci.framework package

Submodules

ocs_ci.framework.exceptions module

exception ocs_ci.framework.exceptions.ClusterNameLengthError(name, min_length=5, max_length=17)

Bases: Exception

exception ocs_ci.framework.exceptions.ClusterNameNotProvidedError

Bases: Exception

exception ocs_ci.framework.exceptions.ClusterPathNotProvidedError

Bases: Exception

ocs_ci.framework.main module

ocs_ci.framework.main.check_config_requirements()

Checking if all required parameters were passed

Raises

MissingRequiredConfigKeyError – In case of some required parameter is not defined.

ocs_ci.framework.main.init_ocsci_conf(arguments=None)

Update the config object with any files passed via the CLI

Parameters

arguments (list) – Arguments for pytest execution

ocs_ci.framework.main.load_config(config_files)

This function load the config files in the order defined in config_files list.

Parameters

config_files (list) – config file paths

ocs_ci.framework.main.main(argv=None)

ocs_ci.framework.testlib module

class ocs_ci.framework.testlib.BaseTest

Bases: object

Base test class for our testing. If some functionality/property needs to be implemented in all test classes here is the place to put your code.

pytestmark = [Mark(name='usefixtures', args=('environment_checker',), kwargs={})]
class ocs_ci.framework.testlib.E2ETest

Bases: ocs_ci.framework.testlib.BaseTest

Base class for E2E team

pytestmark = [Mark(name='usefixtures', args=('environment_checker',), kwargs={}), Mark(name='e2e', args=(), kwargs={})]
class ocs_ci.framework.testlib.EcosystemTest

Bases: ocs_ci.framework.testlib.BaseTest

Base class for E2E team

pytestmark = [Mark(name='usefixtures', args=('environment_checker',), kwargs={}), Mark(name='ecosystem', args=(), kwargs={})]
class ocs_ci.framework.testlib.MCGTest

Bases: ocs_ci.framework.testlib.ManageTest

MAX_ENDPOINT_COUNT = 2
MIN_ENDPOINT_COUNT = 2
pytestmark = [Mark(name='usefixtures', args=('environment_checker',), kwargs={}), Mark(name='manage', args=(), kwargs={}), Mark(name='usefixtures', args=('nb_ensure_endpoint_count',), kwargs={})]
class ocs_ci.framework.testlib.ManageTest

Bases: ocs_ci.framework.testlib.BaseTest

Base class for E2E team

pytestmark = [Mark(name='usefixtures', args=('environment_checker',), kwargs={}), Mark(name='manage', args=(), kwargs={})]

Module contents

Avoid already-imported warning cause of we are importing this package from run wrapper for loading config.

You can see documentation here: https://docs.pytest.org/en/latest/reference.html under section PYTEST_DONT_REWRITE

class ocs_ci.framework.Config(AUTH: dict = <factory>, DEPLOYMENT: dict = <factory>, ENV_DATA: dict = <factory>, EXTERNAL_MODE: dict = <factory>, REPORTING: dict = <factory>, RUN: dict = <factory>, UPGRADE: dict = <factory>, FLEXY: dict = <factory>, UI_SELENIUM: dict = <factory>)

Bases: object

AUTH: dict = None
DEPLOYMENT: dict = None
ENV_DATA: dict = None
EXTERNAL_MODE: dict = None
FLEXY: dict = None
REPORTING: dict = None
RUN: dict = None
UI_SELENIUM: dict = None
UPGRADE: dict = None
get_defaults()

Return a fresh copy of the default configuration

reset()

Clear all configuration data and load defaults

to_dict()
update(user_dict: dict)

Override configuration items with items in user_dict, without wiping out non-overridden items

ocs_ci.framework.merge_dict(orig: dict, new: dict) → dict

Update a dict recursively, with values from ‘new’ being merged into ‘orig’.

Parameters
  • orig (dict) – The object that will receive the update

  • new (dict) – The object which is the source of the update

Example:

orig = {
    'dict': {'one': 1, 'two': 2},
    'list': [1, 2],
    'string': 's',
}
new = {
    'dict': {'one': 'one', 'three': 3},
    'list': [0],
    'string': 'x',
}
merge_dict(orig, new) ->
{
    'dict': {'one': 'one', 'two': 2, 'three': 3}
    'list': [0],
    'string', 'x',
}