taf.testlib.tempest_clients

Submodules

taf.testlib.tempest_clients.magnum

taf.testlib.tempest_clients.magnum.clients

taf.testlib.tempest_clients.magnum.clients.cert_client

cert_client

class taf.testlib.tempest_clients.magnum.clients.cert_client.CertClient(auth_provider)[source]

Bases: testlib.tempest_clients.magnum.clients.client.MagnumClient

Encapsulates REST calls and maps JSON to/from models

classmethod cert_uri(cluster_id)[source]

Construct cluster uri.

Parameters:cluster_id – cluster uuid or name
Returns:url string
get_cert(cluster_id, **kwargs)[source]

Makes GET /certificates/cluster_id request and returns CertEntity.

Abstracts REST call to return a single cert based on uuid or name

Parameters:cluster_id – cluster uuid or name
Returns:response object and ClusterCollection object
post_cert(model, **kwargs)[source]

Makes POST /certificates request and returns CertEntity.

Abstracts REST call to sign new certificate

Parameters:model – CertEntity
Returns:response object and CertEntity object
url = '/certificates'

taf.testlib.tempest_clients.magnum.clients.client

client.py

class taf.testlib.tempest_clients.magnum.clients.client.MagnumClient(auth_provider)[source]

Bases: RestClient

Abstract class responsible for setting up auth provider

classmethod add_filters(url, filters)[source]

add_filters adds dict values (filters) to url as query parameters.

Parameters:
  • url – base URL for the request
  • filters – dict with var:val pairs to add as parameters to URL
Returns:

url string

classmethod deserialize(resp, body, model_type)[source]
tenant_id

taf.testlib.tempest_clients.magnum.clients.cluster_client

cluster_client.py

class taf.testlib.tempest_clients.magnum.clients.cluster_client.ClusterClient(auth_provider)[source]

Bases: testlib.tempest_clients.magnum.clients.client.MagnumClient

Encapsulates REST calls and maps JSON to/from models.

LOG
classmethod cluster_uri(cluster_id)[source]

Construct cluster uri.

Parameters:cluster_id – cluster uuid or name
Returns:url string
classmethod clusters_uri(filters=None)[source]

Construct clusters uri with optional filters.

Parameters:filters – Optional k:v dict that’s converted to url query
Returns:url string
delete_cluster(cluster_id, **kwargs)[source]

Makes DELETE /cluster request and returns response object

Abstracts REST call to delete cluster based on uuid or name

Parameters:cluster_id – UUID or name of cluster
Returns:Response object
does_cluster_exist(cluster_id)[source]
does_cluster_not_exist(cluster_id)[source]
get_cluster(cluster_id, **kwargs)[source]

Makes GET /cluster request and returns ClusterEntity.

Abstracts REST call to return a single cluster based on uuid or name.

Parameters:cluster_id – cluster uuid or name
Returns:Response object and ClusterCollection object
is_cluster_in_final_state(cluster_id)[source]
list_clusters(filters=None, **kwargs)[source]

Makes GET /clusters request and returns ClusterCollection.

Abstracts REST call to return all clusters.

Parameters:filters – Optional k:v dict that’s converted to url query
Returns:Response object and ClusterCollection object
patch_cluster(cluster_id, clusterpatch_listmodel, **kwargs)[source]

Makes PATCH /cluster request and returns ClusterIdEntity

Abstracts REST call to update cluster attributes

Parameters:
  • cluster_id – UUID of cluster
  • clusterpatch_listmodel – ClusterPatchCollection
Returns:

Response object and ClusterIdEntity object

post_cluster(model, **kwargs)[source]

Makes POST /cluster request and returns ClusterIdEntity.

Abstracts REST call to create new cluster.

Parameters:model – ClusterEntity
Returns:Response object and ClusterIdEntity object
wait_for_cluster_to_delete(cluster_id)[source]
wait_for_created_cluster(cluster_id, delete_on_error=True)[source]
wait_for_final_state(cluster_id)[source]

taf.testlib.tempest_clients.magnum.clients.cluster_template_client

cluster_template_client.py

class taf.testlib.tempest_clients.magnum.clients.cluster_template_client.ClusterTemplateClient(auth_provider)[source]

Bases: testlib.tempest_clients.magnum.clients.client.MagnumClient

Encapsulates REST calls and maps JSON to/from models

classmethod cluster_template_uri(cluster_template_id)[source]

Construct cluster_template uri.

Parameters:cluster_template_id – cluster_template uuid or name
Returns:url string
classmethod cluster_templates_uri(filters=None)[source]

Construct clustertemplates uri with optional filters.

Parameters:filters – Optional k:v dict that’s converted to url query
Returns:url string
delete_cluster_template(cluster_template_id, **kwargs)[source]

Makes DELETE /clustertemplate request and returns response object

Abstracts REST call to delete clustertemplate based on uuid or name

Parameters:cluster_template_id – UUID or name of clustertemplate
Returns:Response object
get_cluster_template(cluster_template_id, **kwargs)[source]

Makes GET /clustertemplate request and returns ClusterTemplateEntity.

