Bases: glance.tests.unit.base.IsolatedUnitTest
Ensure that updating image properties enforces the quota.
Bases: glance.tests.unit.base.IsolatedUnitTest
Verify a property protected by special char ‘!’ is creatable by no one
Verify property marked with special char ‘@’ is creatable by an unknown role
Verify that role check is case-insensitive i.e. the property marked with role Member is creatable by the member role
Verify a property protected by special char ‘!’ is deletable by no one
Verify property marked with special char ‘@’ is deletable by an unknown role
Verify that role check is case-insensitive i.e. the property marked with role Member is deletable by the member role
Create an image with two props - one only readable by admin, and one readable/deletable by member. Verify member can successfully delete their property while the admin owned one is ignored transparently
Create an image with two props - one readable/deletable by admin, but also readable by spl_role. The other is readable/deletable by spl_role. Verify spl_role is forbidden to purge_props in this scenario without retaining the readable prop.
Test protected property update is allowed as long as the user has read access and the value is unchanged
Test protected property cannot be updated without read permission
As admin role, create an image and verify permitted role ‘member’ can create a protected property
As admin role, create an image and verify unpermitted role ‘fake_member’ can not create a protected property
As admin role, create an image with protected property, and verify permitted role ‘member’ can can delete that protected property
As admin role, create an image with protected property, and verify permitted role ‘member’ can can delete that protected property
Test protected property cannot be deleted without delete permission
Test protected property cannot be deleted without read permission
As admin role, create an image with a protected property, and verify permitted role ‘member’ can read that protected property via /images/detail
As admin role, create an image with a protected property, and verify permitted role ‘member’ can read that protected property via /images/detail
As admin role, create an image with a protected property, and verify permitted role ‘fake_role’ can not read that protected property via /images/detail
As admin role, create an image with a protected property, and verify permitted role ‘fake_role’ can not read that protected property via /images/detail
As admin role, create an image with a protected property, and verify permitted role ‘member’ can read that protected property via GET
As admin role, create an image with a protected property, and verify permitted role ‘fake_role’ can not read that protected property via GET
As admin role, create an image and verify permitted role ‘member’ can create a protected property
As admin role, create an image with a protected property, and verify permitted role ‘member’ can read that protected property via HEAD
As admin role, create an image with a protected property, and verify permitted role ‘fake_role’ can not read that protected property via HEAD
As admin role, create an image with protected property, and verify permitted role ‘admin’ can update that protected property
As admin role, create an image with protected property, and verify permitted role ‘member’ can update that protected property
As admin role, create an image with protected property, and verify unpermitted role ‘fake_role’ can not update that protected property
As admin role, create an image with protected property, and verify unpermitted role ‘fake_role’ can not update that protected property
Verify a property protected by special char ‘!’ is readable by no one
Verify property marked with special char ‘@’ is readable by an unknown role
Verify that role check is case-insensitive i.e. the property marked with role Member is readable by the member role
Verify when updating props that ones we don’t have read permission for are not disclosed
Verify a property protected by special char ‘!’ is updatable by no one
Verify property marked with special char ‘@’ is updatable by an unknown role
Verify that role check is case-insensitive i.e. the property marked with role Member is updatable by the member role
Bases: glance.tests.unit.base.IsolatedUnitTest
Tests user cannot update immutable props of active image
Tests creates an image from copy-from and nonempty body
Tests creates an image from copy-from with restricted sources
Tests creates a queued image for no body and no loc header
Tests creates a queued image for no body and no loc header
Tests raises BadRequest for supplied image size that is too big
Tests creates an image from location and conflict image size
Tests creates an image from location and conflict image size
Tests creates an image from location and restricted sources
Tests creates an image from location and nonempty body
Tests adding image members raises right exception
Test that the image contents are checksummed properly
Tests adding members to deleted image raises 404.
Tests user cannot update immutable props of deactivated image
Tests deleting members of deleted image raises 404.
Tests deleting image members raises right exception
Tests that correct response returned when deleting a pending_delete image
Delete an image in a queued state
Bug #747799 demonstrated that trying to DELETE an image that had had its save process killed manually results in failure because the location attribute is None.
Bug #1048851 demonstrated that the status was not properly being updated to ‘deleted’ from ‘queued’.
Delete an image in a queued state when delayed_delete is on
Bug #1048851 demonstrated that the status was not properly being updated to ‘deleted’ from ‘queued’.
Test the special x-glance-registry-purge-props header controls the purge property behaviour of the registry. :see LP Bug#901534
Tests exception raised trying to download a deactivated image
Test image download returns HTTPServiceUnavailable.
Test that the ETag header matches the x-image-meta-checksum
Tests that the /images/detail API returns list of images that changed since the time defined by changes-since
Tests that the /images/detail API returns a 400 when an invalid marker is provided
Tests proper exception is raised if attempt to get members of non-existing image
Check that image filtering works on user-defined properties
Tests that the /images API returns list of public images sorted alphabetically by name in ascending order.
Tests members listing for deleted image raises 404.
Tests that the image status set to active if deletion of image fails.
Tests creation of an image with missing container format
Tests creation of an image with missing disk format
Tests admin can update ‘immutable’ props of active image
Tests admin can update ‘immutable’ props of deactivated image
Create a non-public image then fail to make public
Tests delayed activation of image with missing container format
Tests delayed activation of image with missing disk format
Test that the process of registering an image with some metadata, then uploading an image file with some more metadata doesn’t mark the original metadata deleted :see LP Bug#901534
Tests replacing image members raises bad request if body is wrong
Tests replacing image members raises right exception
Test that the internal store location is NOT revealed through the API server
Tests raises BadRequest for supplied image size that is too big
Tests update members of deleted image raises 404.
Bases: glance.tests.unit.base.IsolatedUnitTest, glance.tests.utils.RegistryAPIMixIn
Test update image members raises right exception
Test check that the same member can be successfully added after delete it, and the same record will be reused for the same membership.
Test check that member can’t be added for non exist image
Tests proper exception is raised if a bad disk_format is set
Tests proper exception is raised if a bad status is set
Tests correct image id in log message when creating image
Tests that the /images POST registry API creates the image
Tests that the /images POST registry API creates the image
Tests that the /images POST registry API creates the image
Tests that the /images POST registry API creates the image
Test delete image members raises right exception
Tests proper exception is raised if attempt to delete non-existing image
Tests deleting image members raises right exception
Tests deleting a invalid/non existing member raises right exception
Tests proper exception is raised if attempt to delete private image with non admin user, that not belongs to it
Tests proper exception is raised if attempt to delete public image with non admin user
Tests that the /images/detail registry API returns a mapping containing a list of detailed image information
Tests that the /images/detail registry API returns list of images that changed since the time defined by changes-since
Tests that the /images/detail registry API returns list of public images that have a specific container_format
Test that the /images/detail registry API return list of images with deleted filter = false
Tests that the /images/detail registry API returns list of public images that have a specific disk_format
Tests that the /images/detail registry API returns list of public images that have a specific min_disk
Tests that the /images/detail registry API returns list of public images that have a specific min_ram
Tests that the /images/detail registry API returns list of public images that have a specific name
Tests that the /images/detail registry API returns list of public images that have a specific custom property
Tests that the /images/detail registry API returns list of private images if is_public false is passed
Tests that the /images/detail registry API returns list of all images if is_public none is passed
Tests that the /images/detail registry API returns 400 Bad error for filter is_public with wrong format
Tests that the /images/detail registry API returns list of public images if is_public true is passed (same as default)
Tests that the /images/detail registry API returns list of public images that have a size less than or equal to size_max
Tests that the /images/detail registry API returns list of public images that have a size greater than or equal to size_min
Tests that the /images/detail registry API returns list of public images that have a size less than or equal to size_max and greater than or equal to size_min
Tests that the /images/detail registry API returns list of public images that have a specific status
Tests that the /images/detail registry API returns a 400 when a forbidden marker is provided
Tests that the /images/detail registry API returns a 400 when an invalid marker is provided
Tests that the /images/details registry API returns list of public images that conforms to limit and marker query params. This functionality is tested more thoroughly on /images, this is just a sanity check
Tests that the /images/detail registry API returns a 400 when a malformed marker is provided
Tests that the /images/details registry API returns list of public images sorted alphabetically by name in ascending order.
Tests that the /images/detail registry API returns list of public images if is_public true is passed (same as default)
Tests that the /images/detail registry API returns 400 error
Tests that the /images/detail registry API returns 400 error
Tests proper exception is raised if attempt to get members of non-existing image
Tests proper exception is raised if attempt to get members of non-existing image
Tests that the /images registry API returns list of public images that have a specific name. This is really a sanity check, filtering is tested more in-depth using /images/detail
Tests that /images registry API returns list of public images based a filter on user-defined properties.
Tests that the /images registry API returns a 400 when a forbidden marker is provided
Tests that the /images registry API returns list of public images that conforms to a limit query param
Tests that the /images registry API returns list of public images that conforms to limit and marker query params
Tests that the /images registry API returns list of public images that conforms to a limit query param
Tests that the /images registry API returns list of public images that conforms to a limit query param
Tests that the /images registry API returns a 400 when a malformed marker is provided
Tests that the /images registry API returns list of public images that conforms to a marker query param
Check 200 is returned when sort_key is null container_format
Check 200 is returned when sort_key is container_format and container_format is null for specified marker
Check 200 is returned when sort_key is null disk_format
Check 200 is returned when sort_key is disk_format and disk_format is null for specified marker
Check 200 is returned when sort_key is null name
Check 200 is returned when sort_key is name and name is null for specified marker
Tests that the /images registry API returns list of public images sorted alphabetically by container_format in descending order.
Tests that the /images registry API returns list of public images sorted by created_at in ascending order.
Tests that the /images registry API returns list of public images that conforms to a default sort key/dir
Tests that the /images registry API returns list of public images sorted alphabetically by disk_format in ascending order.
Tests that the /images registry API returns list of public images sorted alphabetically by name in ascending order.
Tests that the /images registry API returns list of public images sorted by size in ascending order.
Tests that the /images registry API returns list of public images sorted alphabetically by status in descending order.
Tests that the /images registry API returns list of public images sorted by updated_at in descending order.
Tests that the /images registry API returns a 400 when an unknown marker is provided
Test GET on image members raises 405 and produces correct Allow headers
Tests that the root registry API returns “index”, which is a list of public images
Tests that the /images/<id> registry API endpoint returns a 200 for deleted image to admin user.
Tests that the /images/<id> registry API endpoint returns a 404 for deleted image to non-admin user.
Tests that the /images/<id> registry API endpoint returns a 404 for an invalid (therefore unknown) image id
Tests that the /images/<id> registry API endpoint returns a 404 for an unknown image id
Test that right exception is raises in case if wrong memberships association is supplied
Test update image members raises right exception
Test update image members raises right exception
Test update image members raises right exception
Tests proper exception is raised if attempt to update non-existing image
Bases: glance.tests.unit.base.IsolatedUnitTest, glance.tests.utils.RegistryAPIMixIn
Bases: glance.tests.utils.BaseTestCase
Bases: testtools.testcase.TestCase
Test proper actions made for both valid and invalid requests against a Registry service
Bases: glance.tests.unit.base.IsolatedUnitTest, glance.tests.utils.RegistryAPIMixIn
Test proper actions made for both valid and invalid requests against a Registry service
Tests proper exception is raised if image with ID already exists
Tests that we can add image metadata with properties and enable encryption.
Tests that a detailed call can be filtered by container_format
Tests that a detailed call can be filtered by disk_format
Tests that a detailed call can be filtered by a property
Test exception is raised when marker is forbidden
Test correct set of images returned with marker/limit params.
Test exception is not raised if private non-owned marker is used
Tests that a detailed call returns list of public images sorted alphabetically by disk_format in ascending order.
Tests that a detailed call can be filtered by changes-since
Tests that a detailed call can be filtered by size_max
Tests that a detailed call can be filtered by size_min
Tests that a detailed call can be filtered by size_min
Test correct set of public, name-filtered image returned. This is just a sanity check, we test the details call more in-depth.
Test correct set of images returned with limit param == None.
Test correct set of images returned with marker/limit params.
Test exception is not raised if private non-owned marker is used
Tests that NotFound is raised when getting a non-existing image
Tests that the /images registry API returns list of public images sorted alphabetically by container_format in descending order.
Tests that the /images registry API returns list of public images sorted by created_at in ascending order.
Tests that the /images registry API returns list of public images sorted alphabetically by disk_format in ascending order.
Tests that the /images registry API returns list of public images sorted alphabetically by name in ascending order.
Tests that the /images registry API returns list of public images sorted by size in ascending order.
Tests that the /images registry API returns list of public images sorted alphabetically by status in descending order.
Bases: glance.tests.unit.base.StoreClearingUnitTest
Test token expiration during image upload.
If users token expired before image was uploaded then if auth error was caught from registry during changing image status from ‘saving’ to ‘active’ then it’s required to delete all image data.
See note in glance.api.v1.upload_utils on why we don’t want image to be deleted in this case.