The nova.tests.xenapi.stubs Module

Stubouts, mocks and fixtures for the test suite.

class FakeSessionForFailedMigrateTests(uri)

Bases: nova.tests.xenapi.stubs.FakeSessionForVMTests

VM_assert_can_migrate(session, vmref, migrate_data, live, vdi_map, vif_map, options)
VM_migrate_send(session, vmref, migrate_data, islive, vdi_map, vif_map, options)
host_migrate_receive(session, hostref, networkref, options)
class FakeSessionForFirewallTests(uri, test_case=None)

Bases: nova.tests.xenapi.stubs.FakeSessionForVMTests

Stubs out a XenApi Session for doing IPTable Firewall tests.

host_call_plugin(_1, _2, plugin, method, args)

Mock method four host_call_plugin to be used in unit tests for the dom0 iptables Firewall drivers for XenAPI

class FakeSessionForVMTests(uri)

Bases: nova.virt.xenapi.fake.SessionBase

Stubs out a XenAPISession for VM tests.

SR_scan(session_ref, sr_ref)
VDI_snapshot(session_ref, vm_ref, _1)
VM_start(_1, ref, _2, _3)
VM_start_on(_1, vm_ref, host_ref, _2, _3)
host_call_plugin(_1, _2, plugin, method, _5)
class FakeSessionForVolumeFailedTests(uri)

Bases: nova.tests.xenapi.stubs.FakeSessionForVolumeTests

Stubs out a XenAPISession for Volume tests: it injects failures.

PBD_unplug(_1, ref)
SR_forget(_1, ref)
VDI_introduce(_1, uuid, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11)
class FakeSessionForVolumeTests(uri)

Bases: nova.virt.xenapi.fake.SessionBase

Stubs out a XenAPISession for Volume tests.

VDI_introduce(_1, uuid, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11)
class XenAPITestBase(*args, **kwargs)

Bases: nova.test.TestCase

setUp()
stub_out_migration_methods(stubs)
stub_out_vm_methods(stubs)
stubout_attach_disks(stubs)

Simulates a failure in _attach_disks.

stubout_create_vm(stubs)

Simulates a failure in create_vm.

stubout_determine_is_pv_objectstore(stubs)

Assumes VMs stu have PV kernels.

stubout_fetch_disk_image(stubs, raise_failure=False)

Simulates a failure in fetch image_glance_disk.

stubout_firewall_driver(stubs, conn)
stubout_get_this_vm_uuid(stubs)
stubout_image_service_download(stubs)
stubout_instance_snapshot(stubs)
stubout_is_snapshot(stubs)

Always returns true xenapi fake driver does not create vmrefs for snapshots

stubout_is_vdi_pv(stubs)
stubout_lookup_image(stubs)

Simulates a failure in lookup image.

stubout_session(stubs, cls, product_version=(5, 6, 2), product_brand='XenServer', **opt_args)

Stubs out methods from XenAPISession.

stubout_stream_disk(stubs)

Previous topic

The nova.tests.vmwareapi.stubs Module

Next topic

The nova.tests.xenapi.test_vm_utils Module

This Page