The nova.tests.test_libvirt Module

class CacheConcurrencyTestCase(methodName='runTest')

Bases: nova.test.TestCase

setUp()
tearDown()
test_different_fname_concurrency()

Ensures that two different fname caches are concurrent

test_same_fname_concurrency()

Ensures that the same fname cache runs at a sequentially

class FakeVirDomainSnapshot(dom=None)

Bases: object

delete(flags)
class FakeVirtDomain(fake_xml=None)

Bases: object

XMLDesc(*args)
create()
createWithFlags(launch_flags)
info()
managedSave(*args)
name()
class FakeVolumeDriver(*args, **kwargs)

Bases: object

attach_volume(*args)
detach_volume(*args)
get_xml(*args)
class HostStateTestCase(methodName='runTest')

Bases: nova.test.TestCase

class FakeConnection

Bases: object

Fake connection object

get_cpu_info()
get_disk_available_least()
get_host_uptime()
get_hypervisor_hostname()
get_hypervisor_type()
get_hypervisor_version()
get_instance_capabilities()
get_local_gb_total()
get_local_gb_used()
get_memory_mb_total()
get_memory_mb_used()
get_vcpu_total()
get_vcpu_used()
HostStateTestCase.cpu_info = '{"vendor": "Intel", "model": "pentium", "arch": "i686", "features": ["ssse3", "monitor", "pni", "sse2", "sse", "fxsr", "clflush", "pse36", "pat", "cmov", "mca", "pge", "mtrr", "sep", "apic"], "topology": {"cores": "1", "threads": "1", "sockets": "1"}}'
HostStateTestCase.instance_caps = [('x86_64', 'kvm', 'hvm'), ('i686', 'kvm', 'hvm')]
HostStateTestCase.test_update_status()
class IptablesFirewallTestCase(methodName='runTest')

Bases: nova.test.TestCase

in6_filter_rules = ['# Generated by ip6tables-save v1.4.4 on Tue Jan 18 23:47:56 2011', '*filter', ':INPUT ACCEPT [349155:75810423]', ':FORWARD ACCEPT [0:0]', ':OUTPUT ACCEPT [349256:75777230]', 'COMMIT', '# Completed on Tue Jan 18 23:47:56 2011']
in_filter_rules = ['# Generated by iptables-save v1.4.4 on Mon Dec 6 11:54:13 2010', '*filter', ':INPUT ACCEPT [969615:281627771]', ':FORWARD ACCEPT [0:0]', ':OUTPUT ACCEPT [915599:63811649]', ':nova-block-ipv4 - [0:0]', '[0:0] -A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT ', '[0:0] -A FORWARD -d 192.168.122.0/24 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT ', '[0:0] -A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT ', '[0:0] -A FORWARD -i virbr0 -o virbr0 -j ACCEPT ', '[0:0] -A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable ', '[0:0] -A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable ', 'COMMIT', '# Completed on Mon Dec 6 11:54:13 2010']
in_nat_rules = ['# Generated by iptables-save v1.4.10 on Sat Feb 19 00:03:19 2011', '*nat', ':PREROUTING ACCEPT [1170:189210]', ':INPUT ACCEPT [844:71028]', ':OUTPUT ACCEPT [5149:405186]', ':POSTROUTING ACCEPT [5063:386098]']
setUp()
test_do_refresh_security_group_rules()
test_filters_for_instance_with_ip_v6()
test_filters_for_instance_without_ip_v6()
test_multinic_iptables()
test_provider_firewall_rules()
test_static_filters()
test_unfilter_instance_undefines_nwfilter()
class LibvirtConnTestCase(methodName='runTest')

Bases: nova.test.TestCase

create_fake_libvirt_mock(**kwargs)

Defining mocks for LibvirtDriver(libvirt is not used).

create_service(**kwargs)
fake_execute(*args)
fake_lookup(instance_name)
setUp()
tearDown()
test_attach_invalid_volume_type()
test_available_least_handles_missing()

Ensure destroy calls managedSaveRemove for saved instance

test_broken_connection()
test_check_can_live_migrate_dest_all_pass_no_block_migration()
test_check_can_live_migrate_dest_all_pass_with_block_migration()
test_check_can_live_migrate_dest_cleanup_works_correctly()
test_check_can_live_migrate_dest_fail_shared_storage_with_blockm()
test_check_can_live_migrate_dest_incompatible_cpu_raises()
test_check_can_live_migrate_no_shared_storage_no_blck_mig_raises()
test_check_can_live_migrate_source_with_dest_not_enough_disk()
test_check_can_live_migrate_source_works_correctly()
test_cpu_info()
test_destroy_undefines()
test_destroy_undefines_no_attribute_no_managed_save()
test_destroy_undefines_no_attribute_with_managed_save()
test_destroy_undefines_no_undefine_flags()
test_diagnostic_blockstats_exception()
test_diagnostic_full()
test_diagnostic_interfacestats_exception()
test_diagnostic_memorystats_exception()
test_diagnostic_vcpus_exception()
test_ensure_filtering_rules_for_instance_timeout()

ensure_filtering_fules_for_instance() finishes with timeout.

