Utility methods to set testcases up for Swift tests.
Version-independent api tests
Bases: glance.tests.functional.FunctionalTest
Assert GET /images with no Accept: header. Verify version choices returned.
Assert GET /images with a Accept: application/vnd.openstack.compute-v1 header. Verify version choices returned. Verify message in API log about unknown accept header.
Assert GET /images with a Accept: application/vnd.openstack.compute-v2 header. Verify version choices returned. Verify message in API log about unknown version in accept header.
Assert GET / with no Accept: header. Verify version choices returned. Bug lp:803260 no Accept header causes a 500 in glance-api
Assert GET / with an Accept: application/vnd.openstack.images-v1 Verify empty image list returned
Assert GET / with Accept: unknown header Verify version choices returned. Verify message in API log about unknown accept header.
Assert GET /v1.0/images with no Accept: header Verify version choices returned
Assert GET /v1.2/images with no Accept: header Verify version choices returned
GET /v1/images with no Accept: header. Verify empty images list returned.
Assert GET /v1/versions with no Accept: header Verify 404 returned
Assert GET /v1.a/images with no Accept: header Verify version choices returned
Assert GET /va.1/images with no Accept: header Verify version choices returned
Functional test case that utilizes the bin/glance-cache-manage CLI tool
Bases: glance.tests.functional.FunctionalTest
Functional tests for the bin/glance CLI tool
Tests a Glance API server which uses the caching middleware that uses the default SQLite cache driver. We use the filesystem store, but that is really not relevant, as the image cache is transparent to the backend store.
Bases: object
Base test class for testing cache management middleware
Tests that cached images may be deleted
Tests that all queued images may be deleted at once
Bases: object
Ensure the image v1 API image transfer applied ‘download_image’ policy enforcement.
Ensure the image v2 API image transfer applied ‘download_image’ policy enforcement.
Ensure the image v1/v2 API image transfer forbids downloading deactivated images. Image deactivation is not available in v1. So, we’ll deactivate the image using v2 but test image transfer with both v1 and v2.
We test that putting the cache middleware into the application pipeline gives us transparent image caching
Bases: glance.tests.functional.FunctionalTest, glance.tests.functional.test_cache_middleware.BaseCacheManageMiddlewareTest
Functional tests that exercise the image cache management using the SQLite driver
Bases: glance.tests.functional.FunctionalTest, glance.tests.functional.test_cache_middleware.BaseCacheManageMiddlewareTest
Functional tests that exercise the image cache management with the Xattr cache driver
Bases: glance.tests.functional.FunctionalTest, glance.tests.functional.test_cache_middleware.BaseCacheMiddlewareTest
Functional tests that exercise the image cache using the SQLite driver
Bases: glance.tests.functional.FunctionalTest, glance.tests.functional.test_cache_middleware.BaseCacheMiddlewareTest
Functional tests that exercise the image cache using the xattr driver
Functional test asserting strongly typed exceptions from glance client
Bases: object
Test WSGI application which can respond with multiple kinds of HTTP status codes
Bases: glance.tests.functional.FunctionalTest
Verify that the wsgi server does not return tracebacks to the client on 500 errors (bug 1192132)
Test service unavailable response
Test service unavailable response with retry
Functional test cases testing glance client redirect-following.
Tests cors middleware.
Bases: glance.tests.functional.FunctionalTest
Provide a basic smoke test to ensure CORS middleware is active.
The tests below provide minimal confirmation that the CORS middleware is active, and may be configured. For comprehensive tests, please consult the test suite in oslo_middleware.
Functional test cases for glance-manage
Functional test cases for glance-replicator
Bases: glance.tests.functional.FunctionalTest
Functional tests for glance-replicator
Tests gzip middleware.
Tests healthcheck middleware.
Functional test case that tests logging output
Bases: glance.tests.functional.FunctionalTest
Functional tests for Glance’s logging output
Bases: glance.tests.functional.FunctionalTest
Test configuration reload
Allows repeatedly testing for an expected result for a finite amount of time.
Parameters: |
|
---|---|
Returns: | ‘True’ or fails the test with ‘message’ on timeout |
Bases: glance.tests.functional.FunctionalTest
Test that delayed_delete works and the scrubber deletes
test that images don’t get deleted immediately and that the scrubber scrubs them
test that images don’t get deleted immediately and that the scrubber scrubs them when registry is operating in trustedauth mode
test that the glance-scrubber script runs successfully when not in daemon mode
test that the glance-scrubber script runs successfully when not in daemon mode and with a registry that operates in trustedauth mode
Functional test cases for sqlite-specific logic
Bases: glance.tests.functional.FunctionalTest
Functional tests for sqlite-specific logic
Tests for glance.wsgi.
Base test class for running non-stubbed tests (functional tests)
The FunctionalTest class contains helper methods for starting the API and Registry server, grabbing the logs of each, cleaning up pidfiles, and spinning down the servers.
Bases: glance.tests.functional.Server
Server object that starts/stops/manages the API server
Bases: glance.tests.utils.BaseTestCase
Base test class for any test that wants to test the actual servers and clients and not just the stubbed out interfaces
Makes sure anything we created or started up in the tests are destroyed or spun down
Simple ping on the port. If responsive, return True, else return False.
:note We use raw sockets, not ping here, since ping uses ICMP and has no concept of ports...
Provides a crude mechanism to run manual SQL commands for backend DB verification within the functional tests. The raw result set is returned.
Starts a server on an unused port.
Any kwargs passed to this method will override the configuration value in the conf file used in starting the server.
Parameters: |
|
---|
Starts the API and Registry servers (glance-control api start & glance-control registry start) on unused ports. glance-control should be installed into the python path
Any kwargs passed to this method will override the configuration value in the conf file used in starting the servers.
Starts a server, with retries if the server launches but fails to start listening on the expected port.
Parameters: |
|
---|
Called to stop a single server in a normal fashion using the glance-control stop method to gracefully shut the server down.
Parameters: | server – the server to stop |
---|
Called to stop the started servers in a normal fashion. Note that cleanup() will stop the servers using a fairly draconian method of sending a SIGTERM signal to the servers. Here, we use the glance-control stop method to gracefully shut the server down. This method also asserts that the shutdown was clean, and so it is meant to be called during a normal test case sequence.
Tight loop, waiting for the given server port(s) to be available. Returns when all are pingable. There is a timeout on waiting for the servers to come up.
Parameters: |
|
---|---|
Returns: | None if launch expectation is met, otherwise an assertion message |
Bases: glance.tests.functional.Server
Server object that starts/stops/manages the Registry server
Bases: glance.tests.functional.Server
Server object that starts/stops/manages the Scrubber server
Bases: object
Class used to easily manage starting and stopping a server during functional test runs.
Start and stop the service to reload
Any kwargs passed to this method will override the configuration value in the conf file used in starting the servers.