keystoneauth1.tests.unit.identity package

Submodules

keystoneauth1.tests.unit.identity.test_access module

class keystoneauth1.tests.unit.identity.test_access.AccessInfoPluginTests(*args, **kwargs)

Bases: keystoneauth1.tests.unit.utils.TestCase

setUp()
test_auth_ref()
test_auth_url()
test_domain_auth_properties()
test_invalidate()
test_project_auth_properties()

keystoneauth1.tests.unit.identity.test_identity_common module

class keystoneauth1.tests.unit.identity.test_identity_common.CatalogHackTests(*args, **kwargs)

Bases: keystoneauth1.tests.unit.utils.TestCase

BASE_URL = 'http://keystone.server:5000/'
IDENTITY = 'identity'
OTHER_URL = 'http://other.server:5000/path'
TEST_URL = 'http://keystone.server:5000/v2.0'
V2_URL = 'http://keystone.server:5000/v2.0'
V3_URL = 'http://keystone.server:5000/v3'
test_getting_endpoints()
test_getting_endpoints_on_auth_interface()
test_returns_original_when_discover_fails()
class keystoneauth1.tests.unit.identity.test_identity_common.CommonIdentityTests

Bases: object

TEST_COMPUTE_ADMIN = 'http://nova/novapi/admin'
TEST_COMPUTE_INTERNAL = 'http://nova/novapi/internal'
TEST_COMPUTE_PUBLIC = 'http://nova/novapi/public'
TEST_PASS = 'd621d5ba886848608988fcda86c80c82'
TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
TEST_ROOT_URL = 'http://127.0.0.1:5000/'
create_auth_plugin(**kwargs)

Create an auth plugin that makes sense for the auth data.

It doesn’t really matter what auth mechanism is used but it should be appropriate to the API version.

get_auth_data(**kwargs)

Return fake authentication data.

This should register a valid token response and ensure that the compute endpoints are set to TEST_COMPUTE_PUBLIC, _INTERNAL and _ADMIN.

setUp()
stub_auth_data(**kwargs)
test_asking_for_auth_endpoint_ignores_checks()
test_discovering()
test_discovering_with_no_data()
test_discovery_uses_plugin_cache()
test_discovery_uses_session_cache()
test_get_auth_properties()
test_invalidate()
test_no_reauthenticate()
test_reauthenticate()
version

The API version being tested.

class keystoneauth1.tests.unit.identity.test_identity_common.GenericAuthPluginTests(*args, **kwargs)

Bases: keystoneauth1.tests.unit.utils.TestCase

ENDPOINT_FILTER = {'5cf3f400ad784cfb8a93508ecd8218c8': 'bd32ce55244b46c8985825e1c9b55ae0'}
setUp()
test_setting_bad_connection_params()
test_setting_connection_params()
test_setting_headers()
class keystoneauth1.tests.unit.identity.test_identity_common.GenericPlugin

Bases: keystoneauth1.plugin.BaseAuthPlugin

BAD_TOKEN = 'e9e9fcc28a6b464bb2823174cc36805c'
get_connection_params(session, **kwargs)
get_endpoint(session, **kwargs)
get_headers(session, **kwargs)
get_token(session, **kwargs)
url(prefix)
class keystoneauth1.tests.unit.identity.test_identity_common.V2(*args, **kwargs)

Bases: keystoneauth1.tests.unit.identity.test_identity_common.CommonIdentityTests, keystoneauth1.tests.unit.utils.TestCase

create_auth_plugin(**kwargs)
get_auth_data(**kwargs)
stub_auth(**kwargs)
version
class keystoneauth1.tests.unit.identity.test_identity_common.V3(*args, **kwargs)

Bases: keystoneauth1.tests.unit.identity.test_identity_common.CommonIdentityTests, keystoneauth1.tests.unit.utils.TestCase

create_auth_plugin(**kwargs)
get_auth_data(**kwargs)
stub_auth(subject_token=None, **kwargs)
version

keystoneauth1.tests.unit.identity.test_identity_v2 module

class keystoneauth1.tests.unit.identity.test_identity_v2.V2IdentityPlugin(*args, **kwargs)

Bases: keystoneauth1.tests.unit.utils.TestCase