Abstracts REST call to return a single clustertempalte based on uuid or name.

Parameters:cluster_template_id – clustertempalte uuid or name
Returns:Response object and ClusterTemplateCollection object
list_cluster_templates(filters=None, **kwargs)[source]

Makes GET /clustertemplates request.

Abstracts REST call to return all clustertemplates.

Parameters:filters – Optional k:v dict that’s converted to url query
Returns:Response object and ClusterTemplateCollection object
patch_cluster_template(cluster_template_id, cluster_templatepatch_listmodel, **kwargs)[source]

Makes PATCH /clustertemplate and returns ClusterTemplateEntity

Abstracts REST call to update clustertemplate attributes

Parameters:
  • cluster_template_id – UUID of clustertemplate
  • cluster_templatepatch_listmodel – ClusterTemplatePatchCollection
Returns:

Response object and ClusterTemplateEntity object

post_cluster_template(model, **kwargs)[source]

Makes POST /clustertemplate request

Abstracts REST call to create new clustertemplate

Parameters:model – ClusterTemplateEntity
Returns:Response object and ClusterTemplateEntity object

taf.testlib.tempest_clients.magnum.clients.magnum_service_client

magnum_service_client.py

class taf.testlib.tempest_clients.magnum.clients.magnum_service_client.MagnumServiceClient(auth_provider)[source]

Bases: testlib.tempest_clients.magnum.clients.client.MagnumClient

Encapsulates REST calls and maps JSON to/from models

magnum_service_list(filters=None, **kwargs)[source]

Makes GET /mservices request and returns MagnumServiceCollection

Abstracts REST call to return all magnum services.

Parameters:filters – Optional k:v dict that’s converted to url query
Returns:Response object and MagnumServiceCollection object
classmethod magnum_service_uri(filters=None)[source]

Construct magnum services uri with optional filters

Parameters:filters – Optional k:v dict that’s converted to url query
Returns:url string

taf.testlib.tempest_clients.magnum.common

taf.testlib.tempest_clients.magnum.common.utils

utils.py

taf.testlib.tempest_clients.magnum.common.utils.def_method(f, *args, **kwargs)[source]
taf.testlib.tempest_clients.magnum.common.utils.memoized(func)[source]

A decorator to cache function’s return value

taf.testlib.tempest_clients.magnum.common.utils.parameterized(data)[source]

A function decorator for parameterized test cases.

Example:

@parameterized({
    'zero': dict(val=0),
    'one': dict(val=1),
})
def test_val(self, val):
    self.assertEqual(val, self.get_val())

The above will generate two test cases:

`test_val_zero` which runs with val=0
`test_val_one` which runs with val=1
Parameters:data (dict) – A dictionary that looks like {tag: {arg1: val1, …}}
taf.testlib.tempest_clients.magnum.common.utils.parameterized_class(cls)[source]

A class decorator for running parameterized test cases.

Mark your class with @parameterized_class. Mark your test cases with @parameterized.

taf.testlib.tempest_clients.magnum.common.utils.wait_for_condition(condition, interval=1, timeout=40)[source]

taf.testlib.tempest_clients.magnum.models

taf.testlib.tempest_clients.magnum.models.cert_model

cert_model.py

class taf.testlib.tempest_clients.magnum.models.cert_model.CertData[source]

Bases: testlib.tempest_clients.magnum.models.models.BaseModel

Data that encapsulates cert attributes

class taf.testlib.tempest_clients.magnum.models.cert_model.CertEntity[source]

Bases: testlib.tempest_clients.magnum.models.models.EntityModel

Entity Model that represents a single instance of CertData

ENTITY_NAME = 'certificate'
MODEL_TYPE

alias of CertData

taf.testlib.tempest_clients.magnum.models.cluster_id_model

cluster_id_model.py

class taf.testlib.tempest_clients.magnum.models.cluster_id_model.ClusterIdData[source]

Bases: testlib.tempest_clients.magnum.models.models.BaseModel

Data that encapsulates ClusterId attributes

class taf.testlib.tempest_clients.magnum.models.cluster_id_model.ClusterIdEntity[source]

Bases: testlib.tempest_clients.magnum.models.models.EntityModel

Entity Model that represents a single instance of CertData

ENTITY_NAME = 'clusterid'
MODEL_TYPE

alias of ClusterIdData

taf.testlib.tempest_clients.magnum.models.cluster_model

cluster_model.py

class taf.testlib.tempest_clients.magnum.models.cluster_model.ClusterCollection[source]

Bases: testlib.tempest_clients.magnum.models.models.CollectionModel

Collection Model that represents a list of ClusterData objects

COLLECTION_NAME = 'clusterlists'
MODEL_TYPE

alias of ClusterData

class taf.testlib.tempest_clients.magnum.models.cluster_model.ClusterData[source]

Bases: testlib.tempest_clients.magnum.models.models.BaseModel

Data that encapsulates cluster attributes

class taf.testlib.tempest_clients.magnum.models.cluster_model.ClusterEntity[source]

