keystoneclient.tests.auth package

Submodules

keystoneclient.tests.auth.test_cli module

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

Bases: keystoneclient.tests.auth.utils.TestCase

setUp()
test_basic_params_added(*args, **kwargs)
test_creating_with_no_args()
test_default_options(*args, **kwargs)
test_load_with_nothing()
test_param_loading(*args, **kwargs)

keystoneclient.tests.auth.test_conf module

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

Bases: keystoneclient.tests.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.auth.test_identity_common module

class keystoneclient.tests.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 = 'ddc4e21ec88e45a19478e1a87574c105'
TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
TEST_ROOT_URL = 'http://127.0.0.1:5000/'
create_auth_plugin()

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.

setUp()
stub_auth_data()

Stub out authentication data.

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

test_discovering()
test_discovering_with_no_data()
test_discovery_uses_plugin_cache()
test_discovery_uses_session_cache()
version

The API version being tested.

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

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

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

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

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

keystoneclient.tests.auth.test_identity_v2 module

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

Bases: keystoneclient.tests.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(*args, **kw)
test_authenticate_with_username_password(*args, **kw)
test_authenticate_with_username_password_scoped(*args, **kw)
test_doesnt_log_password(*args, **kw)
test_endpoint_filter_without_service_type_fails(*args, **kw)
test_full_url_overrides_endpoint_filter(*args, **kw)
test_invalid_auth_response_dict(*args, **kw)
test_invalid_auth_response_type(*args, **kw)
test_invalidate_response(*args, **kw)
test_service_url()
test_service_url_defaults_to_public()
test_with_trust_id(*args, **kw)

keystoneclient.tests.auth.test_identity_v3 module

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

Bases: keystoneclient.tests.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(*args, **kw)
test_authenticate_with_username_password(*args, **kw)
test_authenticate_with_username_password_domain_scoped(*args, **kw)
test_authenticate_with_username_password_project_scoped(*args, **kw)
test_doesnt_log_password(*args, **kw)
test_endpoint_filter_without_service_type_fails(*args, **kw)
test_full_url_overrides_endpoint_filter(*args, **kw)
test_invalid_auth_response_dict(*args, **kw)
test_invalid_auth_response_type(*args, **kw)
test_invalidate_response(*args, **kw)
test_service_url()
test_service_url_defaults_to_public()
test_with_domain_and_project_scoping()
test_with_expired(*args, **kw)
test_with_multiple_mechanisms(*args, **kw)
test_with_multiple_mechanisms_factory(*args, **kw)
test_with_multiple_scopes()
test_with_trust_id(*args, **kw)

keystoneclient.tests.auth.test_token_endpoint module

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

Bases: keystoneclient.tests.utils.TestCase

TEST_TOKEN = 'aToken'
TEST_URL = 'http://server/prefix'
test_basic_case(*args, **kw)
test_basic_endpoint_case(*args, **kw)

keystoneclient.tests.auth.utils module

class keystoneclient.tests.auth.utils.MockManager(driver)

Bases: object

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

Bases: keystoneclient.auth.base.BaseAuthPlugin

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

Bases: keystoneclient.tests.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.auth.utils.mock_plugin(f)

Module contents