octavia_tempest_plugin.common package

Submodules

octavia_tempest_plugin.common.barbican_client_mgr module

class BarbicanClientManager(tempest_client_mgr)[source]

Bases: object

Class for interacting with the barbican service.

This class is an abstraction for interacting with the barbican service. This class currently uses the barbican client code to access barbican due to the following reasons: 1. Octavia users typically load secrets into barbican via the client. 2. The barbican-tempest-plugin is lightly tested (no py3 tests, etc.). 3. barbican-tempest-plugin is not in global requirements.

This led to the decision to not use the service client in the barbican-tempest-plugin.

In the future it may be better to use the barbican-tempest-plugin service client or the openstacksdk.

add_acl(secret_ref, user_id)[source]
delete_secret(secret_ref)[source]
store_secret(secret)[source]

Store a secret in barbican.

Parameters:

secret – A pkcs12 secret.

Returns:

The barbican secret_ref.

octavia_tempest_plugin.common.cert_utils module

generate_ca_cert_and_key()[source]

Creates a CA cert and key for testing.

Returns:

The cryptography CA cert and CA key objects.

generate_certificate_revocation_list(ca_cert, ca_key, cert_to_revoke)[source]

Create a certificate revocation list with a revoked certificate.

Parameters:
  • ca_cert – A cryptography CA certificate (x509) object.

  • ca_key – A cryptography CA key (x509) object.

  • cert_to_revoke – A cryptography CA certificate (x509) object.

Returns:

A signed certificate revocation list.

generate_client_cert_and_key(ca_cert, ca_key, client_uuid)[source]

Creates a client cert and key for testing.

Parameters:
  • ca_cert – A cryptography CA certificate (x509) object.

  • ca_key – A cryptography CA key (x509) object.

  • client_uuid – A UUID identifying the client.

Returns:

The cryptography server cert and key objects.

generate_pkcs12_bundle(server_cert, server_key)[source]

Creates a pkcs12 formated bundle.

Parameters:
  • server_cert – A cryptography certificate (x509) object.

  • server_key – A cryptography key (x509) object.

Returns:

A pkcs12 bundle.

generate_server_cert_and_key(ca_cert, ca_key, server_uuid)[source]

Creates a server cert and key for testing.

Parameters:
  • ca_cert – A cryptography CA certificate (x509) object.

  • ca_key – A cryptography CA key (x509) object.

  • server_uuid – A UUID identifying the server.

Returns:

The cryptography server cert and key objects.

octavia_tempest_plugin.common.constants module

octavia_tempest_plugin.common.decorators module

skip_if_not_implemented(f)[source]

A decorator to raise a skip exception for not implemented features.

This decorator raises a skipException if the method raises a NotImplemented exception. If “skip_if_not_implemented=False” argument was passed to the method, the NotImplemented exception will be raised.

@param skip_if_not_implemented: If True (default), raise skipException.

octavia_tempest_plugin.common.requests_adapters module

class SourcePortAdapter(port, *args, **kwargs)[source]

Bases: HTTPAdapter

“Transport adapter” that allows us to set the source port.

init_poolmanager(connections, maxsize, block=False)[source]

Initializes a urllib3 PoolManager.

This method should not be called from user code, and is only exposed for use when subclassing the HTTPAdapter.

Parameters:
  • connections – The number of urllib3 connection pools to cache.

  • maxsize – The maximum number of connections to save in the pool.

  • block – Block when no free connections are available.

  • pool_kwargs – Extra keyword arguments used to initialize the Pool Manager.

Module contents