Bases: testlib.tempest_clients.magnum.models.models.EntityModel

Entity Model that represents a single instance of ClusterData

ENTITY_NAME = 'cluster'
MODEL_TYPE

alias of ClusterData

taf.testlib.tempest_clients.magnum.models.cluster_template_model

cluster_template_model.py

class taf.testlib.tempest_clients.magnum.models.cluster_template_model.ClusterTemplateCollection[source]

Bases: testlib.tempest_clients.magnum.models.models.CollectionModel

Collection that represents a list of ClusterTemplateData objects

COLLECTION_NAME = 'clustertemplatelists'
MODEL_TYPE

alias of ClusterTemplateData

class taf.testlib.tempest_clients.magnum.models.cluster_template_model.ClusterTemplateData[source]

Bases: testlib.tempest_clients.magnum.models.models.BaseModel

Data that encapsulates clustertemplate attributes

class taf.testlib.tempest_clients.magnum.models.cluster_template_model.ClusterTemplateEntity[source]

Bases: testlib.tempest_clients.magnum.models.models.EntityModel

Entity Model that represents a single instance of ClusterTemplateData

ENTITY_NAME = 'clustertemplate'
MODEL_TYPE

alias of ClusterTemplateData

taf.testlib.tempest_clients.magnum.models.cluster_templatepatch_model

cluster_templatepatch_model.py

class taf.testlib.tempest_clients.magnum.models.cluster_templatepatch_model.ClusterTemplatePatchCollection[source]

Bases: testlib.tempest_clients.magnum.models.models.CollectionModel

Model that represents a list of ClusterTemplatePatchData objects

COLLECTION_NAME = 'clustertemplatepatchlist'
MODEL_TYPE

alias of ClusterTemplatePatchData

classmethod from_dict(data)[source]

Converts dict to ClusterTemplatePatchData

Converts data dict to list of ClusterTemplatePatchData objects and stores it in COLLECTION_NAME

Example of dict data:

[{
    "path": "/name",
    "value": "myname",
    "op": "replace"
}]
Parameters:data (dict) – dict of patch data
Returns:json object
to_json()[source]

Converts ClusterTemplatePatchCollection to json

Retrieves list from COLLECTION_NAME attribute and converts each object to dict, appending it to a list. Then converts the entire list to json

This is required due to COLLECTION_NAME holding a list of objects that needed to be converted to dict individually

Returns:json object
class taf.testlib.tempest_clients.magnum.models.cluster_templatepatch_model.ClusterTemplatePatchData[source]

Bases: testlib.tempest_clients.magnum.models.models.BaseModel

Data that encapsulates clustertemplatepatch attributes

class taf.testlib.tempest_clients.magnum.models.cluster_templatepatch_model.ClusterTemplatePatchEntity[source]

Bases: testlib.tempest_clients.magnum.models.models.EntityModel

Model that represents a single instance of ClusterTemplatePatchData

ENTITY_NAME = 'clustertemplatepatch'
MODEL_TYPE

alias of ClusterTemplatePatchData

taf.testlib.tempest_clients.magnum.models.clusterpatch_model

taf.testlib.tempest_clients.magnum.models.magnum_service_model

magnum_service_model.py

class taf.testlib.tempest_clients.magnum.models.magnum_service_model.MagnumServiceCollection[source]

Bases: testlib.tempest_clients.magnum.models.models.CollectionModel

Collection Model that represents a list of MagnumServiceData objects

COLLECTION_NAME = 'mservicelists'
MODEL_TYPE

alias of MagnumServiceData

class taf.testlib.tempest_clients.magnum.models.magnum_service_model.MagnumServiceData[source]

Bases: testlib.tempest_clients.magnum.models.models.BaseModel

Data that encapsulates magnum_service attributes

class taf.testlib.tempest_clients.magnum.models.magnum_service_model.MagnumServiceEntity[source]

Bases: testlib.tempest_clients.magnum.models.models.EntityModel

Entity Model that represents a single instance of MagnumServiceData

ENTITY_NAME = 'mservice'
MODEL_TYPE

alias of MagnumServiceData

taf.testlib.tempest_clients.magnum.models.models

models.py

class taf.testlib.tempest_clients.magnum.models.models.BaseModel[source]

Bases: object

Superclass Responsible for converting json data to/from model

MODEL_TYPE

alias of builtins.object

classmethod from_dict(data)[source]
classmethod from_json(json_str)[source]
to_dict()[source]
to_json()[source]
class taf.testlib.tempest_clients.magnum.models.models.CollectionModel[source]

Bases: taf.testlib.tempest_clients.magnum.models.models.BaseModel

Superclass resposible from converting dict to list of models

COLLECTION_NAME = ''
classmethod from_dict(data)[source]
class taf.testlib.tempest_clients.magnum.models.models.EntityModel[source]

Bases: taf.testlib.tempest_clients.magnum.models.models.BaseModel

Superclass resposible from converting dict to instance of model

ENTITY_NAME = ''
classmethod from_dict(data)[source]

taf.testlib.tempest_clients.magnum.sfc_client