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.test_xenapi Module

Test suite for XenAPI.

class nova.tests.test_xenapi.XenAPIDetermineDiskImageTestCase(methodName='runTest')

Bases: nova.test.TestCase

Unit tests for code that detects the ImageType.

assert_disk_type(disk_type)
setUp()
test_glance_disk_raw()

If we’re using Glance, then defer to the image_type field, which in this case will be ‘raw’.

test_glance_disk_vhd()

If we’re using Glance, then defer to the image_type field, which in this case will be ‘vhd’.

test_instance_disk()

If a kernel is specified, the image type is DISK (aka machine).

test_instance_disk_raw()

If the kernel isn’t specified, and we’re not using Glance, then DISK_RAW is assumed.

class nova.tests.test_xenapi.XenAPIDiffieHellmanTestCase(methodName='runTest')

Bases: nova.test.TestCase

Unit tests for Diffie-Hellman code.

setUp()
tearDown()
test_encryption()
test_shared()
class nova.tests.test_xenapi.XenAPIMigrateInstance(methodName='runTest')

Bases: nova.test.TestCase

Unit test for verifying migration-related actions.

setUp()
tearDown()
test_finish_resize()
test_migrate_disk_and_power_off()
class nova.tests.test_xenapi.XenAPIVMTestCase(methodName='runTest')

Bases: nova.test.TestCase

Unit tests for VM operations.

check_vm_params_for_linux()
check_vm_params_for_linux_with_external_kernel()
check_vm_params_for_windows()
check_vm_record(conn, check_injection=False)
create_vm_record(conn, os_type, instance_id=1)
setUp()
tearDown()
test_get_diagnostics()
test_instance_snapshot()
test_list_instances_0()
test_rescue()
test_spawn_glance()
test_spawn_netinject_file()
test_spawn_netinject_xenstore()
test_spawn_not_enough_memory()
test_spawn_objectstore()
test_spawn_raw_glance(*args, **kwargs)
test_spawn_raw_objectstore()
test_spawn_vhd_glance_linux()
test_spawn_vhd_glance_windows()
test_spawn_vlanmanager()
test_spawn_with_network_qos()
test_unrescue()
class nova.tests.test_xenapi.XenAPIVolumeTestCase(methodName='runTest')

Bases: nova.test.TestCase

Unit tests for Volume operations.

setUp()
tearDown()
test_attach_volume()

This shows how to test Ops classes’ methods.

test_attach_volume_raise_exception()

This shows how to test when exceptions are raised.

test_create_iscsi_storage()

This shows how to test helper classes’ methods.

test_parse_volume_info_raise_exception()

This shows how to test helper classes’ methods.

nova.tests.test_xenapi.reset_network(*args)
nova.tests.test_xenapi.stub_vm_utils_with_vdi_attached_here(function, should_return=True)

vm_utils.with_vdi_attached_here needs to be stubbed out because it calls down to the filesystem to attach a vdi. This provides a decorator to handle that.