This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.tests.test_network Module

class nova.tests.test_network.CommonNetworkTestCase(methodName='runTest')

Bases: nova.test.TestCase

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_get_by_instance(context, instance_id)
network_create_safe(context, net)
network_get_all(context)
network_get_by_cidr(context, cidr)
CommonNetworkTestCase.FakeNetworkManager.deallocate_fixed_ip(context, address)
CommonNetworkTestCase.fake_create_fixed_ips(context, network_id)
CommonNetworkTestCase.test_create_networks()
CommonNetworkTestCase.test_create_networks_cidr_already_used()
CommonNetworkTestCase.test_create_networks_many()
CommonNetworkTestCase.test_remove_fixed_ip_from_instance()
CommonNetworkTestCase.test_remove_fixed_ip_from_instance_bad_input()
CommonNetworkTestCase.test_validate_cidrs()
CommonNetworkTestCase.test_validate_cidrs_already_used()
CommonNetworkTestCase.test_validate_cidrs_conflict_existing_supernet()
CommonNetworkTestCase.test_validate_cidrs_one_in_use()
CommonNetworkTestCase.test_validate_cidrs_smaller_subnet_in_use()
CommonNetworkTestCase.test_validate_cidrs_split_all_in_use()
CommonNetworkTestCase.test_validate_cidrs_split_cidr_in_use_middle_of_range()
CommonNetworkTestCase.test_validate_cidrs_split_exact_in_half()
CommonNetworkTestCase.test_validate_cidrs_split_partial()
CommonNetworkTestCase.test_validate_cidrs_split_smaller_cidr_in_use()
CommonNetworkTestCase.test_validate_cidrs_split_smaller_cidr_in_use2()
CommonNetworkTestCase.test_validate_cidrs_too_many()
class nova.tests.test_network.FakeModel(*args, **kwargs)

Bases: dict

Represent a model from the db

class nova.tests.test_network.FlatNetworkTestCase(methodName='runTest')

Bases: nova.test.TestCase

setUp()
test_add_fixed_ip_instance_without_vpn_requested_networks()
test_get_instance_nw_info()
test_validate_networks()
test_validate_networks_empty_fixed_ip()
test_validate_networks_empty_requested_networks()
test_validate_networks_invalid_fixed_ip()
test_validate_networks_none_fixed_ip()
test_validate_networks_none_requested_networks()
class nova.tests.test_network.VlanNetworkTestCase(methodName='runTest')

Bases: nova.test.TestCase

setUp()
test_add_fixed_ip_instance_without_vpn_requested_networks()
test_allocate_fixed_ip()
test_cant_associate_associated_floating_ip()
test_create_networks_too_big()
test_create_networks_too_many()
test_ip_association_and_allocation_of_other_project()

Makes sure that we cannot deallocaate or disassociate a public ip of other project

test_validate_networks()
test_validate_networks_empty_fixed_ip()
test_validate_networks_empty_requested_networks()
test_validate_networks_invalid_fixed_ip()
test_validate_networks_none_fixed_ip()
test_validate_networks_none_requested_networks()
test_vpn_allocate_fixed_ip()