Tests dealing with HTTP rate-limiting.
Bases: nova.test.TestCase
Base test suite which provides relevant stubs and time abstraction.
Bases: object
Fake httplib.HTTPConnection.
Return our generated response from the request.
Requests made via this connection actually get translated and routed into our WSGI app, we then wait for the response and turn it back into an httplib.HTTPResponse.
Bases: object
Fake httplib.HTTPResponse replacement.
Returns the socket’s internal buffer.
Bases: nova.tests.api.openstack.compute.test_limits.BaseLimitTestSuite
Tests for the limits.RateLimitingMiddleware class.
Prepare middleware for use through fake WSGI app.
Bases: nova.tests.api.openstack.compute.test_limits.BaseLimitTestSuite
Tests for the limits.Limit class.
Bases: nova.tests.api.openstack.compute.test_limits.BaseLimitTestSuite
Tests for the in-memory limits.Limiter class.
Run before each test.
Ensure the 8th POST will result in a delay of 6.0 seconds until the next request will be granced.
Ensure the 11th PUT will result in a delay of 6.0 seconds until the next request will be granced.
Ensure PUT on /servers limits at 5 requests, and PUT elsewhere is still OK after 5 requests...but then after 11 total requests, PUT limiting kicks in.
Ensure after hitting the limit and then waiting for the correct amount of time, the limit will be lifted.
Simple test to ensure no delay on a single call for a limit verb we didn”t set.
Bases: nova.tests.api.openstack.compute.test_limits.BaseLimitTestSuite
Tests for limits.LimitsController class.
Run before each test.
Bases: nova.test.TestCase
Bases: nova.test.TestCase
Bases: nova.tests.api.openstack.compute.test_limits.BaseLimitTestSuite
Tests for the default limits parser in the in-memory limits.Limiter class.
Bases: nova.tests.api.openstack.compute.test_limits.BaseLimitTestSuite
Tests for the limits.WsgiLimiterProxy class.
Do some nifty HTTP/WSGI magic which allows for WSGI to be called directly by something like the httplib library.
Bases: nova.tests.api.openstack.compute.test_limits.BaseLimitTestSuite
Tests for limits.WsgiLimiter class.
Run before each test.
Monkeypatches HTTPConnection so that if you try to connect to host, you are instead routed straight to the given WSGI app.
After calling this method, when any code calls
httplib.HTTPConnection(host)
the connection object will be a fake. Its requests will be sent directly to the given WSGI app rather than through a socket.
Code connecting to hosts other than host will not be affected.
This method may be called multiple times to map different hosts to different apps.
This method returns the original HTTPConnection object, so that the caller can restore the default HTTPConnection interface (for all hosts).