glance.tests.unit.v2 package

Submodules

glance.tests.unit.v2.test_image_actions_resource module

class glance.tests.unit.v2.test_image_actions_resource.TestImageActionsController(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest

setUp()[source]
test_deactivate_from_active()[source]
test_deactivate_from_deactivated()[source]
test_deactivate_from_deleted()[source]
test_deactivate_from_killed()[source]
test_deactivate_from_pending_delete()[source]
test_deactivate_from_queued()[source]
test_deactivate_from_saving()[source]
test_reactivate_from_active()[source]
test_reactivate_from_deactivated()[source]
test_reactivate_from_deleted()[source]
test_reactivate_from_killed()[source]
test_reactivate_from_pending_delete()[source]
test_reactivate_from_queued()[source]
test_reactivate_from_saving()[source]

glance.tests.unit.v2.test_image_data_resource module

class glance.tests.unit.v2.test_image_data_resource.FakeGateway(repo)[source]

Bases: object

get_repo(context)[source]
class glance.tests.unit.v2.test_image_data_resource.FakeImage(image_id=None, data=None, checksum=None, size=0, virtual_size=0, locations=None, container_format='bear', disk_format='rawr', status=None)[source]

Bases: object

get_data(*args, **kwargs)[source]
set_data(data, size=None)[source]
status
class glance.tests.unit.v2.test_image_data_resource.FakeImageRepo(result=None)[source]

Bases: object

get(image_id)[source]
save(image, from_state=None)[source]
class glance.tests.unit.v2.test_image_data_resource.Raise(exc)[source]

Bases: object

class glance.tests.unit.v2.test_image_data_resource.TestImageDataDeserializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_upload()[source]
test_upload_chunked()[source]
test_upload_chunked_with_content_length()[source]
test_upload_with_incorrect_content_length()[source]
test_upload_wrong_content_type()[source]
class glance.tests.unit.v2.test_image_data_resource.TestImageDataSerializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_download()[source]
test_download_failure_with_valid_range()[source]
test_download_forbidden()[source]

Make sure the serializer can return 403 forbidden error instead of 500 internal server error.

test_download_no_content()[source]

Test image download returns HTTPNoContent

Make sure that serializer returns 204 no content error in case of image data is not available at specified location.

test_download_service_unavailable()[source]

Test image download returns HTTPServiceUnavailable.

test_download_store_get_not_support()[source]

Test image download returns HTTPBadRequest.

Make sure that serializer returns 400 bad request error in case of getting images from this store is not supported at specified location.

test_download_store_random_get_not_support()[source]

Test image download returns HTTPBadRequest.

Make sure that serializer returns 400 bad request error in case of getting randomly images from this store is not supported at specified location.

test_download_with_checksum()[source]
test_partial_download_failure_with_range()[source]
test_partial_download_successful_with_range()[source]
test_upload()[source]
class glance.tests.unit.v2.test_image_data_resource.TestImagesController(*args, **kwargs)[source]

Bases: glance.tests.unit.base.StoreClearingUnitTest

setUp()[source]
test_download()[source]
test_download_deactivated()[source]
test_download_forbidden()[source]
test_download_no_location()[source]
test_download_non_existent_image()[source]
test_download_ok_when_get_image_location_forbidden()[source]
test_image_size_limit_exceeded()[source]
test_restore_image_when_upload_failed()[source]
test_upload()[source]
test_upload_data_exists()[source]
test_upload_invalid()[source]
test_upload_no_size()[source]
test_upload_non_existent_image_before_save()[source]
test_upload_non_existent_image_during_save_initiates_deletion()[source]
test_upload_non_existent_image_raises_image_not_found_exception()[source]
test_upload_non_existent_image_raises_store_not_found_exception()[source]
test_upload_signature_verification_fails()[source]
test_upload_status()[source]
test_upload_storage_forbidden()[source]
test_upload_storage_full()[source]
test_upload_storage_internal_error()[source]
test_upload_storage_quota_full()[source]
test_upload_storage_store_disabled()[source]

Test that uploading an image file raises StoreDisabled exception

test_upload_storage_write_denied()[source]
test_upload_with_expired_token()[source]
test_upload_with_trusts(*args, **keywargs)[source]

Test that uploading with registry correctly uses trusts

test_upload_with_trusts_fails(*args, **keywargs)[source]

Test upload with registry if trust was not successfully created

glance.tests.unit.v2.test_image_members_resource module

class glance.tests.unit.v2.test_image_members_resource.TestImageMembersController(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_create_allowed_by_add_policy()[source]
test_create_duplicate_member()[source]
test_create_forbidden_by_add_policy()[source]
test_create_image_does_not_exist()[source]
test_create_overlimit()[source]
test_create_private_image()[source]
test_create_public_image()[source]
test_create_unlimited()[source]
test_delete()[source]
test_delete_allowed_by_policies()[source]
test_delete_by_member()[source]
test_delete_forbidden_by_delete_member_policy()[source]
test_delete_forbidden_by_get_member_policy()[source]
test_delete_image_does_not_exist()[source]
test_delete_member_does_not_exist()[source]
test_delete_private_image()[source]
test_delete_public_image()[source]
test_index()[source]
test_index_allowed_by_get_members_policy()[source]
test_index_forbidden_by_get_members_policy()[source]
test_index_member_view()[source]
test_index_no_members()[source]
test_index_private_image()[source]
test_index_private_image_visible_members_admin()[source]
test_index_public_image()[source]
test_show()[source]
test_show_by_member()[source]
test_show_forbidden()[source]
test_show_not_found()[source]
test_update_done_by_member()[source]
test_update_done_by_member_allowed_by_policy()[source]
test_update_done_by_member_forbidden_by_policy()[source]
test_update_done_by_owner()[source]
test_update_invalid_status()[source]
test_update_non_existent_image()[source]
class glance.tests.unit.v2.test_image_members_resource.TestImageMembersSerializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_index()[source]
test_show()[source]
test_update()[source]
class glance.tests.unit.v2.test_image_members_resource.TestImagesDeserializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_create_invalid()[source]
test_create_list_return_error()[source]
test_create_member_empty()[source]
test_create_no_body()[source]
test_update()[source]
test_update_invalid()[source]
test_update_list_return_error()[source]
test_update_no_body()[source]

glance.tests.unit.v2.test_image_tags_resource module

class glance.tests.unit.v2.test_image_tags_resource.TestImageTagsController(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest

setUp()[source]
test_create_duplicate_tag_ignored()[source]
test_create_tag()[source]
test_create_too_many_tags()[source]
test_delete_tag()[source]
test_delete_tag_forbidden()[source]
test_delete_tag_not_found()[source]
test_delete_tag_of_non_existing_image()[source]
test_update_tag_of_non_existing_image()[source]
class glance.tests.unit.v2.test_image_tags_resource.TestImagesSerializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create_tag()[source]
test_delete_tag()[source]

glance.tests.unit.v2.test_images_resource module

class glance.tests.unit.v2.test_images_resource.TestImageSchemaDeterminePropertyBasis(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

test_base_property_marked_as_base()[source]
test_custom_property_marked_as_non_base()[source]
class glance.tests.unit.v2.test_images_resource.TestImageSchemaFormatConfiguration(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

test_custom_container_formats()[source]
test_custom_disk_formats()[source]
test_default_container_formats()[source]
test_default_disk_formats()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesController(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest

setUp()[source]
test_add_location_possible_on_queued()[source]
test_create()[source]
test_create_disabled_notification()[source]
test_create_dup_id()[source]
test_create_duplicate_tags()[source]
test_create_locked_down_protected_prop()[source]

Property marked with special char ! creatable by no one

test_create_non_protected_prop()[source]

Property marked with special char @ creatable by an unknown role

test_create_protected_prop_case_insensitive()[source]
test_create_public_image_as_admin()[source]
test_create_readonly_property()[source]
test_create_reserved_property()[source]
test_create_unexpected_property()[source]
test_create_with_bad_min_disk_size()[source]
test_create_with_bad_min_ram_size()[source]
test_create_with_duplicate_location()[source]
test_create_with_owner_admin()[source]
test_create_with_owner_non_admin()[source]
test_create_with_properties()[source]
test_create_with_too_many_properties()[source]
test_create_with_too_many_tags()[source]
test_delayed_delete()[source]
test_delete()[source]
test_delete_already_deleted_image_admin()[source]
test_delete_disabled_notification()[source]
test_delete_has_snapshot()[source]
test_delete_in_use()[source]
test_delete_locked_down_protected_prop()[source]

Property marked with special char ! deletable by no one

test_delete_non_existent()[source]
test_delete_non_protected_prop()[source]

Property marked with special char @ deletable by an unknown role

test_delete_not_allowed()[source]
test_delete_not_in_store()[source]
test_delete_protected_prop_case_insensitive()[source]
test_delete_queued_updates_status()[source]

Ensure status of queued image is updated (LP bug #1048851)

test_delete_queued_updates_status_delayed_delete()[source]

Ensure status of queued image is updated (LP bug #1048851).

Must be set to ‘deleted’ when delayed_delete isenabled.

test_delete_to_unallowed_status()[source]
test_delete_with_tags()[source]
test_index()[source]
test_index_admin()[source]
test_index_admin_deleted_images_hidden()[source]
test_index_default_limit()[source]
test_index_greater_than_limit_max()[source]
test_index_invalid_sort_key()[source]
test_index_member_status_accepted()[source]
test_index_next_marker()[source]
test_index_no_next_marker()[source]
test_index_return_parameters()[source]
test_index_size_max_filter()[source]
test_index_size_min_filter()[source]
test_index_size_range_filter()[source]
test_index_virtual_size_max_filter()[source]
test_index_virtual_size_min_filter()[source]
test_index_virtual_size_range_filter()[source]
test_index_with_checksum_filter_multiple_images()[source]
test_index_with_checksum_filter_single_image()[source]
test_index_with_core_and_extra_property()[source]
test_index_with_filters_return_many()[source]
test_index_with_id_filter()[source]
test_index_with_invalid_marker()[source]
test_index_with_invalid_max_range_filter_value()[source]
test_index_with_limit()[source]
test_index_with_many_filters()[source]
test_index_with_marker()[source]
test_index_with_marker_not_found()[source]
test_index_with_multi_tags()[source]
test_index_with_multi_tags_and_nonexistent()[source]
test_index_with_multiple_properties()[source]
test_index_with_multiple_sort_keys()[source]
test_index_with_non_default_is_public_filter()[source]
test_index_with_non_existent_checksum()[source]
test_index_with_non_existent_tags()[source]
test_index_with_nonexistent_name_filter()[source]
test_index_with_nonexistent_properties()[source]
test_index_with_sort_dir()[source]
test_index_with_sort_key()[source]
test_index_with_tags()[source]
test_index_with_tags_and_properties()[source]
test_index_zero_images()[source]
test_invalid_locations_op_pos()[source]
test_location_add_not_permitted_status_deactivated()[source]
test_location_add_not_permitted_status_deleted()[source]
test_location_add_not_permitted_status_killed()[source]
test_location_add_not_permitted_status_pending_delete()[source]
test_location_add_not_permitted_status_saving()[source]
test_location_remove_not_permitted_status_deactivated()[source]
test_location_remove_not_permitted_status_deleted()[source]
test_location_remove_not_permitted_status_killed()[source]
test_location_remove_not_permitted_status_pending_delete()[source]
test_location_remove_not_permitted_status_queued()[source]
test_location_remove_not_permitted_status_saving()[source]
test_location_replace_not_permitted_status_deactivated()[source]
test_location_replace_not_permitted_status_deleted()[source]
test_location_replace_not_permitted_status_killed()[source]
test_location_replace_not_permitted_status_pending_delete()[source]
test_location_replace_not_permitted_status_saving()[source]
test_locations_actions_with_locations_invisible()[source]
test_prop_protection_with_create_and_permitted_role()[source]
test_prop_protection_with_create_and_unpermitted_role()[source]
test_prop_protection_with_create_with_patch_and_policy()[source]
test_prop_protection_with_delete_and_permitted_role()[source]
test_prop_protection_with_delete_and_unpermitted_role()[source]
test_prop_protection_with_show_and_permitted_role()[source]
test_prop_protection_with_show_and_unpermitted_role()[source]
test_prop_protection_with_update_and_permitted_policy()[source]
test_prop_protection_with_update_and_permitted_role()[source]
test_prop_protection_with_update_and_unpermitted_role()[source]
test_read_locked_down_protected_prop()[source]

Property marked with special char ! readable by no one

test_read_non_protected_prop()[source]

Property marked with special char @ readable by an unknown role

test_read_protected_prop_case_insensitive()[source]
test_replace_location_possible_on_queued()[source]
test_show()[source]
test_show_deleted_image_admin()[source]
test_show_deleted_properties()[source]

Ensure that the api filters out deleted image properties.

test_show_non_existent()[source]
test_show_not_allowed()[source]
test_update_add_and_remove_location_under_limit()[source]

Ensure that image locations can be removed.

Image locations should be able to be added and removed simultaneously as long as the image has fewer than the limited number of image locations after the transaction.

test_update_add_and_remove_property_under_limit()[source]

Ensure that image properties can be removed.

Image properties should be able to be added and removed simultaneously as long as the image has fewer than the limited number of image properties after the transaction.

test_update_add_and_remove_too_many_locations()[source]
test_update_add_and_remove_too_many_properties()[source]
test_update_add_base_property_json_schema_version_10()[source]
test_update_add_base_property_json_schema_version_4()[source]
test_update_add_duplicate_locations()[source]
test_update_add_extra_property_json_schema_version_10()[source]
test_update_add_extra_property_json_schema_version_4()[source]
test_update_add_locations()[source]
test_update_add_locations_insertion()[source]
test_update_add_locations_invalid()[source]
test_update_add_locations_list()[source]
test_update_add_property()[source]
test_update_add_property_already_present_json_schema_version_10()[source]
test_update_add_property_already_present_json_schema_version_4()[source]
test_update_add_too_many_locations()[source]
test_update_add_too_many_properties()[source]
test_update_add_unlimited_locations()[source]
test_update_add_unlimited_properties()[source]
test_update_deleted_image_admin()[source]
test_update_disabled_notification()[source]
test_update_duplicate_tags()[source]
test_update_format_properties()[source]
test_update_image_doesnt_exist()[source]
test_update_invalid_operation()[source]
test_update_locked_down_protected_prop()[source]

Property marked with special char ! updatable by no one

test_update_multiple_changes()[source]
test_update_no_changes()[source]
test_update_non_protected_prop()[source]

Property marked with special char @ updatable by an unknown role

test_update_protected_prop_case_insensitive()[source]
test_update_remove_base_property()[source]
test_update_remove_location()[source]
test_update_remove_location_invalid_pos()[source]
test_update_remove_location_store_exception()[source]
test_update_remove_location_while_over_limit()[source]

Ensure that image locations can be removed.

Image locations should be able to be removed as long as the image has fewer than the limited number of image locations after the transaction.

test_update_remove_missing_property()[source]
test_update_remove_property()[source]
test_update_remove_property_while_over_limit()[source]

Ensure that image properties can be removed.

Image properties should be able to be removed as long as the image has fewer than the limited number of image properties after the transaction.

test_update_replace_base_attribute()[source]
test_update_replace_locations_invalid()[source]
test_update_replace_locations_metadata_update()[source]
test_update_replace_locations_non_empty()[source]
test_update_replace_missing_property()[source]
test_update_replace_onwer_non_admin()[source]
test_update_replace_property()[source]
test_update_replace_tags()[source]
test_update_with_bad_min_disk()[source]
test_update_with_bad_min_ram()[source]
test_update_with_too_many_properties()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesControllerPolicies(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest

setUp()[source]
test_create_community_image_unauthorized()[source]
test_create_image_unauthorized()[source]
test_create_public_image_unauthorized()[source]
test_delete_unauthorized()[source]
test_index_unauthorized()[source]
test_show_unauthorized()[source]
test_update_communitize_image_unauthorized()[source]
test_update_decommunitize_image_unauthorized()[source]
test_update_delete_image_location_unauthorized()[source]
test_update_depublicize_image_unauthorized()[source]
test_update_get_image_location_unauthorized()[source]
test_update_publicize_image_unauthorized()[source]
test_update_set_image_location_unauthorized()[source]
test_update_unauthorized()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesDeserializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create_full()[source]
test_create_id_to_image_id()[source]
test_create_invalid_id()[source]
test_create_minimal()[source]
test_create_no_body()[source]
test_create_readonly_attributes_forbidden()[source]
test_index()[source]
test_index_combined_sorting_syntax()[source]
test_index_fraction()[source]
test_index_invalid_multiple_sort_keys()[source]
test_index_invalid_status()[source]
test_index_limit_not_specified()[source]
test_index_marker()[source]
test_index_marker_not_specified()[source]
test_index_multiple_sort_dirs()[source]
test_index_multiple_sort_keys()[source]
test_index_negative_limit()[source]
test_index_new_sorting_syntax_invalid_request()[source]
test_index_new_sorting_syntax_multiple_keys_asc_dir()[source]
test_index_new_sorting_syntax_multiple_keys_default_dir()[source]
test_index_new_sorting_syntax_multiple_keys_different_dirs()[source]
test_index_new_sorting_syntax_multiple_keys_optional_dir()[source]
test_index_new_sorting_syntax_single_key_default_dir()[source]
test_index_new_sorting_syntax_single_key_desc_dir()[source]
test_index_non_integer_limit()[source]
test_index_sort_dir_asc()[source]
test_index_sort_dir_invalid_value()[source]
test_index_sort_dirs_fewer_than_keys()[source]
test_index_sort_key_id()[source]
test_index_sort_key_invalid_value()[source]
test_index_sort_private_key()[source]
test_index_sort_wrong_sort_dirs_number()[source]
test_index_sort_wrong_sort_dirs_number_without_key()[source]
test_index_strip_params_from_filters()[source]
test_index_with_filter()[source]
test_index_with_filter_and_limit()[source]
test_index_with_many_filter()[source]
test_index_with_tag()[source]
test_index_zero_limit()[source]
test_update()[source]
test_update_base_attributes()[source]
test_update_body_not_a_list()[source]
test_update_deep_limited_attributes()[source]
test_update_disallowed_attributes()[source]
test_update_empty_body()[source]
test_update_invalid_attributes()[source]
test_update_invalid_changes()[source]
test_update_pointer_encoding()[source]
test_update_readonly_attributes()[source]
test_update_reserved_attributes()[source]
test_update_unsupported_content_type()[source]
test_update_v2_0_compatibility()[source]
test_update_v2_0_missing_operations()[source]
test_update_v2_0_missing_value()[source]
test_update_v2_0_multiple_operations()[source]
test_update_v2_1_missing_operations()[source]
test_update_v2_1_missing_path()[source]
test_update_v2_1_missing_value()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesDeserializerNoAdditionalProperties(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create_with_additional_properties_disallowed()[source]
test_update()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesDeserializerWithAdditionalProperties(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_create_with_list_property()[source]
test_create_with_numeric_property()[source]
test_update()[source]
test_update_with_list_property()[source]
test_update_with_numeric_property()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesDeserializerWithExtendedSchema(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_create_bad_data()[source]
test_update()[source]
test_update_bad_data()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesSerializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_index()[source]
test_index_carries_query_parameters()[source]
test_index_forbidden_get_image_location()[source]

Make sure the serializer works fine.

No mater if current user is authorized to get image location if the show_multiple_locations is False.

test_index_next_marker()[source]
test_show_full_fixture()[source]
test_show_minimal_fixture()[source]
test_update()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesSerializerDirectUrl(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_index_store_location_enabled()[source]
test_index_store_location_explicitly_disabled()[source]
test_index_store_multiple_location_enabled()[source]
test_show_location_enabled()[source]
test_show_location_enabled_but_not_set()[source]
test_show_location_explicitly_disabled()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesSerializerWithAdditionalProperties(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_show()[source]
test_show_invalid_additional_property()[source]

Ensure that the serializer passes through invalid additional properties.

It must not complains with i.e. non-string.

test_show_with_additional_properties_disabled()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesSerializerWithExtendedSchema(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_show()[source]
test_show_reports_invalid_data()[source]
class glance.tests.unit.v2.test_images_resource.TestImagesSerializerWithUnicode(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_index()[source]
test_show_full_fixture()[source]
test_update()[source]

glance.tests.unit.v2.test_metadef_resources module

class glance.tests.unit.v2.test_metadef_resources.TestMetadefsControllers(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest

assertNotificationLog(expected_event_type, expected_payloads)[source]
assertNotificationsLog(expected_events)[source]
setUp()[source]
test_namespace_create()[source]
test_namespace_create_conflict()[source]
test_namespace_create_different_owner()[source]
test_namespace_create_different_owner_admin()[source]
test_namespace_create_duplicate()[source]
test_namespace_create_with_4byte_character()[source]
test_namespace_delete()[source]
test_namespace_delete_non_existing()[source]
test_namespace_delete_non_visible()[source]
test_namespace_delete_non_visible_admin()[source]
test_namespace_delete_notification_create_disabled()[source]
test_namespace_delete_notification_disabled()[source]
test_namespace_delete_notification_group_disabled()[source]
test_namespace_delete_objects()[source]
test_namespace_delete_objects_other_owner()[source]
test_namespace_delete_objects_other_owner_admin()[source]
test_namespace_delete_properties()[source]
test_namespace_delete_properties_other_owner()[source]
test_namespace_delete_properties_other_owner_admin()[source]
test_namespace_delete_protected()[source]
test_namespace_delete_protected_admin()[source]
test_namespace_delete_tags()[source]
test_namespace_delete_tags_other_owner()[source]
test_namespace_delete_tags_other_owner_admin()[source]
test_namespace_delete_with_contents()[source]
test_namespace_index()[source]
test_namespace_index_admin()[source]
test_namespace_index_resource_type()[source]
test_namespace_index_visibility_public()[source]
test_namespace_non_existing_delete_objects()[source]
test_namespace_non_existing_delete_properties()[source]
test_namespace_non_existing_delete_tags()[source]
test_namespace_show()[source]
test_namespace_show_non_existing()[source]
test_namespace_show_non_visible()[source]
test_namespace_show_with_property_prefix()[source]
test_namespace_update()[source]
test_namespace_update_name()[source]
test_namespace_update_name_conflict()[source]
test_namespace_update_non_existing()[source]
test_namespace_update_non_visible()[source]
test_namespace_update_non_visible_admin()[source]
test_namespace_update_with_4byte_character()[source]
test_object_create()[source]
test_object_create_conflict()[source]
test_object_create_duplicate()[source]
test_object_create_missing_properties()[source]
test_object_create_non_existing_namespace()[source]
test_object_create_non_visible_namespace()[source]
test_object_create_non_visible_namespace_admin()[source]
test_object_create_overlimit_name()[source]
test_object_create_with_4byte_character()[source]
test_object_delete()[source]
test_object_delete_admin_protected()[source]
test_object_delete_disabled_notification()[source]
test_object_delete_non_existing()[source]
test_object_delete_non_existing_namespace()[source]
test_object_delete_non_visible()[source]
test_object_delete_other_owner()[source]
test_object_delete_other_owner_admin()[source]
test_object_index()[source]
test_object_index_empty()[source]
test_object_index_non_existing_namespace()[source]
test_object_index_zero_limit()[source]
test_object_show()[source]
test_object_show_non_existing()[source]
test_object_show_non_visible()[source]
test_object_show_non_visible_admin()[source]
test_object_update()[source]
test_object_update_conflict()[source]
test_object_update_name()[source]
test_object_update_namespace_non_existing()[source]
test_object_update_non_existing()[source]
test_object_update_with_4byte_character()[source]
test_property_create()[source]
test_property_create_conflict()[source]
test_property_create_duplicate()[source]
test_property_create_non_existing_namespace()[source]
test_property_create_non_visible_namespace()[source]
test_property_create_non_visible_namespace_admin()[source]
test_property_create_overlimit_name()[source]
test_property_create_with_4byte_character()[source]
test_property_create_with_operators()[source]
test_property_delete()[source]
test_property_delete_admin_protected()[source]
test_property_delete_disabled_notification()[source]
test_property_delete_non_existing()[source]
test_property_delete_non_existing_namespace()[source]
test_property_delete_non_visible()[source]
test_property_delete_other_owner()[source]
test_property_delete_other_owner_admin()[source]
test_property_index()[source]
test_property_index_empty()[source]
test_property_index_non_existing_namespace()[source]
test_property_show()[source]
test_property_show_non_existing()[source]
test_property_show_non_existing_resource_type()[source]
test_property_show_non_visible()[source]
test_property_show_non_visible_admin()[source]
test_property_show_prefix_mismatch()[source]
test_property_show_specific_resource_type()[source]
test_property_update()[source]
test_property_update_conflict()[source]
test_property_update_name()[source]
test_property_update_namespace_non_existing()[source]
test_property_update_non_existing()[source]
test_property_update_with_4byte_character()[source]
test_resource_type_association_create()[source]
test_resource_type_association_create_conflict()[source]
test_resource_type_association_create_non_existing_namespace()[source]
test_resource_type_association_create_non_existing_resource_type()[source]
test_resource_type_association_create_non_visible_namesp_admin()[source]
test_resource_type_association_create_non_visible_namespace()[source]
test_resource_type_association_delete()[source]
test_resource_type_association_delete_disabled_notification()[source]
test_resource_type_association_delete_non_existing()[source]
test_resource_type_association_delete_non_existing_namespace()[source]
test_resource_type_association_delete_non_visible()[source]
test_resource_type_association_delete_other_owner()[source]
test_resource_type_association_delete_other_owner_admin()[source]
test_resource_type_association_delete_protected_admin()[source]
test_resource_type_index()[source]
test_resource_type_show()[source]
test_resource_type_show_empty()[source]
test_resource_type_show_non_existing_namespace()[source]
test_resource_type_show_non_visible()[source]
test_resource_type_show_non_visible_admin()[source]
test_tag_create()[source]
test_tag_create_conflict()[source]
test_tag_create_duplicate_tags()[source]
test_tag_create_duplicate_with_pre_existing_tags()[source]
test_tag_create_non_existing_namespace()[source]
test_tag_create_non_visible_namespace()[source]
test_tag_create_non_visible_namespace_admin()[source]
test_tag_create_overlimit_name()[source]
test_tag_create_tags()[source]
test_tag_create_with_4byte_character()[source]
test_tag_delete()[source]
test_tag_delete_admin_protected()[source]
test_tag_delete_disabled_notification()[source]
test_tag_delete_non_existing()[source]
test_tag_delete_non_existing_namespace()[source]
test_tag_delete_non_visible()[source]
test_tag_delete_other_owner()[source]
test_tag_delete_other_owner_admin()[source]
test_tag_index()[source]
test_tag_index_empty()[source]
test_tag_index_non_existing_namespace()[source]
test_tag_show()[source]
test_tag_show_non_existing()[source]
test_tag_show_non_visible()[source]
test_tag_show_non_visible_admin()[source]
test_tag_update()[source]
test_tag_update_conflict()[source]
test_tag_update_name()[source]
test_tag_update_namespace_non_existing()[source]
test_tag_update_non_existing()[source]
test_tag_update_with_4byte_character()[source]

glance.tests.unit.v2.test_registry_api module

class glance.tests.unit.v2.test_registry_api.TestRegistryRPC(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest

create_fixtures()[source]
destroy_fixtures()[source]
setUp()[source]
tearDown()[source]

Clear the test environment

test_create_image()[source]

Tests that the registry API creates the image

test_create_image_bad_location()[source]
test_create_image_bad_name()[source]
test_create_image_bad_property()[source]
test_create_image_with_min_disk()[source]

Tests that the registry API creates the image

test_create_image_with_min_disk_default()[source]

Tests that the registry API creates the image

test_create_image_with_min_ram()[source]

Tests that the registry API creates the image

test_create_image_with_min_ram_default()[source]

Tests that the registry API creates the image

test_delete_image()[source]

Tests that the registry API deletes the image

test_delete_image_response()[source]

Tests that the registry API delete returns the image metadata

test_get_image_members()[source]

Tests members listing for existing images.

test_get_index()[source]

Tests that the image_get_all command returns list of images.

test_get_index_filter_name()[source]

Tests that the registry API returns list of public images.

Use a specific name. This is really a sanity check, filtering is tested more in-depth using /images/detail

test_get_index_filter_on_user_defined_properties()[source]

Tests that the registry API returns list of public images.

Use a specific user-defined properties.

test_get_index_limit()[source]

Tests that the registry API returns list of public images.

Must conforms to a limit query param.

test_get_index_limit_marker()[source]

Tests that the registry API returns list of public images.

Must conforms to limit and marker query params.

test_get_index_marker()[source]

Tests that the registry API returns list of public images.

Must conforms to a marker query param.

test_get_index_marker_and_container_format_asc()[source]

Test marker and null container format ascending

Tests that the registry API returns 200 when a marker and a null container_format are combined ascending order

test_get_index_marker_and_container_format_desc()[source]

Test marker and null container format descending

Tests that the registry API returns 200 when a marker and a null container_format are combined descending order

test_get_index_marker_and_disk_format_asc()[source]

Test marker and null disk format ascending

Tests that the registry API returns 200 when a marker and a null disk_format are combined ascending order

test_get_index_marker_and_disk_format_desc()[source]

Test marker and null disk format descending

Tests that the registry API returns 200 when a marker and a null disk_format are combined descending order

test_get_index_marker_and_name_asc()[source]

Test marker and null name ascending

Tests that the registry API returns 200 when a marker and a null name are combined ascending order

test_get_index_marker_and_name_desc()[source]

Test marker and null name descending

Tests that the registry API returns 200 when a marker and a null name are combined descending order

test_get_index_sort_container_format_desc()[source]

Tests that the registry API returns list of public images.

Must be sorted alphabetically by container_format in descending order.

test_get_index_sort_created_at_asc()[source]

Tests that the registry API returns list of public images.

Must be sorted by created_at in ascending order.

test_get_index_sort_default_created_at_desc()[source]

Tests that the registry API returns list of public images.

Must conforms to a default sort key/dir.

test_get_index_sort_disk_format_asc()[source]

Tests that the registry API returns list of public images.

Must be sorted alphabetically by disk_format in ascending order.

test_get_index_sort_multiple_keys_multiple_sort_dirs()[source]

Tests that the registry API returns list of public images sorted by name-size and size-name with ascending and descending directions.

test_get_index_sort_multiple_keys_one_sort_dir()[source]

Tests that the registry API returns list of public images sorted by name-size and size-name with ascending sort direction.

test_get_index_sort_name_asc()[source]

Tests that the registry API returns list of public images.

Must be sorted alphabetically by name in ascending order.

test_get_index_sort_size_asc()[source]

Tests that the registry API returns list of public images.

Must be sorted by size in ascending order.

test_get_index_sort_status_desc()[source]

Tests that the registry API returns list of public images.

Must be sorted alphabetically by status in descending order.

test_get_index_sort_updated_at_desc()[source]

Tests that the registry API returns list of public images.

Must be sorted by updated_at in descending order.

test_get_index_unknown_marker()[source]

Tests the registry API returns a NotFound with unknown marker.

test_show()[source]

Tests that registry API endpoint returns the expected image.

test_show_unknown()[source]

Tests the registry API endpoint returns 404 for an unknown id.

test_update_bad_property()[source]
test_update_image()[source]

Tests that the registry API updates the image

test_update_image_bad_location()[source]
test_update_image_bad_name()[source]
test_update_image_bad_tag()[source]

glance.tests.unit.v2.test_registry_client module

Tests for Glance Registry’s client.

This tests are temporary and will be removed once the registry’s driver tests will be added.

class glance.tests.unit.v2.test_registry_client.TestRegistryV2Client(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest, glance.tests.utils.RegistryAPIMixIn

Test proper actions made against a registry service.

Test for both valid and invalid requests.

registry = <module 'glance.registry.api.v2' from '/home/zuul/src/opendev.org/openstack/glance/glance/registry/api/v2/__init__.py'>
setUp()[source]

Establish a clean test environment

tearDown()[source]

Clear the test environment

test_add_delete_member()[source]

Tests deleting image members

test_add_update_members()[source]

Tests updating image members

test_create_image_with_null_min_disk_min_ram()[source]
test_get_image_details_sort_multiple_dirs()[source]

Tests that a detailed call returns list of public images sorted by name-size and size-name in ascending and descending orders.

test_get_image_details_sort_multiple_keys()[source]

Tests that a detailed call returns list of public images sorted by name-size and size-name in ascending order.

test_get_index_sort_container_format_desc()[source]

Tests that the registry API returns list of public images.

Must be sorted alphabetically by container_format in descending order.

test_get_index_sort_created_at_asc()[source]

Tests that the registry API returns list of public images.

Must be sorted by created_at in ascending order.

test_get_index_sort_disk_format_asc()[source]

Tests that the registry API returns list of public images.

Must besorted alphabetically by disk_format in ascending order.

test_get_index_sort_name_asc()[source]

Tests that the registry API returns list of public images.

Must be sorted alphabetically by name in ascending order.

test_get_index_sort_size_asc()[source]

Tests that the registry API returns list of public images.

Must be sorted by size in ascending order.

test_get_index_sort_status_desc()[source]

Tests that the registry API returns list of public images.

Must be sorted alphabetically by status in descending order.

test_get_index_sort_updated_at_desc()[source]

Tests that the registry API returns list of public images.

Must be sorted by updated_at in descending order.

test_image_create_already_exists()[source]

Tests proper exception is raised if image with ID already exists

test_image_create_basic()[source]

Tests that we can add image metadata and returns the new id

test_image_create_with_bad_status()[source]

Tests proper exception is raised if a bad status is set

test_image_create_with_properties()[source]

Tests that we can add image metadata with properties

test_image_destroy()[source]

Tests that image metadata is deleted properly

test_image_destroy_not_existing()[source]

Tests cannot delete non-existing image

test_image_get()[source]

Tests that the detailed info about an image returned

test_image_get_index()[source]

Test correct set of public image returned

test_image_get_index_by_name()[source]

Test correct set of public, name-filtered image returned.

This is just a sanity check, we test the details call more in-depth.

test_image_get_index_limit()[source]

Test correct number of images returned with limit param.

test_image_get_index_limit_None()[source]

Test correct set of images returned with limit param == None.

test_image_get_index_marker()[source]

Test correct set of images returned with marker param.

test_image_get_index_marker_limit()[source]

Test correct set of images returned with marker/limit params.

test_image_get_is_public_v2()[source]

Tests that a detailed call can be filtered by a property

test_image_get_members()[source]

Tests getting image members

test_image_get_members_not_existing()[source]

Tests getting non-existent image members

test_image_get_non_existing()[source]

Tests that NotFound is raised when getting a non-existing image

test_image_member_find()[source]

Tests getting member images

test_image_member_find_include_deleted()[source]

Tests getting image members including the deleted member

test_image_update()[source]

Tests that the registry API updates the image

test_image_update_conflict()[source]

Tests that the registry API updates the image

test_image_update_with_invalid_min_disk()[source]

Tests that the registry API updates the image

test_image_update_with_invalid_min_ram()[source]

Tests that the registry API updates the image

class glance.tests.unit.v2.test_registry_client.TestRegistryV2ClientApi(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest

Test proper actions made against a registry service.

Test for both valid and invalid requests.

setUp()[source]

Establish a clean test environment

tearDown()[source]

Clear the test environment

test_configure_registry_admin_creds()[source]
test_configure_registry_admin_creds_with_auth_url()[source]
test_configure_registry_client_not_using_use_user_token()[source]

glance.tests.unit.v2.test_schemas_resource module

class glance.tests.unit.v2.test_schemas_resource.TestSchemasController(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_image()[source]
test_images()[source]
test_member()[source]
test_members()[source]

glance.tests.unit.v2.test_tasks_resource module

class glance.tests.unit.v2.test_tasks_resource.TestTasksController(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create(*args, **keywargs)[source]
test_create_with_live_time(*args, **keywargs)[source]
test_create_with_properties_missed()[source]
test_create_with_wrong_import_form()[source]
test_get()[source]
test_get_non_existent()[source]
test_get_not_allowed()[source]
test_index()[source]
test_index_admin()[source]
test_index_default_limit()[source]
test_index_greater_than_limit_max()[source]
test_index_invalid_sort_key()[source]
test_index_next_marker()[source]
test_index_no_next_marker()[source]
test_index_return_parameters()[source]
test_index_with_filters_return_many()[source]
test_index_with_id_filter()[source]
test_index_with_limit()[source]
test_index_with_many_filters()[source]
test_index_with_marker()[source]
test_index_with_marker_is_not_like_uuid()[source]
test_index_with_marker_not_found()[source]
test_index_with_sort_dir()[source]
test_index_with_sort_key()[source]
test_index_zero_tasks()[source]
test_notifications_on_create(*args, **keywargs)[source]
class glance.tests.unit.v2.test_tasks_resource.TestTasksControllerPolicies(*args, **kwargs)[source]

Bases: glance.tests.unit.base.IsolatedUnitTest

setUp()[source]
test_create_task_unauthorized()[source]
test_delete()[source]
test_get_unauthorized()[source]
test_index_unauthorized()[source]
class glance.tests.unit.v2.test_tasks_resource.TestTasksDeserializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_create_no_body()[source]
test_index()[source]
test_index_fraction()[source]
test_index_invalid_status()[source]
test_index_limit_not_specified()[source]
test_index_marker()[source]
test_index_marker_not_specified()[source]
test_index_negative_limit()[source]
test_index_non_integer_limit()[source]
test_index_sort_dir_asc()[source]
test_index_sort_dir_bad_value()[source]
test_index_sort_key_id()[source]
test_index_strip_params_from_filters()[source]
test_index_with_filter_and_limit()[source]
test_index_with_many_filter()[source]
test_index_zero_limit()[source]
class glance.tests.unit.v2.test_tasks_resource.TestTasksSerializer(*args, **kwargs)[source]

Bases: glance.tests.utils.BaseTestCase

setUp()[source]
test_create()[source]
test_create_ensure_expires_at_is_not_returned()[source]
test_get()[source]
test_get_ensure_expires_at_not_returned()[source]
test_index()[source]
test_index_carries_query_parameters()[source]
test_index_next_marker()[source]

Module contents