OpenStack Study: neutron
OpenStack IndexPreviousNext
\OpenStack\neutron-2014.1\neutron\tests\unit\test_api_v2.py
def etcdir(*p):
def _get_path(resource, id=None, action=None, fmt=None):
class ResourceIndexTestCase(base.BaseTestCase):
def test_index_json(self):
class APIv2TestBase(base.BaseTestCase):
def setUp(self):
class _ArgMatcher(object):
def __init__(self, cmp, obj):
def __eq__(self, other):
def _list_cmp(l1, l2):
class APIv2TestCase(APIv2TestBase):
def _do_field_list(self, resource, base_fields):
def _get_collection_kwargs(self, skipargs=[], **kwargs):
def test_fields(self):
def test_fields_multiple(self):
def test_fields_multiple_with_empty(self):
def test_fields_empty(self):
def test_fields_multiple_empty(self):
def test_filters(self):
def test_filters_empty(self):
def test_filters_multiple_empty(self):
def test_filters_multiple_with_empty(self):
def test_filters_multiple_values(self):
def test_filters_multiple(self):
def test_filters_with_fields(self):
def test_filters_with_convert_to(self):
def test_filters_with_convert_list_to(self):
def test_limit(self):
def test_limit_with_great_than_max_limit(self):
def test_limit_with_zero(self):
def test_limit_with_unspecific(self):
def test_limit_with_negative_value(self):
def test_limit_with_non_integer(self):
def test_limit_with_infinite_pagination_max_limit(self):
def test_limit_with_negative_pagination_max_limit(self):
def test_limit_with_non_integer_pagination_max_limit(self):
def test_marker(self):
def test_page_reverse(self):
def test_page_reverse_with_non_bool(self):
def test_page_reverse_with_unspecific(self):
def test_sort(self):
def test_sort_with_primary_key(self):
def test_sort_without_direction(self):
def test_sort_with_invalid_attribute(self):
def test_sort_with_invalid_dirs(self):
def test_emulated_sort(self):
def test_emulated_sort_without_sort_field(self):
def test_emulated_pagination(self):
def test_native_pagination_without_native_sorting(self):
def test_native_pagination_without_allow_sorting(self):
class JSONV2TestCase(APIv2TestBase, testlib_api.WebTestCase):
def setUp(self):
def _test_list(self, req_tenant_id, real_tenant_id):
def test_list_noauth(self):
def test_list_keystone(self):
def test_list_keystone_bad(self):
def test_list_pagination(self):
def test_list_pagination_with_last_page(self):
def test_list_pagination_with_empty_page(self):
def test_list_pagination_reverse_with_last_page(self):
def test_list_pagination_reverse_with_empty_page(self):
def test_create(self):
def test_create_use_defaults(self):
def test_create_no_keystone_env(self):
def test_create_with_keystone_env(self):
def test_create_bad_keystone_tenant(self):
def test_create_no_body(self):
def test_create_no_resource(self):
def test_create_missing_attr(self):
def test_create_readonly_attr(self):
def test_create_bulk(self):
def side_effect(context, network):
def test_create_bulk_no_networks(self):
def test_create_bulk_missing_attr(self):
def test_create_bulk_partial_body(self):
def test_create_attr_not_specified(self):
def test_create_return_extra_attr(self):
def test_fields(self):
def _test_delete(self, req_tenant_id, real_tenant_id, expected_code, expect_errors=False):
def test_delete_noauth(self):
def test_delete_keystone(self):
def test_delete_keystone_bad_tenant(self):
def _test_get(self, req_tenant_id, real_tenant_id, expected_code, expect_errors=False):
def test_get_noauth(self):
def test_get_keystone(self):
def test_get_keystone_bad_tenant(self):
def test_get_keystone_shared_network(self):
def test_get_keystone_strip_admin_only_attribute(self):
def _test_update(self, req_tenant_id, real_tenant_id, expected_code, expect_errors=False):
def test_update_noauth(self):
def test_update_keystone(self):
def test_update_keystone_bad_tenant(self):
def test_update_readonly_field(self):
def test_invalid_attribute_field(self):
class SubresourceTest(base.BaseTestCase):
def setUp(self):
def tearDown(self):
def test_index_sub_resource(self):
def test_show_sub_resource(self):
def test_create_sub_resource(self):
def test_update_sub_resource(self):
def test_delete_sub_resource(self):
class XMLV2TestCase(JSONV2TestCase):
class V2Views(base.BaseTestCase):
def _view(self, keys, collection, resource):
def test_network(self):
def test_port(self):
def test_subnet(self):
class NotificationTest(APIv2TestBase):
def _resource_op_notifier(self, opname, resource, expected_errors=False, notification_level='INFO'):
def test_network_create_notifer(self):
def test_network_delete_notifer(self):
def test_network_update_notifer(self):
def test_network_create_notifer_with_log_level(self):
class DHCPNotificationTest(APIv2TestBase):
def _test_dhcp_notifier(self, opname, resource, initial_input=None):
def test_network_create_dhcp_notifer(self):
def test_network_delete_dhcp_notifer(self):
def test_network_update_dhcp_notifer(self):
def test_networks_create_bulk_dhcp_notifer(self):
class QuotaTest(APIv2TestBase):
def test_create_network_quota(self):
def test_create_network_quota_no_counts(self):
def test_create_network_quota_without_limit(self):
class ExtensionTestCase(base.BaseTestCase):
def setUp(self):
def tearDown(self):
def test_extended_create(self):
class TestSubresourcePlugin():
class ListArgsTestCase(base.BaseTestCase):
def test_list_args(self):
def test_list_args_with_empty(self):
class FiltersTestCase(base.BaseTestCase):
def test_all_skip_args(self):
def test_blank_values(self):
def test_no_attr_info(self):
def test_attr_info_without_conversion(self):
def test_attr_info_with_convert_list_to(self):
def test_attr_info_with_convert_to(self):
class CreateResourceTestCase(base.BaseTestCase):
def test_resource_creation(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_api_v2_extension.py
class ExtensionTestCase(testlib_api.WebTestCase):
def _resotre_attr_map(self):
def _setUpExtension(self, plugin, service_type, resource_attribute_map, extension_class, resource_prefix, plural_mappings=None, translate_resource_name=False, allow_pagination=False, allow_sorting=False, supported_extension_aliases=None, use_quota=False, ):
def _test_entity_delete(self, entity):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_api_v2_resource.py
class RequestTestCase(base.BaseTestCase):
def setUp(self):
def test_content_type_missing(self):
def test_content_type_with_charset(self):
def test_content_type_from_accept(self):
def test_content_type_from_accept_best(self):
def test_content_type_from_query_extension(self):
def test_content_type_accept_and_query_extension(self):
def test_content_type_accept_default(self):
def test_context_with_neutron_context(self):
def test_context_without_neutron_context(self):
def test_best_match_language(self):
class ResourceTestCase(base.BaseTestCase):
def test_unmapped_neutron_error_with_json(self):
def test_unmapped_neutron_error_with_xml(self):
def test_unmapped_neutron_error_localized(self, mock_translation):
def test_mapped_neutron_error_with_json(self):
def test_mapped_neutron_error_with_xml(self):
def test_mapped_neutron_error_localized(self, mock_translation):
def test_http_error(self):
def test_unhandled_error_with_json(self):
def test_unhandled_error_with_xml(self):
def test_status_200(self):
def test_status_204(self):
def _test_error_log_level(self, map_webob_exc, expect_log_info=False, use_fault_map=True):
def test_4xx_error_logged_info_level(self):
def test_non_4xx_error_logged_exception_level(self):
def test_unmapped_error_logged_exception_level(self):
def test_no_route_args(self):
def test_post_with_body(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_attributes.py
class TestAttributes(base.BaseTestCase):
def _construct_dict_and_constraints(self):
def test_is_attr_set(self):
def test_validate_values(self):
def test_validate_not_empty_string(self):
def test_validate_not_empty_string_or_none(self):
def test_validate_string_or_none(self):
def test_validate_string(self):
def test_validate_no_whitespace(self):
def test_validate_range(self):
def _test_validate_mac_address(self, validator, allow_none=False):
def test_validate_mac_address(self):
def test_validate_mac_address_or_none(self):
def test_validate_ip_address(self):
def test_validate_ip_pools(self):
def test_validate_fixed_ips(self):
def test_validate_nameservers(self):
def test_validate_hostroutes(self):
def test_validate_ip_address_or_none(self):
def test_hostname_pattern(self):
def test_uuid_pattern(self):
def test_mac_pattern(self):
def _test_validate_subnet(self, validator, allow_none=False):
def test_validate_subnet(self):
def test_validate_subnet_or_none(self):
def _test_validate_regex(self, validator, allow_none=False):
def test_validate_regex(self):
def test_validate_regex_or_none(self):
def test_validate_uuid(self):
def test_validate_uuid_list(self):
def test_validate_dict_type(self):
def test_validate_dict_without_constraints(self):
def test_validate_a_valid_dict_with_constraints(self):
def test_validate_dict_with_invalid_validator(self):
def test_validate_dict_not_required_keys(self):
def test_validate_dict_required_keys(self):
def test_validate_dict_wrong_values(self):
def test_validate_dict_convert_boolean(self):
def test_subdictionary(self):
def test_validate_dict_or_none(self):
def test_validate_dict_or_empty(self):
def test_validate_non_negative(self):
class TestConvertToBoolean(base.BaseTestCase):
def test_convert_to_boolean_bool(self):
def test_convert_to_boolean_int(self):
def test_convert_to_boolean_str(self):
class TestConvertToInt(base.BaseTestCase):
def test_convert_to_int_int(self):
def test_convert_to_int_str(self):
def test_convert_to_int_none(self):
def test_convert_none_to_empty_list_none(self):
def test_convert_none_to_empty_dict(self):
def test_convert_none_to_empty_list_value(self):
class TestConvertKvp(base.BaseTestCase):
def test_convert_kvp_list_to_dict_succeeds_for_missing_values(self):
def test_convert_kvp_list_to_dict_succeeds_for_multiple_values(self):
def test_convert_kvp_list_to_dict_succeeds_for_values(self):
def test_convert_kvp_str_to_list_fails_for_missing_key(self):
def test_convert_kvp_str_to_list_fails_for_missing_equals(self):
def test_convert_kvp_str_to_list_succeeds_for_one_equals(self):
def test_convert_kvp_str_to_list_succeeds_for_two_equals(self):
class TestConvertToList(base.BaseTestCase):
def test_convert_to_empty_list(self):
def test_convert_to_list_string(self):
def test_convert_to_list_iterable(self):
def test_convert_to_list_non_iterable(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_auth.py
class NeutronKeystoneContextTestCase(base.BaseTestCase):
def setUp(self):
def fake_app(req):
def test_no_user_id(self):
def test_with_user_id(self):
def test_with_tenant_id(self):
def test_roles_no_admin(self):
def test_roles_with_admin(self):
def test_with_user_tenant_name(self):
def test_request_id_extracted_from_env(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_common_log.py
class TargetKlass(object):
def test_method(self, arg1, arg2, *args, **kwargs):
class TestCallLog(base.BaseTestCase):
def setUp(self):
def test_call_log_all_args(self):
def test_call_log_all_kwargs(self):
def test_call_log_known_args_unknown_args_kwargs(self):
def test_call_log_known_args_kwargs_unknown_kwargs(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_common_utils.py
class TestParseMappings(base.BaseTestCase):
def parse(self, mapping_list, unique_values=True):
def test_parse_mappings_fails_for_missing_separator(self):
def test_parse_mappings_fails_for_missing_key(self):
def test_parse_mappings_fails_for_missing_value(self):
def test_parse_mappings_fails_for_extra_separator(self):
def test_parse_mappings_fails_for_duplicate_key(self):
def test_parse_mappings_fails_for_duplicate_value(self):
def test_parse_mappings_succeeds_for_one_mapping(self):
def test_parse_mappings_succeeds_for_n_mappings(self):
def test_parse_mappings_succeeds_for_duplicate_value(self):
def test_parse_mappings_succeeds_for_no_mappings(self):
class UtilTestParseVlanRanges(base.BaseTestCase):
def _range_too_few_err(self, nv_range):
def _range_too_many_err(self, nv_range):
def _vlan_not_int_err(self, nv_range, vlan):
def _nrange_invalid_vlan(self, nv_range, n):
def _vrange_invalid_vlan(self, v_range_tuple, n):
def _vrange_invalid(self, v_range_tuple):
class TestVlanRangeVerifyValid(UtilTestParseVlanRanges):
def verify_range(self, vlan_range):
def test_range_valid_ranges(self):
def check_one_vlan_invalid(self, bad_range, which):
def test_range_first_vlan_invalid_negative(self):
def test_range_first_vlan_invalid_zero(self):
def test_range_first_vlan_invalid_limit_plus_one(self):
def test_range_first_vlan_invalid_too_big(self):
def test_range_second_vlan_invalid_negative(self):
def test_range_second_vlan_invalid_zero(self):
def test_range_second_vlan_invalid_limit_plus_one(self):
def test_range_second_vlan_invalid_too_big(self):
def test_range_both_vlans_invalid_01(self):
def test_range_both_vlans_invalid_02(self):
def test_range_both_vlans_invalid_03(self):
def test_range_both_vlans_invalid_04(self):
def test_range_reversed(self):
class TestParseOneVlanRange(UtilTestParseVlanRanges):
def parse_one(self, cfg_entry):
def test_parse_one_net_no_vlan_range(self):
def test_parse_one_net_and_vlan_range(self):
def test_parse_one_net_incomplete_range(self):
def test_parse_one_net_range_too_many(self):
def test_parse_one_net_vlan1_not_int(self):
def test_parse_one_net_vlan2_not_int(self):
def test_parse_one_net_and_max_range(self):
def test_parse_one_net_range_bad_vlan1(self):
def test_parse_one_net_range_bad_vlan2(self):
class TestParseVlanRangeList(UtilTestParseVlanRanges):
def parse_list(self, cfg_entries):
def test_parse_list_one_net_no_vlan_range(self):
def test_parse_list_one_net_vlan_range(self):
def test_parse_two_nets_no_vlan_range(self):
def test_parse_two_nets_range_and_no_range(self):
def test_parse_two_nets_no_range_and_range(self):
def test_parse_two_nets_bad_vlan_range1(self):
def test_parse_two_nets_vlan_not_int2(self):
def test_parse_two_nets_and_append_1_2(self):
def test_parse_two_nets_and_append_1_3(self):
class TestDictUtils(base.BaseTestCase):
def test_dict2str(self):
def test_str2dict(self):
def test_dict_str_conversion(self):
def test_diff_list_of_dict(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_config.py
class ConfigurationTest(base.BaseTestCase):
def test_defaults(self):
def test_load_paste_app_not_found(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_db_migration.py
class TestDbMigration(base.BaseTestCase):
def test_should_run_plugin_in_list(self):
def test_should_run_plugin_wildcard(self):
class TestCli(base.BaseTestCase):
def setUp(self):
def _main_test_helper(self, argv, func_name, exp_args=(), exp_kwargs={}):
def test_stamp(self):
def test_current(self):
def test_history(self):
def test_check_migration(self):
def test_database_sync_revision(self):
def test_upgrade(self):
def test_downgrade(self):
def _test_validate_head_file_helper(self, heads, file_content=None):
def test_validate_head_file_multiple_heads(self):
def test_validate_head_file_missing_file(self):
def test_validate_head_file_wrong_contents(self):
def test_validate_head_success(self):
def test_update_head_file_multiple_heads(self):
def test_update_head_file_success(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_db_plugin.py
def optional_ctx(obj, fallback):
def context_wrapper():
def etcdir(*p):
def _fake_get_pagination_helper(self, request):
def _fake_get_sorting_helper(self, request):
class NeutronDbPluginV2TestCase(testlib_api.WebTestCase):
def setUp(self, plugin=None, service_plugins=None, ext_mgr=None):
def _is_native_bulk_supported():
def _is_native_pagination_support():
def _is_native_sorting_support():
def tearDown(self):
def _req(self, method, resource, data=None, fmt=None, id=None, params=None, action=None, subresource=None, sub_id=None):
def new_create_request(self, resource, data, fmt=None, id=None, subresource=None):
def new_list_request(self, resource, fmt=None, params=None, subresource=None):
def new_show_request(self, resource, id, fmt=None, subresource=None, fields=None):
def new_delete_request(self, resource, id, fmt=None, subresource=None, sub_id=None):
def new_update_request(self, resource, data, id, fmt=None, subresource=None):
def new_action_request(self, resource, data, id, action, fmt=None, subresource=None):
def deserialize(self, content_type, response):
def _create_bulk_from_list(self, fmt, resource, objects, **kwargs):
def _create_bulk(self, fmt, number, resource, data, name='test', **kwargs):
def _create_network(self, fmt, name, admin_state_up, arg_list=None, **kwargs):
def _create_network_bulk(self, fmt, number, name, admin_state_up, **kwargs):
def _create_subnet(self, fmt, net_id, cidr, expected_res_status=None, **kwargs):
def _create_subnet_bulk(self, fmt, number, net_id, name, ip_version=4, **kwargs):
def _create_port(self, fmt, net_id, expected_res_status=None, arg_list=None, **kwargs):
def _list_ports(self, fmt, expected_res_status=None, net_id=None, **kwargs):
def _create_port_bulk(self, fmt, number, net_id, name, admin_state_up, **kwargs):
def _make_network(self, fmt, name, admin_state_up, **kwargs):
def _make_subnet(self, fmt, network, gateway, cidr, allocation_pools=None, ip_version=4, enable_dhcp=True, dns_nameservers=None, host_routes=None, shared=None, ipv6_ra_mode=None, ipv6_address_mode=None):
def _make_port(self, fmt, net_id, expected_res_status=None, **kwargs):
def _api_for_resource(self, resource):
def _delete(self, collection, id, expected_code=webob.exc.HTTPNoContent.code, neutron_context=None):
def _show(self, resource, id, expected_code=webob.exc.HTTPOk.code, neutron_context=None):
def _update(self, resource, id, new_data, expected_code=webob.exc.HTTPOk.code, neutron_context=None):
def _list(self, resource, fmt=None, neutron_context=None, query_params=None):
def _fail_second_call(self, patched_plugin, orig, *args, **kwargs):
def second_call(*args, **kwargs):
def _validate_behavior_on_bulk_failure( self, res, collection, errcode=webob.exc.HTTPClientError.code):
def _validate_behavior_on_bulk_success(self, res, collection, names=['test_0', 'test_1']):
def _test_list_resources(self, resource, items, neutron_context=None, query_params=None):
def network(self, name='net1', admin_state_up=True, fmt=None, do_delete=True, **kwargs):
def subnet(self, network=None, gateway_ip=ATTR_NOT_SPECIFIED, cidr='10.0.0.0/24', fmt=None, ip_version=4, allocation_pools=None, enable_dhcp=True, dns_nameservers=None, host_routes=None, shared=None, do_delete=True, ipv6_ra_mode=None, ipv6_address_mode=None):
def port(self, subnet=None, fmt=None, no_delete=False, **kwargs):
def _test_list_with_sort(self, resource, items, sorts, resources=None, query_params=''):
def _test_list_with_pagination(self, resource, items, sort, limit, expected_page_num, resources=None, query_params='', verify_key='id'):
def _test_list_with_pagination_reverse(self, resource, items, sort, limit, expected_page_num, resources=None, query_params=''):
class TestBasicGet(NeutronDbPluginV2TestCase):
def test_single_get_admin(self):
def test_single_get_tenant(self):
class TestV2HTTPResponse(NeutronDbPluginV2TestCase):
def test_create_returns_201(self):
def test_list_returns_200(self):
def _check_list_with_fields(self, res, field_name):
def test_list_with_fields(self):
def test_list_with_fields_noadmin(self):
def test_list_with_fields_noadmin_and_policy_field(self):
def test_show_returns_200(self):
def test_delete_returns_204(self):
def test_update_returns_200(self):
def test_update_invalid_json_400(self):
def test_bad_route_404(self):
class TestPortsV2(NeutronDbPluginV2TestCase):
def test_create_port_json(self):
def test_create_port_as_admin(self):
def test_create_port_bad_tenant(self):
def test_create_port_public_network(self):
def test_create_port_public_network_with_ip(self):
def test_create_ports_bulk_native(self):
def test_create_ports_bulk_emulated(self):
def fakehasattr(item, attr):
def test_create_ports_bulk_wrong_input(self):
def test_create_ports_bulk_emulated_plugin_failure(self):
def fakehasattr(item, attr):
def test_create_ports_bulk_native_plugin_failure(self):
def test_list_ports(self):
def test_list_ports_filtered_by_fixed_ip(self):
def test_list_ports_public_network(self):
def test_list_ports_with_sort_native(self):
def test_list_ports_with_sort_emulated(self):
def test_list_ports_with_pagination_native(self):
def test_list_ports_with_pagination_emulated(self):
def test_list_ports_with_pagination_reverse_native(self):
def test_list_ports_with_pagination_reverse_emulated(self):
def test_show_port(self):
def test_delete_port(self):
def test_delete_port_public_network(self):
def test_update_port(self):
def test_update_port_not_admin(self):
def test_update_device_id_null(self):
def test_delete_network_if_port_exists(self):
def test_delete_network_port_exists_owned_by_network(self):
def test_update_port_delete_ip(self):
def test_no_more_port_exception(self):
def test_update_port_update_ip(self):
def test_update_port_update_ip_address_only(self):
def test_update_port_update_ips(self):
def test_update_port_add_additional_ip(self):
def test_requested_duplicate_mac(self):
def test_mac_generation(self):
def test_mac_generation_4octet(self):
def test_bad_mac_format(self):
def test_mac_exhaustion(self):
def fake_gen_mac(context, net_id):
def test_requested_duplicate_ip(self):
def test_requested_subnet_delete(self):
def test_requested_subnet_id(self):
def test_requested_subnet_id_not_on_network(self):
def test_overlapping_subnets(self):
def test_requested_subnet_id_v4_and_v6(self):
def test_range_allocation(self):
def test_requested_invalid_fixed_ips(self):
def test_invalid_ip(self):
def test_requested_split(self):
def test_duplicate_ips(self):
def test_fixed_ip_invalid_subnet_id(self):
def test_fixed_ip_invalid_ip(self):
def test_requested_ips_only(self):
def test_invalid_admin_state(self):
def test_invalid_mac_address(self):
def test_max_fixed_ips_exceeded(self):
def test_update_max_fixed_ips_exceeded(self):
def test_delete_ports_by_device_id(self):
def _test_delete_ports_by_device_id_second_call_failure(self, plugin):
def test_delete_ports_by_device_id_second_call_failure(self):
def _test_delete_ports_ignores_port_not_found(self, plugin):
def test_delete_ports_ignores_port_not_found(self):
class TestNetworksV2(NeutronDbPluginV2TestCase):
def test_create_network(self):
def test_create_public_network(self):
def test_create_public_network_no_admin_tenant(self):
def test_update_network(self):
def test_update_shared_network_noadmin_returns_403(self):
def test_update_network_set_shared(self):
def test_update_network_set_shared_owner_returns_404(self):
def test_update_network_with_subnet_set_shared(self):
def test_update_network_set_not_shared_single_tenant(self):
def test_update_network_set_not_shared_other_tenant_returns_409(self):
def test_update_network_set_not_shared_multi_tenants_returns_409(self):
def test_update_network_set_not_shared_multi_tenants2_returns_409(self):
def test_create_networks_bulk_native(self):
def test_create_networks_bulk_native_quotas(self):
def test_create_networks_bulk_tenants_and_quotas(self):
def test_create_networks_bulk_tenants_and_quotas_fail(self):
def test_create_networks_bulk_emulated(self):
def fakehasattr(item, attr):
def test_create_networks_bulk_wrong_input(self):
def test_create_networks_bulk_emulated_plugin_failure(self):
def fakehasattr(item, attr):
def test_create_networks_bulk_native_plugin_failure(self):
def test_list_networks(self):
def test_list_networks_with_sort_native(self):
def test_list_networks_with_sort_extended_attr_native_returns_400(self):
def test_list_networks_with_sort_remote_key_native_returns_400(self):
def test_list_networks_with_sort_emulated(self):
def test_list_networks_with_pagination_native(self):
def test_list_networks_with_pagination_emulated(self):
def test_list_networks_without_pk_in_fields_pagination_emulated(self):
def test_list_networks_without_pk_in_fields_pagination_native(self):
def test_list_networks_with_pagination_reverse_native(self):
def test_list_networks_with_pagination_reverse_emulated(self):
def test_list_networks_with_parameters(self):
def test_list_networks_with_fields(self):
def test_list_networks_with_parameters_invalid_values(self):
def test_list_shared_networks_with_non_admin_user(self):
def test_show_network(self):
def test_show_network_with_subnet(self):
def test_invalid_admin_status(self):
class TestSubnetsV2(NeutronDbPluginV2TestCase):
def _test_create_subnet(self, network=None, expected=None, **kwargs):
def test_create_subnet(self):
def test_create_two_subnets(self):
def test_create_two_subnets_same_cidr_returns_400(self):
def test_create_subnet_bad_V4_cidr(self):
def test_create_subnet_bad_V6_cidr(self):
def test_create_2_subnets_overlapping_cidr_allowed_returns_200(self):
def test_create_2_subnets_overlapping_cidr_not_allowed_returns_400(self):
def test_create_subnets_bulk_native(self):
def test_create_subnets_bulk_emulated(self):
def fakehasattr(item, attr):
def test_create_subnets_bulk_emulated_plugin_failure(self):
def fakehasattr(item, attr):
def test_create_subnets_bulk_native_plugin_failure(self):
def test_delete_subnet(self):
def test_delete_subnet_port_exists_owned_by_network(self):
def test_delete_subnet_port_exists_owned_by_other(self):
def test_delete_subnet_with_other_subnet_on_network_still_in_use(self):
def test_delete_network(self):
def test_create_subnet_bad_tenant(self):
def test_create_subnet_as_admin(self):
def test_create_subnet_nonzero_cidr(self):
def test_create_subnet_bad_ip_version(self):
def test_create_subnet_bad_ip_version_null(self):
def test_create_subnet_bad_uuid(self):
def test_create_subnet_bad_boolean(self):
def test_create_subnet_bad_pools(self):
def test_create_subnet_bad_nameserver(self):
def test_create_subnet_bad_hostroutes(self):
def test_create_subnet_defaults(self):
def test_create_subnet_gw_values(self):
def test_create_subnet_gw_outside_cidr_force_on_returns_400(self):
def test_create_subnet_gw_of_network_force_on_returns_400(self):
def test_create_subnet_gw_bcast_force_on_returns_400(self):
def test_create_subnet_with_allocation_pool(self):
def test_create_subnet_with_none_gateway(self):
def test_create_subnet_with_none_gateway_fully_allocated(self):
def test_subnet_with_allocation_range(self):
def test_create_subnet_with_none_gateway_allocation_pool(self):
def test_create_subnet_with_v6_allocation_pool(self):
def test_create_subnet_with_large_allocation_pool(self):
def test_create_subnet_multiple_allocation_pools(self):
def test_create_subnet_with_dhcp_disabled(self):
def test_create_subnet_default_gw_conflict_allocation_pool_returns_409( self):
def test_create_subnet_gateway_in_allocation_pool_returns_409(self):
def test_create_subnet_overlapping_allocation_pools_returns_409(self):
def test_create_subnet_invalid_allocation_pool_returns_400(self):
def test_create_subnet_out_of_range_allocation_pool_returns_400(self):
def test_create_subnet_shared_returns_400(self):
def test_create_subnet_inconsistent_ipv6_cidrv4(self):
def test_create_subnet_inconsistent_ipv4_cidrv6(self):
def test_create_subnet_inconsistent_ipv4_gatewayv6(self):
def test_create_subnet_inconsistent_ipv6_gatewayv4(self):
def test_create_subnet_inconsistent_ipv6_dns_v4(self):
def test_create_subnet_inconsistent_ipv4_hostroute_dst_v6(self):
def test_create_subnet_inconsistent_ipv4_hostroute_np_v6(self):
def test_create_subnet_ipv6_attributes(self):
def test_create_subnet_ipv6_attributes_no_dhcp_enabled(self):
def test_create_subnet_invalid_ipv6_ra_mode(self):
def test_create_subnet_invalid_ipv6_address_mode(self):
def test_create_subnet_invalid_ipv6_combination(self):
def test_create_subnet_ipv6_single_attribute_set(self):
def test_update_subnet_no_gateway(self):
def test_update_subnet(self):
def test_update_subnet_adding_additional_host_routes_and_dns(self):
def test_update_subnet_shared_returns_400(self):
def test_update_subnet_gw_outside_cidr_force_on_returns_400(self):
def test_update_subnet_gw_ip_in_use_returns_409(self):
def test_update_subnet_inconsistent_ipv4_gatewayv6(self):
def test_update_subnet_inconsistent_ipv6_gatewayv4(self):
def test_update_subnet_inconsistent_ipv4_dns_v6(self):
def test_update_subnet_inconsistent_ipv6_hostroute_dst_v4(self):
def test_update_subnet_inconsistent_ipv6_hostroute_np_v4(self):
def test_update_subnet_gateway_in_allocation_pool_returns_409(self):
def test_update_subnet_ipv6_attributes(self):
def test_update_subnet_ipv6_inconsistent_ra_attribute(self):
def test_update_subnet_ipv6_inconsistent_address_attribute(self):
def test_update_subnet_ipv6_inconsistent_enable_dhcp(self):
def test_show_subnet(self):
def test_list_subnets(self):
def test_list_subnets_shared(self):
def test_list_subnets_with_parameter(self):
def test_list_subnets_with_sort_native(self):
def test_list_subnets_with_sort_emulated(self):
def test_list_subnets_with_pagination_native(self):
def test_list_subnets_with_pagination_emulated(self):
def test_list_subnets_with_pagination_reverse_native(self):
def test_list_subnets_with_pagination_reverse_emulated(self):
def test_invalid_ip_version(self):
def test_invalid_subnet(self):
def test_invalid_ip_address(self):
def test_invalid_uuid(self):
def test_create_subnet_with_one_dns(self):
def test_create_subnet_with_two_dns(self):
def test_create_subnet_with_too_many_dns(self):
def test_create_subnet_with_one_host_route(self):
def test_create_subnet_with_two_host_routes(self):
def test_create_subnet_with_too_many_routes(self):
def test_update_subnet_dns(self):
def test_update_subnet_dns_to_None(self):
def test_update_subnet_dns_with_too_many_entries(self):
def test_update_subnet_route(self):
def test_update_subnet_route_to_None(self):
def test_update_subnet_route_with_too_many_entries(self):
def test_delete_subnet_with_dns(self):
def test_delete_subnet_with_route(self):
def test_delete_subnet_with_dns_and_route(self):
def _helper_test_validate_subnet(self, option, exception):
def test_validate_subnet_dns_nameservers_exhausted(self):
def test_validate_subnet_host_routes_exhausted(self):
class DbModelTestCase(base.BaseTestCase):
def test_repr(self):
class TestNeutronDbPluginV2(base.BaseTestCase):
def test_generate_ip(self):
def test_generate_ip_exhausted_pool(self):
def test_rebuild_availability_ranges(self):
def return_queries_side_effect(*args, **kwargs):
class NeutronDbPluginV2AsMixinTestCase(base.BaseTestCase):
def setUp(self):
def test_create_network_with_default_status(self):
def test_create_network_with_status_BUILD(self):
class TestBasicGetXML(TestBasicGet):
class TestNetworksV2XML(TestNetworksV2):
class TestPortsV2XML(TestPortsV2):
class TestSubnetsV2XML(TestSubnetsV2):
class TestV2HTTPResponseXML(TestV2HTTPResponse):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_db_rpc_base.py
class TestDhcpRpcCallbackMixin(base.BaseTestCase):
def setUp(self):
def test_get_active_networks(self):
def _test__port_action_with_failures(self, exc=None, action=None):
def _test__port_action_good_action(self, action, port, expected_call):
def test_port_action_create_port(self):
def test_port_action_update_port(self):
def test__port_action_bad_action(self):
def test_create_port_catch_network_not_found(self):
def test_create_port_catch_subnet_not_found(self):
def test_create_port_catch_db_error(self):
def test_create_port_catch_ip_generation_failure_reraise(self):
def test_create_port_catch_and_handle_ip_generation_failure(self):
def test_get_network_info_return_none_on_not_found(self):
def test_get_network_info(self):
def _test_get_dhcp_port_helper(self, port_retval, other_expectations=[], update_port=None, create_port=None):
def test_update_dhcp_port(self):
def test_get_dhcp_port_existing(self):
def _test_get_dhcp_port_create_new(self, update_port=None):
def test_get_dhcp_port_create_new(self):
def test_get_dhcp_port_create_new_with_failure_on_port_update(self):
def test_release_dhcp_port(self):
def test_release_port_fixed_ip(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_debug_commands.py
class MyApp(object):
def __init__(self, _stdout):
class TestDebugCommands(base.BaseTestCase):
def setUp(self):
def _test_create_probe(self, device_owner):
def test_create_network_probe(self):
def test_create_nova_probe(self):
def _test_create_probe_external(self, device_owner):
def test_create_network_probe_external(self):
def test_create_nova_probe_external(self):
def test_delete_probe(self):
def test_delete_probe_external(self):
def test_delete_probe_without_namespace(self):
def test_list_probe(self):
def test_exec_command(self):
def test_exec_command_without_namespace(self):
def test_clear_probe(self):
def test_ping_all_with_ensure_port(self):
def fake_port_list(network_id=None, device_owner=None, device_id=None):
def test_ping_all(self):
def test_ping_all_v6(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_dhcp_agent.py
def etcdir(*p):
class TestDhcpAgent(base.BaseTestCase):
def setUp(self):
def test_dhcp_agent_manager(self):
def test_dhcp_agent_main_agent_manager(self):
def test_run_completes_single_pass(self):
def test_call_driver(self):
def _test_call_driver_failure(self, exc=None, trace_level='exception', expected_sync=True):
def test_call_driver_failure(self):
def test_call_driver_remote_error_net_not_found(self):
def test_call_driver_network_not_found(self):
def test_call_driver_conflict(self):
def _test_sync_state_helper(self, known_networks, active_networks):
def test_sync_state_initial(self):
def test_sync_state_same(self):
def test_sync_state_disabled_net(self):
def test_sync_state_waitall(self):
def test_sync_state_plugin_error(self):
def test_periodic_resync(self):
def test_periodoc_resync_helper(self):
def test_populate_cache_on_start_without_active_networks_support(self):
def test_populate_cache_on_start(self):
def test_none_interface_driver(self):
def test_nonexistent_interface_driver(self):
class TestLogArgs(base.BaseTestCase):
def test_log_args_without_log_dir_and_file(self):
def test_log_args_without_log_file(self):
def test_log_args_with_log_dir_and_file(self):
def test_log_args_without_log_dir(self):
def test_log_args_with_filelog_and_syslog(self):
class TestDhcpAgentEventHandler(base.BaseTestCase):
def setUp(self):
def tearDown(self):
def _enable_dhcp_helper(self, isolated_metadata=False):
def test_enable_dhcp_helper_enable_isolated_metadata(self):
def test_enable_dhcp_helper(self):
def test_enable_dhcp_helper_down_network(self):
def test_enable_dhcp_helper_network_none(self):
def test_enable_dhcp_helper_exception_during_rpc(self):
def test_enable_dhcp_helper_driver_failure(self):
def _disable_dhcp_helper_known_network(self, isolated_metadata=False):
def test_disable_dhcp_helper_known_network_isolated_metadata(self):
def test_disable_dhcp_helper_known_network(self):
def test_disable_dhcp_helper_unknown_network(self):
def _disable_dhcp_helper_driver_failure(self, isolated_metadata=False):
def test_disable_dhcp_helper_driver_failure_isolated_metadata(self):
def test_disable_dhcp_helper_driver_failure(self):
def test_enable_isolated_metadata_proxy(self):
def test_disable_isolated_metadata_proxy(self):
def test_enable_isolated_metadata_proxy_with_metadata_network(self):
def test_network_create_end(self):
def test_network_update_end_admin_state_up(self):
def test_network_update_end_admin_state_down(self):
def test_network_delete_end(self):
def test_refresh_dhcp_helper_no_dhcp_enabled_networks(self):
def test_refresh_dhcp_helper_exception_during_rpc(self):
def test_subnet_update_end(self):
def test_subnet_update_end_restart(self):
def test_subnet_update_end_delete_payload(self):
def test_port_update_end(self):
def test_port_update_change_ip_on_port(self):
def test_port_delete_end(self):
def test_port_delete_end_unknown_port(self):
class TestDhcpPluginApiProxy(base.BaseTestCase):
def setUp(self):
def tearDown(self):
def test_get_network_info(self):
def test_get_dhcp_port(self):
def test_get_dhcp_port_none(self):
def test_get_active_networks_info(self):
def test_create_dhcp_port(self):
def test_create_dhcp_port_none(self):
def test_update_dhcp_port_none(self):
def test_update_dhcp_port(self):
def test_release_dhcp_port(self):
def test_release_port_fixed_ip(self):
class TestNetworkCache(base.BaseTestCase):
def test_put_network(self):
def test_put_network_existing(self):
def test_remove_network(self):
def test_get_network_by_id(self):
def test_get_network_ids(self):
def test_get_network_by_subnet_id(self):
def test_get_network_by_port_id(self):
def test_put_port(self):
def test_put_port_existing(self):
def test_remove_port_existing(self):
def test_get_port_by_id(self):
class FakeV4Network:
class FakeV4NetworkNoGateway:
class TestDeviceManager(base.BaseTestCase):
def setUp(self):
def tearDown(self):
def _test_setup_helper(self, device_exists, reuse_existing=False, net=None, port=None):
def test_setup(self):
def test_setup_device_exists(self):
def test_setup_device_exists_reuse(self):
def test_create_dhcp_port_raise_conflict(self):
def test_create_dhcp_port_create_new(self):
def test_create_dhcp_port_update_add_subnet(self):
def test_update_dhcp_port_raises_conflict(self):
def test_create_dhcp_port_no_update_or_create(self):
def test_destroy(self):
def test_get_interface_name(self):
def test_get_device_id(self):
def _get_device_manager_with_mock_device(self, conf, device):
def test_update(self):
def test_set_default_route(self):
def test_set_default_route_no_subnet(self):
def test_set_default_route_no_subnet_delete_gateway(self):
def test_set_default_route_no_gateway(self):
def test_set_default_route_do_nothing(self):
def test_set_default_route_change_gateway(self):
def test_set_default_route_two_subnets(self):
def test_get_device_dont_call_get_dhcp_port(self):
class TestDictModel(base.BaseTestCase):
def test_basic_dict(self):
def test_dict_has_sub_dict(self):
def test_dict_contains_list(self):
def test_dict_contains_list_of_dicts(self):
class TestNetModel(base.BaseTestCase):
def test_ns_name(self):
def test_ns_name_false_namespace(self):
def test_ns_name_none_namespace(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_dhcp_scheduler.py
class DhcpSchedulerTestCase(base.BaseTestCase):
def setUp(self):
def _get_agents(self, hosts):
def _save_agents(self, agents):
def _save_networks(self, networks):
def _test__schedule_bind_network(self, agents, network_id):
def test__schedule_bind_network_single_agent(self):
def test__schedule_bind_network_multi_agents(self):
def test__schedule_bind_network_multi_agent_fail_one(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_extensions.py
def etcdir(*p):
class ExtensionsTestApp(wsgi.Router):
def __init__(self, options={}):
class FakePluginWithExtension(db_base_plugin_v2.NeutronDbPluginV2):
def method_to_support_foxnsox_extension(self, context):
class ResourceExtensionTest(base.BaseTestCase):
def test_exceptions_notimplemented(self):
def test_resource_can_be_added_as_extension(self):
def test_resource_gets_prefix_of_plugin(self):
def test_resource_extension_with_custom_member_action(self):
def test_resource_ext_with_custom_member_action_gets_plugin_prefix(self):
def test_plugin_prefix_with_parent_resource(self):
def test_resource_extension_for_get_custom_collection_action(self):
def test_resource_extension_for_put_custom_collection_action(self):
def test_resource_extension_for_post_custom_collection_action(self):
def test_resource_extension_for_delete_custom_collection_action(self):
def test_resource_ext_for_formatted_req_on_custom_collection_action(self):
def test_resource_ext_for_nested_resource_custom_collection_action(self):
def test_resource_extension_with_custom_member_action_and_attr_map(self):
def test_returns_404_for_non_existent_extension(self):
class ActionExtensionTest(base.BaseTestCase):
def setUp(self):
def test_extended_action_for_adding_extra_data(self):
def test_extended_action_for_deleting_extra_data(self):
def test_returns_404_for_non_existent_action(self):
def test_returns_404_for_non_existent_resource(self):
class RequestExtensionTest(base.BaseTestCase):
def test_headers_can_be_extended(self):
def extend_headers(req, res):
def test_extend_get_resource_response(self):
def extend_response_data(req, res):
def test_get_resources(self):
def test_edit_previously_uneditable_field(self):
def _update_handler(req, res):
def _setup_app_with_request_handler(self, handler, verb):
class ExtensionManagerTest(base.BaseTestCase):
def test_invalid_extensions_are_not_registered(self):
class PluginAwareExtensionManagerTest(base.BaseTestCase):
def test_unsupported_extensions_are_not_loaded(self):
def test_extensions_are_not_loaded_for_plugins_unaware_of_extensions(self):
def test_extensions_not_loaded_for_plugin_without_expected_interface(self):
def test_extensions_are_loaded_for_plugin_with_expected_interface(self):
def test_extensions_expecting_neutron_plugin_interface_are_loaded(self):
def test_extensions_without_need_for__plugin_interface_are_loaded(self):
def test_extension_loaded_for_non_core_plugin(self):
def test_unloaded_supported_extensions_raises_exception(self):
class ExtensionControllerTest(testlib_api.WebTestCase):
def setUp(self):
def test_index_gets_all_registerd_extensions(self):
def test_extension_can_be_accessed_by_alias(self):
def test_show_returns_not_found_for_non_existent_extension(self):
class ExtensionControllerTestXML(ExtensionControllerTest):
def app_factory(global_conf, **local_conf):
def setup_base_app():
def setup_extensions_middleware(extension_manager=None):
def _setup_extensions_test_app(extension_manager=None):
class SimpleExtensionManager(object):
def __init__(self, resource_ext=None, action_ext=None, request_ext=None):
def get_resources(self):
def get_actions(self):
def get_request_extensions(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_extension_allowedaddresspairs.py
class AllowedAddressPairTestCase(test_db_plugin.NeutronDbPluginV2TestCase):
def setUp(self, plugin=None, ext_mgr=None):
class AllowedAddressPairTestPlugin(portsecurity_db.PortSecurityDbMixin,
db_base_plugin_v2.NeutronDbPluginV2,
addr_pair_db.AllowedAddressPairsMixin):
def create_port(self, context, port):
def update_port(self, context, id, port):
class AllowedAddressPairDBTestCase(AllowedAddressPairTestCase):
def setUp(self, plugin=None, ext_mgr=None):
class TestAllowedAddressPairs(AllowedAddressPairDBTestCase):
def test_create_port_allowed_address_pairs(self):
def test_create_port_security_true_allowed_address_pairs(self):
def test_create_port_security_false_allowed_address_pairs(self):
def test_create_port_bad_mac(self):
def test_create_port_bad_ip(self):
def test_create_missing_ip_field(self):
def test_create_duplicate_mac_ip(self):
def test_create_port_extra_args(self):
def _create_port_with_address_pairs(self, address_pairs, ret_code):
def test_update_add_address_pairs(self):
def test_update_fixed_ip_to_address_pair_ip_fail(self):
def test_update_fixed_ip_to_address_pair_with_mac_fail(self):
def test_create_address_gets_port_mac(self):
def test_update_address_pair_to_match_fixed_ip_and_mac(self):
def test_update_port_security_off_address_pairs(self):
def test_create_port_remove_allowed_address_pairs(self):
class TestAllowedAddressPairsXML(TestAllowedAddressPairs):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_extension_extended_attribute.py
class ExtensionExtendedAttributeTestPlugin(
ovs_neutron_plugin.OVSNeutronPluginV2):
def __init__(self, configfile=None):
def create_ext_test_resource(self, context, ext_test_resource):
def get_ext_test_resources(self, context, filters=None, fields=None):
def get_ext_test_resource(self, context, id, fields=None):
class ExtensionExtendedAttributeTestCase(base.BaseTestCase):
def setUp(self):
def restore_attribute_map(self):
def _do_request(self, method, path, data=None, params=None, action=None):
def _ext_test_resource_create(self, attr=None):
def test_ext_test_resource_create(self):
def test_ext_test_resource_get(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_extension_extradhcpopts.py
class ExtraDhcpOptTestPlugin(db_base_plugin_v2.NeutronDbPluginV2,
edo_db.ExtraDhcpOptMixin):
def create_port(self, context, port):
def update_port(self, context, id, port):
class ExtraDhcpOptDBTestCase(test_db_plugin.NeutronDbPluginV2TestCase):
def setUp(self, plugin=DB_PLUGIN_KLASS):
class TestExtraDhcpOpt(ExtraDhcpOptDBTestCase):
def _check_opts(self, expected, returned):
def test_create_port_with_extradhcpopts(self):
def test_create_port_with_none_extradhcpopts(self):
def test_update_port_with_extradhcpopts_with_same(self):
def test_update_port_with_additional_extradhcpopt(self):
def test_update_port_with_extradhcpopts(self):
def test_update_port_with_extradhcpopt_delete(self):
def test_update_port_without_extradhcpopt_delete(self):
def test_update_port_adding_extradhcpopts(self):
def test_update_port_with_blank_string_extradhcpopt(self):
def test_update_port_with_blank_name_extradhcpopt(self):
\OpenStack\neutron-2014.1\neutron\tests\unit\test_extension_extraroute.py
class ExtraRouteTestExtensionManager(object):
def get_resources(self):
def get_actions(self):
def get_request_extensions(self):
class TestExtraRouteIntPlugin(test_l3.TestL3NatIntPlugin,
extraroute_db.ExtraRoute_db_mixin):
class TestExtraRouteL3NatServicePlugin(test_l3.TestL3NatServicePlugin,
extraroute_db.ExtraRoute_db_mixin):
class ExtraRouteDBTestCaseBase(object):
def _routes_update_prepare(self, router_id, subnet_id, port_id, routes, skip_add=False):
def _routes_update_cleanup(self, port_id, subnet_id, router_id, routes):
def test_route_update_with_one_route(self):
def test_route_clear_routes_with_None(self):
def test_router_interface_in_use_by_route(self):
OpenStack IndexPreviousNext
|