The nova.tests.fake_network Module

class FakeIptablesFirewallDriver(**kwargs)

Bases: object

apply_instance_filter(instance, network_info)
setattr(key, val)
class FakeModel(*args, **kwargs)

Bases: dict

Represent a model from the db.

class FakeNetworkManager

Bases: nova.network.manager.NetworkManager

This NetworkManager doesn’t call the base class so we can bypass all inherited service cruft and just perform unit tests.

class FakeDB
fixed_ip_disassociate(context, address)
fixed_ip_get_by_instance(context, instance_uuid)
fixed_ips = [{'virtual_interface_id': 0, 'id': 100, 'address': '172.16.0.1'}, {'virtual_interface_id': 1, 'id': 200, 'address': '172.16.0.2'}, {'virtual_interface_id': 2, 'id': 210, 'address': '173.16.0.2'}]
fixed_ips_by_virtual_interface(context, vif_id)
floating_ips = [{'fixed_ip_id': 100, 'address': '172.16.1.1'}, {'fixed_ip_id': 200, 'address': '172.16.1.2'}, {'fixed_ip_id': 210, 'address': '173.16.1.2'}]
network_create_safe(context, net)
network_disassociate(context, network_id)
network_get(context, network_id, project_only='allow_none')
network_get_all(context)
network_get_all_by_uuids(context, project_only='allow_none')
network_get_by_cidr(context, cidr)
network_get_by_uuid(context, network_uuid)
vifs = [{'instance_uuid': '00000000-0000-0000-0000-000000000010', 'network_id': 1, 'id': 0, 'address': 'DC:AD:BE:FF:EF:01'}, {'instance_uuid': '00000000-0000-0000-0000-000000000020', 'network_id': 21, 'id': 1, 'address': 'DC:AD:BE:FF:EF:02'}, {'instance_uuid': '00000000-0000-0000-0000-000000000030', 'network_id': 31, 'id': 2, 'address': 'DC:AD:BE:FF:EF:03'}]
virtual_interface_get_all(context)
FakeNetworkManager.deallocate_fixed_ip(context, address=None, host=None)
FakeNetworkManager.get_instance_nw_info(context, instance_id, rxtx_factor, host, instance_uuid=None, **kwargs)
class FakeVIFDriver(*args, **kwargs)

Bases: object

get_config(instance, network, mapping, image_meta, inst_type)
plug(instance, vif)
setattr(key, val)
unplug(instance, vif)
fake_get_instance_nw_info(stubs, num_networks=1, ips_per_vif=2, floating_ips_per_fixed_ip=0, spectacular=False)
fake_network(network_id, ipv6=None)
fixed_ip_ids()
floating_ip_ids()
ipv4_like(ip, match_string)
next_fixed_ip(network_id, num_floating_ips=0)
next_floating_ip(fixed_ip_id)
set_stub_network_methods(stubs)
stub_compute_with_ips(stubs)
stub_out_nw_api_get_instance_nw_info(stubs, func=None, num_networks=1, ips_per_vif=1, floating_ips_per_fixed_ip=0, spectacular=False)
unset_stub_network_methods(stubs)
vifs(n)

Previous topic

The nova.tests.fake_loadables.fake_loadable2 Module

Next topic

The nova.tests.fake_network_cache_model Module

This Page