TEST_ADMIN_URL = 'http://127.0.0.1:35357/v2.0'
TEST_PASS = 'password'
TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
TEST_ROOT_URL = 'http://127.0.0.1:5000/'
TEST_SERVICE_CATALOG = [{'type': 'nova_compat', 'endpoints': [{'internalURL': 'http://127.0.0.1:8774/v1.0', 'publicURL': 'http://cdn.admin-nets.local:8774/v1.0/', 'region': 'RegionOne', 'adminURL': 'http://cdn.admin-nets.local:8774/v1.0'}], 'name': 'nova_compat'}, {'type': 'compute', 'endpoints': [{'internalURL': 'http://nova/novapi/internal', 'publicURL': 'http://nova/novapi/public', 'region': 'RegionOne', 'adminURL': 'http://nova/novapi/admin'}], 'name': 'nova'}, {'type': 'image', 'endpoints': [{'internalURL': 'http://glance/glanceapi/internal', 'publicURL': 'http://glance/glanceapi/public', 'region': 'RegionOne', 'adminURL': 'http://glance/glanceapi/admin'}], 'name': 'glance'}, {'type': 'identity', 'endpoints': [{'internalURL': 'http://127.0.0.1:5000/v2.0', 'publicURL': 'http://127.0.0.1:5000/v2.0', 'region': 'RegionOne', 'adminURL': 'http://127.0.0.1:35357/v2.0'}], 'name': 'keystone'}, {'type': 'object-store', 'endpoints': [{'internalURL': 'http://swift/swiftapi/internal', 'publicURL': 'http://swift/swiftapi/public', 'region': 'RegionOne', 'adminURL': 'http://swift/swiftapi/admin'}], 'name': 'swift'}]
TEST_URL = 'http://127.0.0.1:5000/v2.0'
setUp()
stub_auth(**kwargs)
test_authenticate_with_token()
test_authenticate_with_user_id_password()
test_authenticate_with_user_id_password_scoped()
test_authenticate_with_username_password()
test_authenticate_with_username_password_scoped()
test_doesnt_log_password()
test_endpoint_filter_without_service_type_fails()
test_full_url_overrides_endpoint_filter()
test_invalid_auth_response_dict()
test_invalid_auth_response_type()
test_invalidate_response()
test_password_with_no_user_id_or_name()
test_service_url()
test_service_url_defaults_to_public()
test_with_trust_id()

keystoneauth1.tests.unit.identity.test_identity_v3 module

class keystoneauth1.tests.unit.identity.test_identity_v3.V3IdentityPlugin(*args, **kwargs)

Bases: keystoneauth1.tests.unit.utils.TestCase

TEST_ADMIN_URL = 'http://127.0.0.1:35357/v3'
TEST_PASS = 'password'
TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
TEST_ROOT_URL = 'http://127.0.0.1:5000/'
TEST_SERVICE_CATALOG = [{'type': 'nova_compat', 'endpoints': [{'interface': 'public', 'url': 'http://cdn.admin-nets.local:8774/v1.0/', 'region': 'RegionOne'}, {'interface': 'internal', 'url': 'http://127.0.0.1:8774/v1.0', 'region': 'RegionOne'}, {'interface': 'admin', 'url': 'http://cdn.admin-nets.local:8774/v1.0', 'region': 'RegionOne'}]}, {'type': 'compute', 'endpoints': [{'interface': 'public', 'url': 'http://nova/novapi/public', 'region': 'RegionOne'}, {'interface': 'internal', 'url': 'http://nova/novapi/internal', 'region': 'RegionOne'}, {'interface': 'admin', 'url': 'http://nova/novapi/admin', 'region': 'RegionOne'}], 'name': 'nova'}, {'type': 'image', 'endpoints': [{'interface': 'public', 'url': 'http://glance/glanceapi/public', 'region': 'RegionOne'}, {'interface': 'internal', 'url': 'http://glance/glanceapi/internal', 'region': 'RegionOne'}, {'interface': 'admin', 'url': 'http://glance/glanceapi/admin', 'region': 'RegionOne'}], 'name': 'glance'}, {'type': 'identity', 'endpoints': [{'interface': 'public', 'url': 'http://127.0.0.1:5000/v3', 'region': 'RegionOne'}, {'interface': 'internal', 'url': 'http://127.0.0.1:5000/v3', 'region': 'RegionOne'}, {'interface': 'admin', 'url': 'http://127.0.0.1:35357/v3', 'region': 'RegionOne'}]}, {'type': 'object-store', 'endpoints': [{'interface': 'public', 'url': 'http://swift/swiftapi/public', 'region': 'RegionOne'}, {'interface': 'internal', 'url': 'http://swift/swiftapi/internal', 'region': 'RegionOne'}, {'interface': 'admin', 'url': 'http://swift/swiftapi/admin', 'region': 'RegionOne'}]}]
TEST_SERVICE_PROVIDERS = [{'auth_url': 'https://sp1.com/v3/OS-FEDERATION/identity_providers/acme/protocols/saml2/auth', 'sp_url': 'https://sp1.com/Shibboleth.sso/SAML2/ECP', 'id': 'sp1'}, {'auth_url': 'https://sp2.com/v3/OS-FEDERATION/identity_providers/acme/protocols/saml2/auth', 'sp_url': 'https://sp2.com/Shibboleth.sso/SAML2/ECP', 'id': 'sp2'}]
TEST_URL = 'http://127.0.0.1:5000/v3'
setUp()
stub_auth(subject_token=None, **kwargs)
test_authenticate_with_token()
test_authenticate_with_username_password()
test_authenticate_with_username_password_domain_scoped()
test_authenticate_with_username_password_project_scoped()
test_doesnt_log_password()
test_endpoint_filter_without_service_type_fails()
test_full_url_overrides_endpoint_filter()
test_handle_missing_service_provider()
test_invalid_auth_response_dict()
test_invalid_auth_response_type()
test_invalidate_response()
test_sends_nocatalog()
test_service_providers_urls()
test_service_url()
test_service_url_defaults_to_public()
test_symbols()
test_unscoped_request()
test_unscoped_with_scope_data()
test_with_domain_and_project_scoping()
test_with_expired()
test_with_multiple_mechanisms()
test_with_multiple_mechanisms_factory()
test_with_multiple_scopes()
test_with_trust_id()

