keystoneclient.tests.unit.auth package

Submodules

keystoneclient.tests.unit.auth.test_access module

class keystoneclient.tests.unit.auth.test_access.AccessInfoPluginTests(*args, **kwargs)

Bases: keystoneclient.tests.unit.utils.TestCase

setUp()
test_auth_ref()
test_auth_url()
test_invalidate()

keystoneclient.tests.unit.auth.test_cli module

class keystoneclient.tests.unit.auth.test_cli.CliTests(*args, **kwargs)

Bases: keystoneclient.tests.unit.auth.utils.TestCase

env(name, value=None)
setUp()
test_basic_params_added(*args, **kwargs)
test_creating_with_no_args()
test_default_options(*args, **kwargs)
test_deprecated_cli_options()
test_deprecated_env_multi_options()
test_deprecated_env_options()
test_deprecated_multi_cli_options()
test_env_overrides_default_opt(*args, **kwargs)
test_load_with_nothing()
test_overrides_default_string_value(*args, **kwargs)
test_overrides_default_type_value(*args, **kwargs)
test_param_loading(*args, **kwargs)
test_with_default_string_value(*args, **kwargs)
test_with_default_type_value(*args, **kwargs)
class keystoneclient.tests.unit.auth.test_cli.TesterPlugin

Bases: keystoneclient.auth.base.BaseAuthPlugin

classmethod get_options()
get_token(*args, **kwargs)

keystoneclient.tests.unit.auth.test_conf module

class keystoneclient.tests.unit.auth.test_conf.ConfTests(*args, **kwargs)

Bases: keystoneclient.tests.unit.auth.utils.TestCase

setUp()
test_diff_section(*args, **kwargs)
test_get_common()
test_get_named()
test_loading_invalid_plugin()
test_loading_v2()
test_loading_v3()
test_loading_with_no_data()
test_other_params(*args, **keywargs)
test_plugins_are_all_opts()
test_same_section(*args, **kwargs)

keystoneclient.tests.unit.auth.test_identity_common module

class keystoneclient.tests.unit.auth.test_identity_common.CatalogHackTests(*args, **kwargs)

Bases: keystoneclient.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_returns_original_when_discover_fails()
class keystoneclient.tests.unit.auth.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 = 'bf0a4919683c412ab0993d9dc91fc96b'
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 keystoneclient.tests.unit.auth.test_identity_common.GenericAuthPluginTests(*args, **kwargs)

Bases: keystoneclient.tests.unit.utils.TestCase

ENDPOINT_FILTER = {'9b62bc586e7348d89cbd968b3e80957a': '4e5776ab46c84eb18b3b813b06240ca8'}
setUp()
test_setting_headers()
class keystoneclient.tests.unit.auth.test_identity_common.GenericPlugin

Bases: keystoneclient.auth.base.BaseAuthPlugin

BAD_TOKEN = '694b2f316c6f45e2bccd2660326c20a0'
get_endpoint(session, **kwargs)
get_headers(session, **kwargs)
get_token(session, **kwargs)
url(prefix)
class keystoneclient.tests.unit.auth.test_identity_common.V2(*args, **kwargs)

Bases: keystoneclient.tests.unit.auth.test_identity_common.CommonIdentityTests, keystoneclient.tests.unit.utils.TestCase

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

Bases: keystoneclient.tests.unit.auth.test_identity_common.CommonIdentityTests, keystoneclient.tests.unit.utils.TestCase

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

keystoneclient.tests.unit.auth.test_identity_v2 module

class keystoneclient.tests.unit.auth.test_identity_v2.V2IdentityPlugin(*args, **kwargs)

