octavia_tempest_plugin.common package

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.

Note: This uses pyOpenSSL as the cryptography package does not yet
support creating pkcs12 bundles. The currently un-released 2.5 version of cryptography supports reading pkcs12, but not creation. This method should be updated to only use cryptography once it supports creating pkcs12 bundles.
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.

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.