octavia_tempest_plugin.tests package

octavia_tempest_plugin.tests package

Subpackages

Submodules

octavia_tempest_plugin.tests.test_base module

class LoadBalancerBaseTest(*args, **kwargs)[source]

Bases: tempest.test.BaseTestCase

Base class for load balancer tests.

client_manager

alias of octavia_tempest_plugin.clients.ManagerV2

credentials = ['admin', 'primary', ['lb_member', 'load-balancer_member'], ['lb_member2', 'load-balancer_member'], ['lb_admin', 'load-balancer_admin']]
classmethod resource_setup()[source]

Setup resources needed by the tests.

classmethod setup_clients()[source]

Setup client aliases.

classmethod setup_credentials()[source]

Setup test credentials and network resources.

classmethod skip_checks()[source]

Check if we should skip all of the children tests.

used_ips = []
webserver1_response = 1
webserver2_response = 5
class LoadBalancerBaseTestWithCompute(*args, **kwargs)[source]

Bases: octavia_tempest_plugin.tests.test_base.LoadBalancerBaseTest

assertConsistentResponse(response, url, method='GET', repeat=10, redirect=False, timeout=2, **kwargs)[source]

Assert that a request to URL gets the expected response.

Parameters:
  • response – Expected response in format (status_code, content).
  • url – The URL to request.
  • method – The HTTP method to use (GET, POST, PUT, etc)
  • repeat – How many times to test the response.
  • data – Optional data to send in the request.
  • headers – Optional headers to send in the request.
  • cookies – Optional cookies to send in the request.
  • redirect – Is the request a redirect? If true, assume the passed content should be the next URL in the chain.
  • timeout – Optional seconds to wait for the server to send data.
Returns:

boolean success status

Raises:

testtools.matchers.MismatchError

check_members_balanced(vip_address, traffic_member_count=2, protocol='http', verify=True)[source]
classmethod resource_setup()[source]

Setup resources needed by the tests.

octavia_tempest_plugin.tests.validators module

validate_URL_response(URL, expected_status_code=200, expected_body=None, HTTPS_verify=True, client_cert_path=None, CA_certs_path=None, request_interval=5, request_timeout=300)[source]

Check a URL response (HTTP or HTTPS).

Parameters:
  • URL – The URL to query.
  • expected_status_code – The expected HTTP status code.
  • expected_body – The expected response text, None will not compare.
  • HTTPS_verify – Should we verify the HTTPS server.
  • client_cert_path – Filesystem path to a file with the client private key and certificate.
  • CA_certs_path – Filesystem path to a file containing CA certificates to use for HTTPS validation.
  • request_interval – Time, in seconds, to timeout a request.
  • request_timeout – The maximum time, in seconds, to attempt requests. Failed validation of expected results does not result in a retry.
Raises:
  • InvalidHttpSuccessCode – The expected_status_code did not match.
  • InvalidHTTPResponseBody – The response body did not match the expected content.
  • TimeoutException – The request timed out.
Returns:

None

octavia_tempest_plugin.tests.waiters module

wait_for_deleted_status_or_not_found(show_client, id, status_key, check_interval, check_timeout, root_tag=None, **kwargs)[source]

Waits for an object to reach a DELETED status or be not found (404).

Parameters:
  • show_client – The tempest service client show method. Ex. cls.os_primary.servers_client.show_server
  • id – The id of the object to query.
  • status_key – The key of the status field in the response. Ex. provisioning_status
Check_interval:

How often to check the status, in seconds.

Check_timeout:

The maximum time, in seconds, to check the status.

Root_tag:

The root tag on the response to remove, if any.

Raises:
  • CommandFailed – Raised if the object goes into ERROR and ERROR was not the desired status.
  • TimeoutException – The object did not achieve the status or ERROR in the check_timeout period.
Returns:

None

wait_for_not_found(delete_func, show_func, *args, **kwargs)[source]

Call the delete function, then wait for it to be ‘NotFound’

Parameters:
  • delete_func – The delete function to call.
  • show_func – The show function to call looking for ‘NotFound’.
  • ID – The ID of the object to delete/show.
Raises:

TimeoutException – The object did not achieve the status or ERROR in the check_timeout period.

Returns:

None

wait_for_spare_amps(list_func, check_interval, check_timeout)[source]

Waits for amphorae in spare pool.

Parameters:list_func – The tempest service client amphora list method. Ex. cls.os_admin.amphora_client.list_amphorae
Check_interval:How often to check the status, in seconds.
Check_timeout:The maximum time, in seconds, to check the status.
Raises:TimeoutException – No amphora available in spare pool in the check_timeout period.
Returns:A list of amphorae in spare pool.
wait_for_status(show_client, id, status_key, status, check_interval, check_timeout, root_tag=None, **kwargs)[source]

Waits for an object to reach a specific status.

Parameters:
  • show_client – The tempest service client show method. Ex. cls.os_primary.servers_client.show_server
  • id – The id of the object to query.
  • status_key – The key of the status field in the response. Ex. provisioning_status
  • status – The status to wait for. Ex. “ACTIVE”
Check_interval:

How often to check the status, in seconds.

Check_timeout:

The maximum time, in seconds, to check the status.

Root_tag:

The root tag on the response to remove, if any.

Raises:
  • CommandFailed – Raised if the object goes into ERROR and ERROR was not the desired status.
  • TimeoutException – The object did not achieve the status or ERROR in the check_timeout period.
Returns:

The object details from the show client.

Module contents

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.