keystoneauth1.tests.unit.identity.test_identity_v3_federation module

class keystoneauth1.tests.unit.identity.test_identity_v3_federation.K2KAuthPluginTest(*args, **kwargs)

Bases: keystoneauth1.tests.unit.utils.TestCase

REQUEST_ECP_URL = 'http://127.0.0.1:5000/v3/auth/OS-FEDERATION/saml2/ecp'
SERVICE_PROVIDER_DICT = {'auth_url': 'https://sp1.com/v3/OS-FEDERATION/identity_providers/testidp/protocols/saml2/auth', 'sp_url': 'https://sp1.com/Shibboleth.sso/SAML2/ECP', 'id': 'sp1'}
SP_AUTH_URL = 'https://sp1.com/v3/OS-FEDERATION/identity_providers/testidp/protocols/saml2/auth'
SP_ID = 'sp1'
SP_ROOT_URL = 'https://sp1.com/v3'
SP_URL = 'https://sp1.com/Shibboleth.sso/SAML2/ECP'
TEST_PASS = 'password'
TEST_ROOT_URL = 'http://127.0.0.1:5000/'
TEST_URL = 'http://127.0.0.1:5000/v3'
get_plugin(**kwargs)
setUp()
test_end_to_end_workflow()
test_fail_getting_ecp_assertion()
test_get_ecp_assertion_empty_response()
test_get_ecp_assertion_wrong_headers()
test_remote_url()
test_send_ecp_authn_response()
class keystoneauth1.tests.unit.identity.test_identity_v3_federation.TesterFederationPlugin(auth_url, identity_provider, protocol, **kwargs)

Bases: keystoneauth1.identity.v3.federation.FederationBaseAuth

get_unscoped_auth_ref(sess, **kwargs)
class keystoneauth1.tests.unit.identity.test_identity_v3_federation.V3FederatedPlugin(*args, **kwargs)

Bases: keystoneauth1.tests.unit.utils.TestCase

AUTH_URL = 'http://keystone/v3'
get_plugin(**kwargs)
setUp()
test_federated_url()
test_scoped_behaviour()
test_unscoped_behaviour()

keystoneauth1.tests.unit.identity.test_password module

class keystoneauth1.tests.unit.identity.test_password.PasswordTests(*args, **kwargs)

Bases: keystoneauth1.tests.unit.identity.utils.GenericPluginTestCase

PLUGIN_CLASS

alias of Password

V2_PLUGIN_CLASS

alias of Password

V3_PLUGIN_CLASS

alias of Password

new_plugin(**kwargs)
test_symbols()
test_v3_disocovery_failure_v2_url()
test_v3_domain_params_v2_url()
test_v3_user_params_v2_url()
test_with_user_domain_params()

keystoneauth1.tests.unit.identity.test_token module

class keystoneauth1.tests.unit.identity.test_token.TokenTests(*args, **kwargs)

Bases: keystoneauth1.tests.unit.identity.utils.GenericPluginTestCase

PLUGIN_CLASS

alias of Token

V2_PLUGIN_CLASS

alias of Token

V3_PLUGIN_CLASS

alias of Token

new_plugin(**kwargs)
test_symbols()

keystoneauth1.tests.unit.identity.utils module

class keystoneauth1.tests.unit.identity.utils.GenericPluginTestCase(*args, **kwargs)

Bases: keystoneauth1.tests.unit.utils.TestCase

PLUGIN_CLASS = None
TEST_URL = 'http://keystone.host:5000/'
V2_PLUGIN_CLASS = None
V3_PLUGIN_CLASS = None
assertCreateV2(**kwargs)
assertCreateV3(**kwargs)
assertDiscoveryFailure(**kwargs)
new_plugin(**kwargs)
setUp()
stub_discovery(base_url=None, **kwargs)
test_create_v2_if_no_domain_params()
test_create_v3_if_domain_params()
test_disc_error_for_failure()
test_no_urls()
test_path_based_url_v2()
test_path_based_url_v3()
test_unknown_discovery_version()
test_v2_params_v3_url()
test_v3_params_v2_url()
test_v3_plugin_from_failure()

Module contents