This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.1 docs or all OpenStack docs too.

The nova.tests.api.openstack.test_images Module

Tests of the new image services, both as a service layer, and as a WSGI layer

class nova.tests.api.openstack.test_images.GlanceImageServiceTest(*args, **kwargs)

Bases: nova.tests.api.openstack.test_images._BaseImageServiceTests

Tests the Glance image service, in particular that metadata translation works properly.

At a high level, the translations involved are:

  1. Glance -> ImageService - This is needed so we can support multple ImageServices (Glance, Local, etc)
  2. ImageService -> API - This is needed so we can support multple APIs (OpenStack, EC2)
setUp()
tearDown()
test_create_with_instance_id()

Ensure instance_id is persisted as an image-property

test_create_without_instance_id()

Ensure we can create an image without having to specify an instance_id. Public images are an example of an image not tied to an instance.

class nova.tests.api.openstack.test_images.ImageControllerWithGlanceServiceTest(methodName='runTest')

Bases: nova.test.TestCase

Test of the OpenStack API /images application controller w/Glance.

setUp()

Run before each test.

tearDown()

Run after each test.

test_get_image()
test_get_image_404_json()
test_get_image_404_v1_1_json()
test_get_image_404_v1_1_xml()
test_get_image_404_xml()
test_get_image_details()
test_get_image_details_v1_1()
test_get_image_found()
test_get_image_index()
test_get_image_index_v1_1()
test_get_image_non_existent()
test_get_image_not_owned()

We should return a 404 if we request an image that doesn’t belong to us

test_get_image_v1_1()
test_get_image_v1_1_xml()
test_get_image_xml()
test_get_image_xml_no_name()
class nova.tests.api.openstack.test_images.LocalImageServiceTest(*args, **kwargs)

Bases: nova.tests.api.openstack.test_images._BaseImageServiceTests

Tests the local image service

setUp()
tearDown()
test_get_all_ids_with_incorrect_directory_formats()