Bases: keystoneclient.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 = [{'endpoints': [{'adminURL': 'http://cdn.admin-nets.local:8774/v1.0', 'region': 'RegionOne', 'internalURL': 'http://127.0.0.1:8774/v1.0', 'publicURL': 'http://cdn.admin-nets.local:8774/v1.0/'}], 'type': 'nova_compat', 'name': 'nova_compat'}, {'endpoints': [{'adminURL': 'http://nova/novapi/admin', 'region': 'RegionOne', 'internalURL': 'http://nova/novapi/internal', 'publicURL': 'http://nova/novapi/public'}], 'type': 'compute', 'name': 'nova'}, {'endpoints': [{'adminURL': 'http://glance/glanceapi/admin', 'region': 'RegionOne', 'internalURL': 'http://glance/glanceapi/internal', 'publicURL': 'http://glance/glanceapi/public'}], 'type': 'image', 'name': 'glance'}, {'endpoints': [{'adminURL': 'http://127.0.0.1:35357/v2.0', 'region': 'RegionOne', 'internalURL': 'http://127.0.0.1:5000/v2.0', 'publicURL': 'http://127.0.0.1:5000/v2.0'}], 'type': 'identity', 'name': 'keystone'}, {'endpoints': [{'adminURL': 'http://swift/swiftapi/admin', 'region': 'RegionOne', 'internalURL': 'http://swift/swiftapi/internal', 'publicURL': 'http://swift/swiftapi/public'}], 'type': 'object-store', '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()

keystoneclient.tests.unit.auth.test_identity_v3 module

class keystoneclient.tests.unit.auth.test_identity_v3.V3IdentityPlugin(*args, **kwargs)

Bases: keystoneclient.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 = [{'endpoints': [{'url': 'http://cdn.admin-nets.local:8774/v1.0/', 'interface': 'public', 'region': 'RegionOne'}, {'url': 'http://127.0.0.1:8774/v1.0', 'interface': 'internal', 'region': 'RegionOne'}, {'url': 'http://cdn.admin-nets.local:8774/v1.0', 'interface': 'admin', 'region': 'RegionOne'}], 'type': 'nova_compat'}, {'endpoints': [{'url': 'http://nova/novapi/public', 'interface': 'public', 'region': 'RegionOne'}, {'url': 'http://nova/novapi/internal', 'interface': 'internal', 'region': 'RegionOne'}, {'url': 'http://nova/novapi/admin', 'interface': 'admin', 'region': 'RegionOne'}], 'type': 'compute', 'name': 'nova'}, {'endpoints': [{'url': 'http://glance/glanceapi/public', 'interface': 'public', 'region': 'RegionOne'}, {'url': 'http://glance/glanceapi/internal', 'interface': 'internal', 'region': 'RegionOne'}, {'url': 'http://glance/glanceapi/admin', 'interface': 'admin', 'region': 'RegionOne'}], 'type': 'image', 'name': 'glance'}, {'endpoints': [{'url': 'http://127.0.0.1:5000/v3', 'interface': 'public', 'region': 'RegionOne'}, {'url': 'http://127.0.0.1:5000/v3', 'interface': 'internal', 'region': 'RegionOne'}, {'url': 'http://127.0.0.1:35357/v3', 'interface': 'admin', 'region': 'RegionOne'}], 'type': 'identity'}, {'endpoints': [{'url': 'http://swift/swiftapi/public', 'interface': 'public', 'region': 'RegionOne'}, {'url': 'http://swift/swiftapi/internal', 'interface': 'internal', 'region': 'RegionOne'}, {'url': 'http://swift/swiftapi/admin', 'interface': 'admin', 'region': 'RegionOne'}], 'type': 'object-store'}]
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_authenticate_with_username_password_unscoped()
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_sends_nocatalog()
test_service_url()
test_service_url_defaults_to_public()
test_symbols()
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()

keystoneclient.tests.unit.auth.test_identity_v3_federated module

class keystoneclient.tests.unit.auth.test_identity_v3_federated.TesterFederationPlugin(auth_url, identity_provider, protocol, **kwargs)

Bases: keystoneclient.auth.identity.v3.federated.FederatedBaseAuth

get_unscoped_auth_ref(sess, **kwargs)
class keystoneclient.tests.unit.auth.test_identity_v3_federated.V3FederatedPlugin(*args, **kwargs)

Bases: keystoneclient.tests.unit.utils.TestCase

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

keystoneclient.tests.unit.auth.test_password module

class keystoneclient.tests.unit.auth.test_password.PasswordTests(*args, **kwargs)

Bases: keystoneclient.tests.unit.auth.utils.GenericPluginTestCase

PLUGIN_CLASS

alias of Password

V2_PLUGIN_CLASS

alias of Password

V3_PLUGIN_CLASS

alias of Password

new_plugin(**kwargs)
test_options()
test_symbols()
test_v3_user_params_v2_url()
test_with_user_domain_params()

keystoneclient.tests.unit.auth.test_token module

class keystoneclient.tests.unit.auth.test_token.TokenTests(*args, **kwargs)

Bases: keystoneclient.tests.unit.auth.utils.GenericPluginTestCase

PLUGIN_CLASS

alias of Token

V2_PLUGIN_CLASS

alias of Token

V3_PLUGIN_CLASS

alias of Token

new_plugin(**kwargs)
test_options()
test_symbols()

keystoneclient.tests.unit.auth.test_token_endpoint module

class keystoneclient.tests.unit.auth.test_token_endpoint.TokenEndpointTest(*args, **kwargs)

Bases: keystoneclient.tests.unit.utils.TestCase

TEST_TOKEN = 'aToken'
TEST_URL = 'http://server/prefix'
test_basic_case()
test_basic_endpoint_case()
test_token_endpoint_options()
test_token_endpoint_user_id()

keystoneclient.tests.unit.auth.utils module

class keystoneclient.tests.unit.auth.utils.GenericPluginTestCase(*args, **kwargs)

Bases: keystoneclient.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()
class keystoneclient.tests.unit.auth.utils.MockManager(driver)

Bases: object

class keystoneclient.tests.unit.auth.utils.MockPlugin(**kwargs)

Bases: keystoneclient.auth.base.BaseAuthPlugin

BOOL_DESC = 'test bool'
FLOAT_DESC = 'test float'
INT_DESC = 'test int'
STR_DEFAULT = 'e89fcdcc61834215bac7b9b658d39ef7'
STR_DESC = 'test str'
get_endpoint(*args, **kwargs)
classmethod get_options()
get_token(*args, **kwargs)
class keystoneclient.tests.unit.auth.utils.TestCase(*args, **kwargs)

Bases: keystoneclient.tests.unit.utils.TestCase

GROUP = 'auth'
TEST_VALS = {'a_int': 88, 'a_bool': False, 'a_float': 88.8}
V2PASS = 'v2password'
V3TOKEN = 'v3token'
a_bool = False
a_float = 88.8
a_int = 88
assertTestVals(plugin, vals={'a_int': 88, 'a_bool': False, 'a_float': 88.8})
keystoneclient.tests.unit.auth.utils.mock_plugin(f)

Module contents