octavia_tempest_plugin.tests package¶
Subpackages¶
- octavia_tempest_plugin.tests.act_stdby_scenario package
- octavia_tempest_plugin.tests.api package
- Subpackages
- octavia_tempest_plugin.tests.api.v2 package
- Submodules
- octavia_tempest_plugin.tests.api.v2.test_amphora module
- octavia_tempest_plugin.tests.api.v2.test_availability_zone module
- octavia_tempest_plugin.tests.api.v2.test_availability_zone_capabilities module
- octavia_tempest_plugin.tests.api.v2.test_availability_zone_profile module
- octavia_tempest_plugin.tests.api.v2.test_flavor module
- octavia_tempest_plugin.tests.api.v2.test_flavor_capabilities module
- octavia_tempest_plugin.tests.api.v2.test_flavor_profile module
- octavia_tempest_plugin.tests.api.v2.test_healthmonitor module
- octavia_tempest_plugin.tests.api.v2.test_l7policy module
- octavia_tempest_plugin.tests.api.v2.test_l7rule module
- octavia_tempest_plugin.tests.api.v2.test_listener module
- octavia_tempest_plugin.tests.api.v2.test_load_balancer module
- octavia_tempest_plugin.tests.api.v2.test_member module
- octavia_tempest_plugin.tests.api.v2.test_pool module
- octavia_tempest_plugin.tests.api.v2.test_provider module
- Module contents
- octavia_tempest_plugin.tests.api.v2 package
- Module contents
- Subpackages
- octavia_tempest_plugin.tests.barbican_scenario package
- octavia_tempest_plugin.tests.scenario package
- Subpackages
- octavia_tempest_plugin.tests.scenario.v2 package
- Submodules
- octavia_tempest_plugin.tests.scenario.v2.test_healthmonitor module
- octavia_tempest_plugin.tests.scenario.v2.test_ipv6_traffic_ops module
- octavia_tempest_plugin.tests.scenario.v2.test_l7policy module
- octavia_tempest_plugin.tests.scenario.v2.test_l7rule module
- octavia_tempest_plugin.tests.scenario.v2.test_listener module
- octavia_tempest_plugin.tests.scenario.v2.test_load_balancer module
- octavia_tempest_plugin.tests.scenario.v2.test_member module
- octavia_tempest_plugin.tests.scenario.v2.test_pool module
- octavia_tempest_plugin.tests.scenario.v2.test_traffic_ops module
- Module contents
- octavia_tempest_plugin.tests.scenario.v2 package
- Module contents
- Subpackages
- octavia_tempest_plugin.tests.spare_pool_scenario package
Submodules¶
octavia_tempest_plugin.tests.test_base module¶
-
class
LoadBalancerBaseTest
(*args, **kwargs)[source]¶ Bases:
octavia_tempest_plugin.tests.validators.ValidatorsMixin
,tempest.test.BaseTestCase
Base class for load balancer tests.
-
SRC_PORT_NUMBER_MAX
= 61000¶
-
SRC_PORT_NUMBER_MIN
= 32768¶
-
client_manager
¶
-
credentials
= ['admin', 'primary', ['lb_member', 'load-balancer_member'], ['lb_member2', 'load-balancer_member'], ['lb_admin', 'load-balancer_admin']]¶
-
src_port_number
= 32768¶
-
used_ips
= []¶
-
webserver1_response
= 1¶
-
webserver2_response
= 5¶
-
-
class
LoadBalancerBaseTestWithCompute
(*args, **kwargs)[source]¶ Bases:
octavia_tempest_plugin.tests.test_base.LoadBalancerBaseTest
octavia_tempest_plugin.tests.validators module¶
-
class
ValidatorsMixin
(*args, **kwargs)[source]¶ Bases:
tempest.test.BaseTestCase
-
assertConsistentResponse
(response, url, method='GET', repeat=10, redirect=False, timeout=2, expect_connection_error=False, **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.
expect_connection_error – Should we expect a connection error
expect_timeout – Should we expect a connection timeout
- Returns
boolean success status
- Raises
testtools.matchers.MismatchError
-
check_members_balanced
(vip_address, traffic_member_count=2, protocol='HTTP', HTTPS_verify=True, protocol_port=80, persistent=True, repeat=20, client_cert_path=None, CA_certs_path=None, request_interval=2, request_timeout=10, source_port=None, delay=None)[source]¶ Checks that members are evenly balanced behind a VIP.
- Parameters
vip_address – The VIP address to test.
traffic_member_count – The expected number of members.
protocol – The protocol to use for the test.
HTTPS_verify – How to verify the TLS certificate. True: verify using the system CA certificates. False: Do not verify the VIP certificate. <path>: Filesytem path to a CA certificate bundle file or directory. For directories, the directory must be processed using the c_rehash utility from openssl.
protocol_port – The port number to use for the test.
persistent – True when the test should persist cookies and use the protocol keepalive mechanism with the target. This may include maintaining a connection to the member server across requests.
repeat – The number of requests to make against the VIP.
request_timeout – The maximum time, in seconds, to attempt requests.
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.
source_port – If set, the request will come from this source port number. If None, a random port will be used.
delay – The time to pause between requests in seconds, can be fractional.
-
make_request
(vip_address, protocol='HTTP', HTTPS_verify=True, protocol_port=80, requests_session=None, client_cert_path=None, CA_certs_path=None, request_timeout=2, source_port=None)[source]¶ Make a request to a VIP.
- Parameters
vip_address – The VIP address to test.
protocol – The protocol to use for the test.
HTTPS_verify – How to verify the TLS certificate. True: verify using the system CA certificates. False: Do not verify the VIP certificate. <path>: Filesytem path to a CA certificate bundle file or directory. For directories, the directory must be processed using the c_rehash utility from openssl.
protocol_port – The port number to use for the test.
requests_session – A requests session to use for the request. If None, a new session will be created.
request_timeout – The maximum time, in seconds, to attempt requests.
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.
source_port – If set, the request will come from this source port number. If None, a random port will be used.
- Raises
InvalidHttpSuccessCode – The expected_status_code did not match.
InvalidHTTPResponseBody – The response body did not match the expected content.
TimeoutException – The request timed out.
Exception – If a protocol is requested that is not implemented.
- Returns
The response data.
-
static
validate_URL_response
(URL, expected_status_code=200, requests_session=None, expected_body=None, HTTPS_verify=True, client_cert_path=None, CA_certs_path=None, source_port=None, request_interval=5.0, 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.
requests_session – A requests session to use for the request. If None, a new session will be created.
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.
source_port – If set, the request will come from this source port number. If None, a random port will be used.
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
The response data.
-
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, error_ok=False, **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.
- Error_ok
When true, ERROR status will not raise an exception.
- 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.