The nova.tests.test_libvirt Module

class CacheConcurrencyTestCase(*args, **kwargs)

Bases: nova.test.TestCase

setUp()
test_different_fname_concurrency()
test_same_fname_concurrency()
class FakeConfigGuest(*args, **kwargs)

Bases: object

class FakeConfigGuestDisk(*args, **kwargs)

Bases: object

class FakeVirDomainSnapshot(dom=None)

Bases: object

delete(flags)
class FakeVirtDomain(fake_xml=None, uuidstr=None)

Bases: object

UUIDString()
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(*args, **kwargs)

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_info()
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(*args, **kwargs)

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_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]', '# Completed on Tue Dec 18 15:50:25 2012', '# Generated by iptables-save v1.4.12 on Tue Dec 18 15:50:25 201;', '*mangle', ':PREROUTING ACCEPT [241:39722]', ':INPUT ACCEPT [230:39282]', ':FORWARD ACCEPT [0:0]', ':OUTPUT ACCEPT [266:26558]', ':POSTROUTING ACCEPT [267:26590]', '-A POSTROUTING -o virbr0 -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill', 'COMMIT', '# Completed on Tue Dec 18 15:50:25 2012', '# 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']
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(*args, **kwargs)

Bases: nova.test.TestCase

create_fake_libvirt_mock(**kwargs)

Defining mocks for LibvirtDriver(libvirt is not used).

create_service(**kwargs)
fake_execute(*args, **kwargs)
fake_lookup(instance_name)
setUp()
tearDown()
test_attach_invalid_volume_type()
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_vol_backed_fails()
test_check_can_live_migrate_source_vol_backed_works_correctly()
test_check_can_live_migrate_source_with_dest_not_enough_disk()
test_check_can_live_migrate_source_works_correctly()
test_cpu_info()
test_create_image_plain()
test_create_image_with_swap()
test_destroy_not_removes_disk()
test_destroy_removes_disk()
test_destroy_timed_out()
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_disk_over_committed_size_total()
test_ensure_filtering_rules_for_instance_timeout()
test_event_dispatch()
test_event_lifecycle()
test_failing_vcpu_count()

Domain can fail to return the vcpu description in case it’s just starting up or shutting down. Make sure None is handled gracefully.

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_bug_1118829()
test_get_guest_config_with_block_device()
test_get_guest_config_with_configdrive()
test_get_guest_config_with_root_device_name()
test_get_guest_config_with_spice_and_agent()
test_get_guest_config_with_spice_and_tablet()
test_get_guest_config_with_two_nics()
test_get_guest_config_with_vnc()
test_get_guest_config_with_vnc_and_spice()
test_get_guest_config_with_vnc_and_tablet()
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_excludes_volumes()
test_get_instance_disk_info_works_correctly()
test_immediate_delete()
test_list_defined_instances()
test_list_instances()
test_list_instances_when_instance_deleted()
test_live_migration_raises_exception()
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_vol_backed_works_correctly_mocked()
test_pre_live_migration_works_correctly_mocked()
test_private_destroy_not_found()
test_set_cache_mode()
test_set_cache_mode_invalid_mode()
test_set_cache_mode_invalid_object()
test_shared_storage_detection_different_host()
test_shared_storage_detection_easy()
test_shared_storage_detection_same_host()
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_from_volume_calls_cache()
test_spawn_with_network_info()
test_spawn_without_image_meta()
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_user_specified_disk_prefix()
test_xml_uuid()
class LibvirtDriverTestCase(*args, **kwargs)

Bases: nova.test.TestCase

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

setUp()
test_cleanup_failed_migration()
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_finish_revert_migration_after_crash()
test_finish_revert_migration_after_crash_before_backup()
test_finish_revert_migration_after_crash_before_new()
test_get_instance_disk_info_exception()
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(*args, **kwargs)

Bases: nova.test.TestCase

Test libvirt_nonblocking option.

setUp()
test_connection_to_primitive()
class LibvirtUtilsTestCase(*args, **kwargs)

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_fetch_raw_image()
test_file_open()
test_get_disk_backing_file()
test_get_disk_size()
test_get_fs_info()
test_get_iscsi_initiator()
test_get_missing_iscsi_initiator()
test_load_file()
test_pick_disk_driver_name()
test_write_to_file()
test_write_to_file_with_umask()
class LibvirtVolumeUsageTestCase(*args, **kwargs)

Bases: nova.test.TestCase

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

setUp()
test_get_all_volume_usage()
test_get_all_volume_usage_device_not_found()
class NWFilterFakes
filterDefineXMLMock(xml)
nwfilterLookupByName(name)
class NWFilterTestCase(*args, **kwargs)

Bases: nova.test.TestCase

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

Previous topic

The nova.tests.test_ipv6 Module

Next topic

The nova.tests.test_libvirt_blockinfo Module

This Page