test_get_all_block_devices()
test_get_connector()
test_get_console_output_file()
test_get_console_output_pty()
test_get_disks()
test_get_guest_config()
test_get_guest_config_with_block_device()
test_get_guest_config_with_root_device_name()
test_get_guest_config_with_two_nics()
test_get_guest_cpu_config_custom_new()
test_get_guest_cpu_config_custom_old()
test_get_guest_cpu_config_default_kvm()
test_get_guest_cpu_config_default_lxc()
test_get_guest_cpu_config_default_uml()
test_get_guest_cpu_config_host_model_new()
test_get_guest_cpu_config_host_model_old()
test_get_guest_cpu_config_host_passthrough_new()
test_get_guest_cpu_config_host_passthrough_old()
test_get_guest_cpu_config_none()
test_get_host_ip_addr()
test_get_instance_capabilities()
test_get_instance_disk_info_works_correctly()
test_immediate_delete()
test_instance = {'bridge': 'br101', 'vcpus': 2, 'root_gb': 10, 'bridge_name': 'br100', 'memory_kb': '1024000', 'ephemeral_gb': 20, 'image_ref': '155d900f-4e14-4e4c-a73d-069cbf4541e6', 'basepath': '/some/path', 'project_id': 'fake', 'instance_type_id': '5'}
test_list_instances()
test_list_instances_when_instance_deleted()
test_live_migration_raises_exception()

Confirms recover method is called when exceptions are raised.

test_lxc_container_and_uri()
test_lxc_snapshot_in_ami_format()
test_lxc_snapshot_in_qcow2_format()
test_lxc_snapshot_in_raw_format()
test_lxc_snapshot_no_image_architecture()
test_lxc_snapshot_no_original_image()
test_multi_nic()
test_pre_block_migration_works_correctly()
test_pre_live_migration_works_correctly_mocked()
test_private_destroy_not_found()
test_snapshot_in_ami_format()
test_snapshot_in_qcow2_format()
test_snapshot_in_raw_format()
test_snapshot_no_image_architecture()
test_snapshot_no_original_image()
test_spawn_with_network_info()
test_volume_in_mapping()
test_xml_and_uri()
test_xml_and_uri_no_kernel()
test_xml_and_uri_no_ramdisk()
test_xml_and_uri_no_ramdisk_no_kernel()
test_xml_and_uri_no_ramdisk_no_kernel_xen_hvm()
test_xml_and_uri_no_ramdisk_no_kernel_xen_pv()
test_xml_and_uri_rescue()
test_xml_and_uri_rescue_no_kernel()
test_xml_and_uri_rescue_no_kernel_no_ramdisk()
test_xml_and_uri_rescue_no_ramdisk()
test_xml_disk_bus_ide()
test_xml_disk_bus_ide_and_virtio()
test_xml_disk_bus_virtio()
test_xml_disk_driver()
test_xml_disk_prefix()
test_xml_uuid()
class LibvirtDriverTestCase(methodName='runTest')

Bases: nova.test.TestCase

Test for nova.virt.libvirt.libvirt_driver.LibvirtDriver.

setUp()
test_cleanup_resize_not_same_host()
test_cleanup_resize_same_host()
test_confirm_migration()
test_finish_migration()

Test for nova.virt.libvirt.libvirt_driver.LivirtConnection .finish_migration.

test_finish_revert_migration()

Test for nova.virt.libvirt.libvirt_driver.LivirtConnection .finish_revert_migration.

test_migrate_disk_and_power_off()

Test for nova.virt.libvirt.libvirt_driver.LivirtConnection .migrate_disk_and_power_off.

test_migrate_disk_and_power_off_exception()

Test for nova.virt.libvirt.libvirt_driver.LivirtConnection .migrate_disk_and_power_off.

test_wait_for_running()
class LibvirtNonblockingTestCase(methodName='runTest')

Bases: nova.test.TestCase

Test libvirt_nonblocking option

setUp()
tearDown()
test_connection_to_primitive()

Test bug 962840

class LibvirtUtilsTestCase(methodName='runTest')

Bases: nova.test.TestCase

test_chown()
test_copy_image()
test_create_cow_image()
test_create_image()
test_extract_snapshot_iso()
test_extract_snapshot_qcow2()
test_extract_snapshot_raw()
test_fetch_image()
test_file_open()
test_get_disk_backing_file()
test_get_disk_size()
test_get_fs_info()
test_get_iscsi_initiator()
test_load_file()
test_mkfs()
test_pick_disk_driver_name()
test_write_to_file()
test_write_to_file_with_umask()
class LibvirtVolumeTestCase(methodName='runTest')

Bases: nova.test.TestCase

setUp()
test_libvirt_iscsi_driver()
test_libvirt_iscsi_driver_still_in_use()
test_libvirt_lxc_volume()
test_libvirt_nfs_driver()
test_libvirt_rbd_driver()
test_libvirt_rbd_driver_auth_disabled()
test_libvirt_rbd_driver_auth_enabled()
test_libvirt_sheepdog_driver()
test_libvirt_volume_driver_serial()
class NWFilterFakes
filterDefineXMLMock(xml)
nwfilterLookupByName(name)
class NWFilterTestCase(methodName='runTest')

Bases: nova.test.TestCase

setUp()
setup_and_return_security_group()
teardown_security_group()
test_cidr_rule_nwfilter_xml()
test_creates_base_rule_first()
test_unfilter_instance_undefines_nwfilters()

Previous topic

The nova.tests.test_iscsi Module

Next topic

The nova.tests.test_libvirt_config Module

This Page