Bases: fixtures.fixture.Fixture
Example tokens and certs loaded from the examples directory.
To use this class correctly, the module needs to override the test suite class to use testresources.OptimisingTestSuite (otherwise the files will be read on every test). This is done by defining a load_tests function in the module, like this:
(see http://docs.python.org/2/library/unittest.html#load-tests-protocol )
A fake server that “responds” to API methods with pre-canned responses.
All of these responses come from the spec, so if for some reason the spec’s wrong the tests might raise AssertionError. I’ve indicated in comments the places where actual behavior differs from the spec.
Bases: object
Assert than an API method was just called.
Assert than an API method was called anytime in the test.
Bases: testtools.testcase.TestCase
Base test class for auth_token middleware.
All the tests allow for running with auth_token configured for receiving v2 or v3 tokens, with the choice being made by passing configuration data into Setup().
The base class will, by default, run all the tests expecting v2 token formats. Child classes can override this to specify, for instance, v3 format.
Configure the class ready to call the auth_token middleware.
Set up the various fake items needed to run the middleware. Individual tests that need to further refine these can call this function to override the class defaults.
Bases: object
Test to don’t cache token as invalid on network errors.
We use UUID tokens since they are the easiest one to reach get_http_connection.
Bases: keystoneclient.tests.test_auth_token_middleware.BaseAuthTokenMiddlewareTest, testresources.ResourcedTestCase
Test forcing auth_token to use lower api version.
By installing the v3 http hander, auth_token will be get a version list that looks like a v3 server - from which it would normally chose v3.0 as the auth version. However, here we specify v2.0 in the configuration - which should force auth_token to use that version instead.
Bases: keystoneclient.tests.test_auth_token_middleware.BaseAuthTokenMiddlewareTest, testresources.ResourcedTestCase
Auth Token middleware should understand Diablo keystone responses.
Bases: fixtures.fixture.Fixture
A fixture to provide support for unloading/disabling modules.
Ensure ImportError for the specified module.
Bases: object
This represents a WSGI app protected by the auth_token middleware.
Bases: keystoneclient.tests.test_auth_token_middleware.BaseAuthTokenMiddlewareTest, testresources.ResourcedTestCase
Bases: keystoneclient.tests.test_auth_token_middleware.BaseAuthTokenMiddlewareTest
Bases: object
Disallow further imports of ‘module’.
Bases: fixtures.fixture.Fixture
Bases: testtools.testcase.TestCase
Bases: keystoneclient.tests.test_auth_token_middleware.BaseAuthTokenMiddlewareTest
Ensure we cannot retrieve a token from the cache.
Getting a token from the cache should return None when the token data in the cache stores the expires time as a *nix style timestamp.
Bases: keystoneclient.tests.test_auth_token_middleware.BaseAuthTokenMiddlewareTest, testresources.ResourcedTestCase
Bases: keystoneclient.tests.test_auth_token_middleware.V2CertDownloadMiddlewareTest
Do a sanity check against memcached.
Returns True if the following conditions are met (otherwise, returns False):
Bases: keystoneclient.tests.test_auth_token_middleware.BaseAuthTokenMiddlewareTest, keystoneclient.tests.test_auth_token_middleware.CommonAuthTokenMiddlewareTest, testresources.ResourcedTestCase
v2 token specific tests.
There are some differences between how the auth-token middleware handles v2 and v3 tokens over and above the token formats, namely:
The tests below were originally part of the generic AuthTokenMiddlewareTest class, but now, since they really are v2 specifc, they are included here.
Unscoped v2 requests with a default tenant should “auto-scope.”
The implied scope is the user’s tenant ID.
Unscoped requests with no default tenant ID should be rejected.
Bases: keystoneclient.tests.test_auth_token_middleware.BaseAuthTokenMiddlewareTest, keystoneclient.tests.test_auth_token_middleware.CommonAuthTokenMiddlewareTest, testresources.ResourcedTestCase
Test auth_token middleware with v3 tokens.
Re-execute the AuthTokenMiddlewareTest class tests, but with the the auth_token middleware configured to expect v3 tokens back from a keystone server.
This is done by configuring the AuthTokenMiddlewareTest class via its Setup(), passing in v3 style data that will then be used by the tests themselves. This approach has been used to ensure we really are running the same tests for both v2 and v3 tokens.
There a few additional specific test for v3 only:
Since we don’t specify an auth version for auth_token to use, by definition we are thefore implicitely testing that it will use the highest available auth version, i.e. v3.0
Bases: keystoneclient.tests.test_auth_token_middleware.FakeApp
This represents a v3 WSGI app protected by the auth_token middleware.
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.base.Resource
Bases: keystoneclient.tests.utils.TestCase, testresources.ResourcedTestCase
Unit tests for the keystoneclient.common.cms module.
The default hash method is md5.
If the token_id is not a PKI token then it returns the token_id.
Can also hash with sha256.
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase
Bases: testtools.testcase.TestCase
Test generate function for v0 signature.
Test generate function for v1 signature.
Test generate function for v2 signature, SHA1.
Test generate function for v2 signature, SHA256.
Test v4 generator with data from AWS docs example.
see: http://docs.aws.amazon.com/general/latest/gr/ sigv4-create-canonical-request.html and http://docs.aws.amazon.com/general/latest/gr/ sigv4-signed-request-examples.html
Test v4 generator with host:port format.
Test v4 generator with host:port format, but for an new (>=2.9.3) version of boto, where the port should not be stripped.
Test v4 generator with host:port format, but for an old (<2.9.3) version of boto, where the port should be stripped to match boto behavior.
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase
Bases: object
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase
Ensure that if we don’t have use_keyring set in the client that the keyring is never accessed.
Bases: object
This represents a WSGI app protected by the auth_token middleware.
Bases: keystoneclient.tests.test_s3_token_middleware.S3TokenMiddlewareTestBase
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.auth.base.BaseAuthPlugin
Very simple debug authentication plugin.
Takes Parameters such that it can throw exceptions at the right times.
Bases: keystoneclient.auth.base.BaseAuthPlugin
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase
Bases: argparse.ArgumentParser
Bases: keystoneclient.tests.utils.TestCase
Test a corner case where –tenant_id appears on the command-line twice.
Test user-create args.
Bases: object
alias of FakeResource
Bases: object
Bases: object
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase, testresources.ResourcedTestCase
Unit tests for utils.hash_signed_token().
The default hash method is md5.
Can also hash with sha256.
Bases: keystoneclient.tests.utils.TestCase
Bases: keystoneclient.tests.utils.TestCase
Bases: testtools.testcase.TestCase
Verify the QueryString matches what is expected.
The qs parameter should be of the format ‘foo=bar&abc=xyz’
Verify that the last request made contains a header and its value
The request must have already been made and httpretty must have been activated for the request.