OpenStack Study: nova
OpenStack IndexPreviousNext
def _mox_schedule_method_helper(self, method_name):
def stub_method(*args, **kwargs):
def test_run_instance_exception_puts_instance_in_error_state(self):
def test_live_migration_schedule_novalidhost(self):
def test_live_migration_compute_service_notavailable(self):
def test_live_migrate(self):
def test_live_migration_set_vmstate_error(self):
def test_prep_resize_no_valid_host_back_in_active_state(self):
def test_prep_resize_no_valid_host_back_in_shutoff_state(self):
def test_prep_resize_exception_host_in_error_state_and_raise(self):
def test_set_vm_state_and_notify_adds_instance_fault(self):
def test_select_hosts_throws_rpc_clientexception(self):
def test_prep_resize_post_populates_retry(self):
class SchedulerTestCase(test.NoDBTestCase):
def setUp(self):
def fake_show(meh, context, id):
def test_hosts_up(self):
def test_handle_schedule_error_adds_instance_fault(self):
class SchedulerDriverBaseTestCase(SchedulerTestCase):
def test_unimplemented_schedule_run_instance(self):
def test_unimplemented_select_destinations(self):
class SchedulerInstanceGroupData(test.TestCase):
def setUp(self):
def _get_default_values(self):
def _create_instance_group(self, context, values, policies=None, metadata=None, members=None):
class SchedulerV3PassthroughTestCase(test.TestCase):
def setUp(self):
def test_select_destination(self):
def test_run_instance(self):
def test_prep_resize(self):
\OpenStack\nova-2014.1\nova\tests\scheduler\test_scheduler_options.py
class FakeSchedulerOptions(scheduler_options.SchedulerOptions):
def __init__(self, last_checked, now, file_old, file_now, data, filedata):
def _get_file_timestamp(self, filename):
def _get_file_handle(self, filename):
def _get_time_now(self):
class SchedulerOptionsTestCase(test.NoDBTestCase):
def test_get_configuration_first_time_no_flag(self):
def test_get_configuration_first_time_empty_file(self):
def test_get_configuration_first_time_happy_day(self):
def test_get_configuration_second_time_no_change(self):
def test_get_configuration_second_time_too_fast(self):
def test_get_configuration_second_time_change(self):
\OpenStack\nova-2014.1\nova\tests\scheduler\test_scheduler_utils.py
class SchedulerUtilsTestCase(test.NoDBTestCase):
def setUp(self):
def test_build_request_spec_without_image(self):
def test_build_request_spec_with_object(self, flavor_extra_specs_get, extract_flavor):
def _test_set_vm_state_and_notify(self, request_spec, expected_uuids):
def test_set_vm_state_and_notify_rs_uuids(self):
def test_set_vm_state_and_notify_uuid_from_instance_props(self):
def _test_populate_filter_props(self, host_state_obj=True, with_retry=True, force_hosts=None, force_nodes=None):
def test_populate_filter_props(self):
def test_populate_filter_props_host_dict(self):
def test_populate_filter_props_no_retry(self):
def test_populate_filter_props_force_hosts_no_retry(self):
def test_populate_filter_props_force_nodes_no_retry(self):
def _check_parse_options(self, opts, sep, converter, expected):
def test_parse_options(self):
\OpenStack\nova-2014.1\nova\tests\scheduler\test_weights.py
class TestWeighedHost(test.NoDBTestCase):
def test_dict_conversion(self):
def test_all_weighers(self):
class RamWeigherTestCase(test.NoDBTestCase):
def setUp(self):
def _get_weighed_host(self, hosts, weight_properties=None):
def _get_all_hosts(self):
def test_default_of_spreading_first(self):
def test_ram_filter_multiplier1(self):
def test_ram_filter_multiplier2(self):
def test_ram_filter_negative(self):
class MetricsWeigherTestCase(test.NoDBTestCase):
def setUp(self):
def _get_weighed_host(self, hosts, setting, weight_properties=None):
def _get_all_hosts(self):
def _do_test(self, settings, expected_weight, expected_host):
def test_single_resource(self):
def test_multiple_resource(self):
def test_single_resourcenegtive_ratio(self):
def test_multiple_resource_missing_ratio(self):
def test_multiple_resource_wrong_ratio(self):
def _check_parsing_result(self, weigher, setting, results):
def test_parse_setting(self):
def test_metric_not_found_required(self):
def test_metric_not_found_non_required(self):
\OpenStack\nova-2014.1\nova\tests\scheduler\__init__.py
\OpenStack\nova-2014.1\nova\tests\servicegroup\test_db_servicegroup.py
class ServiceFixture(fixtures.Fixture):
def __init__(self, host, binary, topic):
def setUp(self):
class DBServiceGroupTestCase(test.TestCase):
def setUp(self):
def test_DB_driver(self):
def test_get_all(self):
def test_service_is_up(self):
\OpenStack\nova-2014.1\nova\tests\servicegroup\test_mc_servicegroup.py
class ServiceFixture(fixtures.Fixture):
def __init__(self, host, binary, topic):
def setUp(self):
class MemcachedServiceGroupTestCase(test.TestCase):
def setUp(self):
def test_memcached_driver(self):
def test_get_all(self):
def test_service_is_up(self):
def test_report_state(self):
\OpenStack\nova-2014.1\nova\tests\servicegroup\test_zk_driver.py
class ZKServiceGroupTestCase(test.NoDBTestCase):
def setUp(self):
def test_join_leave(self):
def test_stop(self):
\OpenStack\nova-2014.1\nova\tests\servicegroup\__init__.py
\OpenStack\nova-2014.1\nova\tests\test_api_validation.py
class APIValidationTestCase(test.TestCase):
def check_validation_error(self, method, body, expected_detail):
class RequiredDisableTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_required_disable(self):
class RequiredEnableTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_required_enable(self):
def test_validate_required_enable_fails(self):
class AdditionalPropertiesEnableTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_additionalProperties_enable(self):
class AdditionalPropertiesDisableTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_additionalProperties_disable(self):
def test_validate_additionalProperties_disable_fails(self):
class StringTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_string(self):
def test_validate_string_fails(self):
class StringLengthTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_string_length(self):
def test_validate_string_length_fails(self):
class IntegerTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_integer(self):
def test_validate_integer_fails(self):
class IntegerRangeTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_integer_range(self):
def test_validate_integer_range_fails(self):
class BooleanTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_boolean(self):
def test_validate_boolean_fails(self):
class HostnameTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_hostname(self):
def test_validate_hostname_fails(self):
class HostnameIPaddressTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_hostname_or_ip_address(self):
def test_validate_hostname_or_ip_address_fails(self):
class NameTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_name(self):
def test_validate_name_fails(self):
class TcpUdpPortTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_tcp_udp_port(self):
def test_validate_tcp_udp_port_fails(self):
class UuidTestCase(APIValidationTestCase):
def setUp(self):
def post(body):
def test_validate_uuid(self):
def test_validate_uuid_fails(self):
\OpenStack\nova-2014.1\nova\tests\test_availability_zones.py
class AvailabilityZoneTestCases(test.TestCase):
def setUp(self):
def tearDown(self):
def _create_az(self, agg_name, az_name):
def _update_az(self, aggregate, az_name):
def _create_service_with_topic(self, topic, host, disabled=False):
def _destroy_service(self, service):
def _add_to_aggregate(self, service, aggregate):
def _delete_from_aggregate(self, service, aggregate):
def test_rest_availability_zone_reset_cache(self):
def test_update_host_availability_zone_cache(self):
def test_set_availability_zone_compute_service(self):
def test_set_availability_zone_unicode_key(self):
def test_set_availability_zone_not_compute_service(self):
def test_get_host_availability_zone(self):
def test_update_host_availability_zone(self):
def test_delete_host_availability_zone(self):
def test_get_availability_zones(self):
def test_get_instance_availability_zone_default_value(self):
def test_get_instance_availability_zone_from_aggregate(self):
\OpenStack\nova-2014.1\nova\tests\test_baserpc.py
class BaseAPITestCase(test.TestCase):
def setUp(self):
def test_ping(self):
def test_get_backdoor_port(self):
\OpenStack\nova-2014.1\nova\tests\test_bdm.py
class BlockDeviceMappingEc2CloudTestCase(test.NoDBTestCase):
def fake_ec2_vol_id_to_uuid(obj, ec2_id):
def fake_ec2_snap_id_to_uuid(obj, ec2_id):
def _assertApply(self, action, bdm_list):
def test_parse_block_device_mapping(self):
def test_format_block_device_mapping(self):
def test_format_mapping(self):
\OpenStack\nova-2014.1\nova\tests\test_block_device.py
class BlockDeviceTestCase(test.NoDBTestCase):
def test_properties(self):
def test_ephemeral(self):
def test_mappings_prepend_dev(self):
def test_strip_dev(self):
def test_strip_prefix(self):
def test_volume_in_mapping(self):
def _assert_volume_in_mapping(device_name, true_or_false):
def test_get_root_bdm(self):
class TestBlockDeviceDict(test.NoDBTestCase):
def setUp(self):
def test_init(self):
def fake_validate(obj, dct):
def test_validate(self):
def test_from_legacy(self):
def test_from_legacy_mapping(self):
def _get_image_bdms(bdms):
def _get_bootable_bdms(bdms):
def test_from_api(self):
def test_legacy(self):
def test_legacy_mapping(self):
def test_legacy_source_image(self):
def test_legacy_mapping_source_image(self):
def test_legacy_mapping_from_object_list(self):
def test_image_mapping(self):
def _test_snapshot_from_bdm(self, template):
def test_snapshot_from_bdm(self):
def test_snapshot_from_object(self):
\OpenStack\nova-2014.1\nova\tests\test_cinder.py
def _stub_volume(**kwargs):
class FakeHTTPClient(cinder.cinder_client.client.HTTPClient):
def _cs_request(self, url, method, **kwargs):
def get_volumes_1234(self, **kw):
def get_volumes_nonexisting(self, **kw):
def get_volumes_5678(self, **kw):
class FakeCinderClient(cinder.cinder_client.Client):
def __init__(self, username, password, project_id=None, auth_url=None, insecure=False, retries=None, cacert=None):
class FakeClientFactory(object):
def __call__(self, *args, **kwargs):
def assert_called(self, method, url, body=None, pos=-1):
class CinderTestCase(test.NoDBTestCase):
def setUp(self):
def assert_called(self, *args, **kwargs):
def test_context_with_catalog(self):
def test_cinder_endpoint_template(self):
def test_get_non_existing_volume(self):
def test_volume_with_image_metadata(self):
def test_cinder_api_insecure(self):
def test_cinder_api_cacert_file(self):
def test_cinder_http_retries(self):
\OpenStack\nova-2014.1\nova\tests\test_configdrive2.py
class ConfigDriveTestCase(test.NoDBTestCase):
def test_create_configdrive_iso(self):
def test_create_configdrive_vfat(self):
\OpenStack\nova-2014.1\nova\tests\test_context.py
class ContextTestCase(test.NoDBTestCase):
def test_request_context_sets_is_admin(self):
def test_request_context_sets_is_admin_by_role(self):
def test_request_context_sets_is_admin_upcase(self):
def test_request_context_read_deleted(self):
def test_request_context_read_deleted_invalid(self):
def test_extra_args_to_context_get_logged(self):
def fake_warn(log_msg):
def test_service_catalog_default(self):
def test_service_catalog_cinder_only(self):
def test_to_dict_from_dict_no_log(self):
def stub_warn(msg, *a, **kw):
\OpenStack\nova-2014.1\nova\tests\test_crypto.py
class X509Test(test.TestCase):
def test_can_generate_x509(self):
def test_encrypt_decrypt_x509(self):
class RevokeCertsTest(test.TestCase):
def test_revoke_certs_by_user_and_project(self):
def mock_certificate_get_all_by_user_and_project(context, user_id, project_id):
def test_revoke_certs_by_user(self):
def mock_certificate_get_all_by_user(context, user_id):
def test_revoke_certs_by_project(self):
def mock_certificate_get_all_by_project(context, project_id):
class CertExceptionTests(test.TestCase):
def test_fetch_ca_file_not_found(self):
def test_fetch_crl_file_not_found(self):
class EncryptionTests(test.TestCase):
def _ssh_decrypt_text(self, ssh_private_key, text):
def test_ssh_encrypt_decrypt_text(self):
def test_ssh_encrypt_failure(self):
class ConversionTests(test.TestCase):
def test_convert_keys(self):
def test_convert_failure(self):
\OpenStack\nova-2014.1\nova\tests\test_exception.py
class FakeNotifier(object):
def __init__(self):
def error(self, context, event, payload):
def good_function(self, context):
def bad_function_exception(self, context, extra, blah="a", boo="b", zoo=None):
class WrapExceptionTestCase(test.NoDBTestCase):
def test_wrap_exception_good_return(self):
def test_wrap_exception_with_notifier(self):
class NovaExceptionTestCase(test.NoDBTestCase):
def test_default_error_msg(self):
def test_error_msg(self):
def test_default_error_msg_with_kwargs(self):
def test_error_msg_exception_with_kwargs(self):
def test_default_error_code(self):
def test_error_code_from_kwarg(self):
def test_cleanse_dict(self):
def test_format_message_local(self):
def test_format_message_remote(self):
def test_format_message_remote_error(self):
def test_format_message_gettext_msg_returned(self):
class ExceptionTestCase(test.NoDBTestCase):
def _raise_exc(exc):
def test_exceptions_raise(self):
class ExceptionValidMessageTestCase(test.NoDBTestCase):
def test_messages(self):
\OpenStack\nova-2014.1\nova\tests\test_flavors.py
class InstanceTypeTestCase(test.TestCase):
def _generate_name(self):
def _generate_flavorid(self):
def _existing_flavor(self):
def test_add_instance_type_access(self):
def test_add_flavor_access_already_exists(self):
def test_add_flavor_access_invalid_flavor(self):
def test_remove_flavor_access(self):
def test_remove_flavor_access_doesnt_exists(self):
def test_get_all_instance_types(self):
def test_non_existent_inst_type_shouldnt_delete(self):
def test_will_not_destroy_with_no_name(self):
def test_will_not_get_bad_default_instance_type(self):
def test_will_get_flavor_by_id(self):
def test_will_not_get_flavor_by_unknown_id(self):
def test_will_not_get_flavor_with_bad_id(self):
def test_flavor_get_by_None_name_returns_default(self):
def test_will_not_get_flavor_with_bad_name(self):
def test_will_not_get_instance_by_unknown_flavor_id(self):
def test_will_get_instance_by_flavor_id(self):
def test_can_read_deleted_types_using_flavor_id(self):
def test_read_deleted_false_converting_flavorid(self):
def test_get_all_flavors_sorted_list_sort(self):
def test_get_all_flavors_sorted_list_limit(self):
def test_get_all_flavors_sorted_list_marker(self):
def test_get_inactive_flavors(self):
def test_get_inactive_flavors_with_same_name(self):
def test_get_inactive_flavors_with_same_flavorid(self):
class InstanceTypeToolsTest(test.TestCase):
def _dict_to_metadata(self, data):
def _test_extract_flavor(self, prefix):
def test_extract_flavor(self):
def test_extract_flavor_prefix(self):
def test_save_flavor_info(self):
def test_delete_flavor_info(self):
class InstanceTypeFilteringTest(test.TestCase):
def setUp(self):
def assertFilterResults(self, filters, expected):
def test_no_filters(self):
def test_min_memory_mb_filter(self):
def test_min_root_gb_filter(self):
def test_min_memory_mb_AND_root_gb_filter(self):
class CreateInstanceTypeTest(test.TestCase):
def assertInvalidInput(self, *create_args, **create_kwargs):
def test_create_with_valid_name(self):
def test_name_with_special_characters(self):
def test_non_ascii_name_with_special_characters(self):
def test_name_length_checks(self):
def test_all_whitespace_flavor_names_rejected(self):
def test_flavorid_with_invalid_characters(self):
def test_flavorid_length_checks(self):
def test_memory_must_be_positive_db_integer(self):
def test_vcpus_must_be_positive_db_integer(self):
def test_root_gb_must_be_nonnegative_db_integer(self):
def test_ephemeral_gb_must_be_nonnegative_db_integer(self):
def test_swap_must_be_nonnegative_db_integer(self):
def test_rxtx_factor_must_be_positive_float(self):
def test_rxtx_factor_must_be_within_sql_float_range(self):
def test_is_public_must_be_valid_bool_string(self):
def test_flavorid_populated(self):
def test_default_values(self):
def test_basic_create(self):
def test_create_then_delete(self):
def test_duplicate_names_fail(self):
def test_duplicate_flavorids_fail(self):
\OpenStack\nova-2014.1\nova\tests\test_hacking.py
class HackingTestCase(test.NoDBTestCase):
def test_virt_driver_imports(self):
def test_virt_driver_config_vars(self):
def test_virt_driver_imports(self):
def test_assert_true_instance(self):
def test_assert_equal_type(self):
def test_assert_equal_none(self):
\OpenStack\nova-2014.1\nova\tests\test_hooks.py
class SampleHookA(object):
def _add_called(self, op, kwargs):
def pre(self, *args, **kwargs):
class SampleHookB(SampleHookA):
def post(self, rv, *args, **kwargs):
class SampleHookC(SampleHookA):
def pre(self, f, *args, **kwargs):
def post(self, f, rv, *args, **kwargs):
class MockEntryPoint(object):
def __init__(self, cls):
def load(self):
class HookTestCase(test.NoDBTestCase):
def _mock_load_plugins(self, iload, *iargs, **ikwargs):
def setUp(self):
def _hooked(self, a, b=1, c=2, called=None):
def test_basic(self):
def test_order_of_execution(self):
class HookTestCaseWithFunction(HookTestCase):
def _mock_load_plugins(self, iload, *iargs, **ikwargs):
def _hooked(self, a, b=1, c=2, called=None):
def test_basic(self):
def test_order_of_execution(self):
\OpenStack\nova-2014.1\nova\tests\test_instance_types_extra_specs.py
class InstanceTypeExtraSpecsTestCase(test.TestCase):
def setUp(self):
def tearDown(self):
def test_instance_type_specs_get(self):
def test_flavor_extra_specs_delete(self):
def test_instance_type_extra_specs_update(self):
def test_instance_type_extra_specs_update_with_nonexisting_flavor(self):
def test_instance_type_extra_specs_create(self):
def test_instance_type_get_with_extra_specs(self):
def test_instance_type_get_by_name_with_extra_specs(self):
def test_instance_type_get_by_flavor_id_with_extra_specs(self):
def test_instance_type_get_all(self):
\OpenStack\nova-2014.1\nova\tests\test_iptables_network.py
class IptablesManagerTestCase(test.NoDBTestCase):
def setUp(self):
def test_duplicate_rules_no_dirty(self):
def test_clean_tables_no_apply(self):
def error_apply():
def test_filter_rules_are_wrapped(self):
def test_remove_rules_regex(self):
def test_nat_rules(self):
def test_filter_rules(self):
def test_missing_table(self):
def test_iptables_top_order(self):
def test_iptables_bottom_order(self):
def test_iptables_preserve_order(self):
\OpenStack\nova-2014.1\nova\tests\test_ipv6.py
class IPv6RFC2462TestCase(test.NoDBTestCase):
def setUp(self):
def test_to_global(self):
def test_to_mac(self):
def test_to_global_with_bad_mac(self):
def test_to_global_with_bad_prefix(self):
def test_to_global_with_bad_project(self):
class IPv6AccountIdentiferTestCase(test.NoDBTestCase):
def setUp(self):
def test_to_global(self):
def test_to_mac(self):
def test_to_global_with_bad_mac(self):
def test_to_global_with_bad_prefix(self):
def test_to_global_with_bad_project(self):
\OpenStack\nova-2014.1\nova\tests\test_linuxscsi.py
class StorageLinuxSCSITestCase(test.NoDBTestCase):
def setUp(self):
def fake_execute(*cmd, **kwargs):
def test_find_multipath_device_3par(self):
def fake_execute(*cmd, **kwargs):
def fake_execute2(*cmd, **kwargs):
def test_find_multipath_device_svc(self):
def fake_execute(*cmd, **kwargs):
def test_find_multipath_device_ds8000(self):
def fake_execute(*cmd, **kwargs):
\OpenStack\nova-2014.1\nova\tests\test_loadables.py
class LoadablesTestCase(test.NoDBTestCase):
def setUp(self):
def test_loader_init(self):
def _compare_classes(self, classes, expected):
def test_get_all_classes(self):
def test_get_matching_classes(self):
def test_get_matching_classes_with_underscore(self):
def test_get_matching_classes_with_wrong_type1(self):
def test_get_matching_classes_with_wrong_type2(self):
def test_get_matching_classes_with_one_function(self):
def test_get_matching_classes_with_two_functions(self):
def test_get_matching_classes_with_function_including_invalids(self):
\OpenStack\nova-2014.1\nova\tests\test_matchers.py
class TestDictMatches(testtools.TestCase, helpers.TestMatchersInterface):
class TestDictListMatches(testtools.TestCase, helpers.TestMatchersInterface):
class TestIsSubDictOf(testtools.TestCase, helpers.TestMatchersInterface):
class TestXMLMatches(testtools.TestCase, helpers.TestMatchersInterface):
\OpenStack\nova-2014.1\nova\tests\test_metadata.py
def fake_inst_obj(context):
def get_default_sys_meta():
def return_non_existing_address(*args, **kwarg):
def fake_InstanceMetadata(stubs, inst_data, address=None, sgroups=None, content=[], extra_md={}, vd_driver=None, network_info=None):
def sg_get(*args, **kwargs):
def fake_request(stubs, mdinst, relpath, address="127.0.0.1", fake_get_metadata=None, headers=None, fake_get_metadata_by_instance_id=None):
def get_metadata_by_remote_address(address):
class MetadataTestCase(test.TestCase):
def setUp(self):
def test_can_pickle_metadata(self):
def test_user_data(self):
def test_no_user_data(self):
def test_security_groups(self):
def test_local_hostname_fqdn(self):
def test_format_instance_mapping(self):
def fake_bdm_get(ctxt, uuid, use_slave=False):
def test_pubkey(self):
def test_image_type_ramdisk(self):
def test_image_type_kernel(self):
def test_check_version(self):
def test_InstanceMetadata_uses_passed_network_info(self):
def test_InstanceMetadata_invoke_metadata_for_config_drive(self):
def test_InstanceMetadata_queries_network_API_when_needed(self):
def test_local_ipv4_from_nw_info(self):
def test_local_ipv4_from_address(self):
def test_local_ipv4_from_nw_none(self):
class OpenStackMetadataTestCase(test.TestCase):
def setUp(self):
def test_with_primitive_instance(self):
def test_top_level_listing(self):
def test_version_content_listing(self):
def test_returns_apis_supported_in_havana_version(self):
def test_returns_apis_supported_in_folsom_version(self):
def test_returns_apis_supported_in_grizzly_version(self):
def test_metadata_json(self):
def test_extra_md(self):
def test_password(self):
def test_userdata(self):
def test_random_seed(self):
def test_no_dashes_in_metadata(self):
def test_vendor_data_presense(self):
def test_vendor_data_response(self):
class MetadataHandlerTestCase(test.TestCase):
def setUp(self):
def test_callable(self):
def verify(req, meta_data):
def test_root(self):
def test_root_metadata_proxy_enabled(self):
def test_version_root(self):
def test_user_data_non_existing_fixed_address(self):
def test_fixed_address_none(self):
def test_invalid_path_is_404(self):
def test_user_data_with_use_forwarded_header(self):
def fake_get_metadata(address):
def test_user_data_with_neutron_instance_id(self):
def fake_get_metadata(instance_id, remote_address):
class MetadataPasswordTestCase(test.TestCase):
def setUp(self):
def test_get_password(self):
def test_bad_method(self):
def _try_set_password(self, val='bar'):
def fake_instance_update(context, uuid, updates):
def test_set_password(self):
def test_conflict(self):
def test_too_large(self):
\OpenStack\nova-2014.1\nova\tests\test_notifications.py
class NotificationsTestCase(test.TestCase):
def setUp(self):
def fake_get_nw_info(cls, ctxt, instance):
def _wrapped_create(self, params=None):
def test_send_api_fault_disabled(self):
def test_send_api_fault(self):
def test_notif_disabled(self):
def test_task_notif(self):
def test_send_no_notif(self):
def test_send_on_vm_change(self):
def test_send_on_task_change(self):
def test_no_update_with_states(self):
def test_vm_update_with_states(self):
def test_task_update_with_states(self):
def test_update_no_service_name(self):
def test_update_with_service_name(self):
def test_update_with_host_name(self):
def test_payload_has_fixed_ip_labels(self):
def test_send_access_ip_update(self):
def test_send_name_update(self):
def test_send_no_state_change(self):
def sending_no_state_change(context, instance, **kwargs):
def test_fail_sending_update(self):
def fail_sending(context, instance, **kwargs):
\OpenStack\nova-2014.1\nova\tests\test_nova_manage.py
class FixedIpCommandsTestCase(test.TestCase):
def setUp(self):
def test_reserve(self):
def test_reserve_nonexistent_address(self):
def test_unreserve(self):
def test_unreserve_nonexistent_address(self):
def test_list(self):
def test_list_just_one_host(self):
def fake_fixed_ip_get_by_host(*args, **kwargs):
class FloatingIpCommandsTestCase(test.TestCase):
def setUp(self):
def test_address_to_hosts(self):
def assert_loop(result, expected):
class NetworkCommandsTestCase(test.TestCase):
def setUp(self):
def fake_network_get_by_cidr(context, cidr):
def fake_network_get_by_uuid(context, uuid):
def fake_network_update(context, network_id, values):
def test_create(self):
def fake_create_networks(obj, context, **kwargs):
def test_list(self):
def fake_network_get_all(context):
def test_delete(self):
def fake_network_delete_safe(context, network_id):
def test_delete_by_cidr(self):
def fake_network_delete_safe(context, network_id):
def _test_modify_base(self, update_value, project, host, dis_project=None, dis_host=None):
def test_modify_associate(self):
def test_modify_unchanged(self):
def test_modify_disassociate(self):
class FlavorCommandsTestCase(test.TestCase):
def setUp(self):
def tearDown(self):
def _test_extra_specs_empty(self):
def test_extra_specs_set_unset(self):
def test_extra_specs_update(self):
def test_extra_specs_multiple(self):
class ProjectCommandsTestCase(test.TestCase):
def setUp(self):
def test_quota(self):
def test_quota_update_invalid_key(self):
class DBCommandsTestCase(test.TestCase):
def setUp(self):
def test_archive_deleted_rows_negative(self):
class ServiceCommandsTestCase(test.TestCase):
def setUp(self):
def test_service_enable_invalid_params(self):
def test_service_disable_invalid_params(self):
\OpenStack\nova-2014.1\nova\tests\test_objectstore.py
class S3APITestCase(test.NoDBTestCase):
def setUp(self):
def get_http_connection(*args):
def _ensure_no_buckets(self, buckets):
def _ensure_one_bucket(self, buckets, name):
def test_list_buckets(self):
def test_create_and_delete_bucket(self):
def test_create_bucket_and_key_and_delete_key_again(self):
def test_unknown_bucket(self):
def tearDown(self):
\OpenStack\nova-2014.1\nova\tests\test_pipelib.py
class PipelibTest(test.TestCase):
def setUp(self):
def test_get_encoded_zip(self):
def test_launch_vpn_instance(self):
def test_setup_security_group(self):
def test_setup_key_pair(self):
\OpenStack\nova-2014.1\nova\tests\test_policy.py
class PolicyFileTestCase(test.NoDBTestCase):
def setUp(self):
def test_modified_policy_reloads(self):
class PolicyTestCase(test.NoDBTestCase):
def setUp(self):
def test_enforce_nonexistent_action_throws(self):
def test_enforce_bad_action_throws(self):
def test_enforce_bad_action_noraise(self):
def test_enforce_good_action(self):
def test_enforce_http_true(self):
def fakeurlopen(url, post_data):
def test_enforce_http_false(self):
def fakeurlopen(url, post_data):
def test_templatized_enforcement(self):
def test_early_AND_enforcement(self):
def test_early_OR_enforcement(self):
def test_ignore_case_role_check(self):
class DefaultPolicyTestCase(test.NoDBTestCase):
def setUp(self):
def _set_rules(self, default_rule):
def test_policy_called(self):
def test_not_found_policy_calls_default(self):
def test_default_not_found(self):
class IsAdminCheckTestCase(test.NoDBTestCase):
def test_init_true(self):
def test_init_false(self):
def test_call_true(self):
def test_call_false(self):
class AdminRolePolicyTestCase(test.NoDBTestCase):
def setUp(self):
def test_enforce_admin_actions_with_nonadmin_context_throws(self):
\OpenStack\nova-2014.1\nova\tests\test_quota.py
class QuotaIntegrationTestCase(test.TestCase):
def setUp(self):
def fake_run_instance(self, ctxt, request_spec, *args):
def tearDown(self):
def _create_instance(self, cores=2):
def test_too_many_instances(self):
def test_too_many_cores(self):
def test_many_cores_with_unlimited_quota(self):
def test_too_many_addresses(self):
def test_auto_assigned(self):
def test_too_many_metadata_items(self):
def _create_with_injected_files(self, files):
def test_no_injected_files(self):
def test_max_injected_files(self):
def test_too_many_injected_files(self):
def test_max_injected_file_content_bytes(self):
def test_too_many_injected_file_content_bytes(self):
def test_max_injected_file_path_bytes(self):
def test_too_many_injected_file_path_bytes(self):
def test_reservation_expire(self):
def assertInstancesReserved(reserved):
class FakeContext(object):
def __init__(self, project_id, quota_class):
def elevated(self):
class FakeDriver(object):
def __init__(self, by_project=None, by_user=None, by_class=None, reservations=None):
def get_by_project_and_user(self, context, project_id, user_id, resource):
def get_by_project(self, context, project_id, resource):
def get_by_class(self, context, quota_class, resource):
def get_defaults(self, context, resources):
def get_class_quotas(self, context, resources, quota_class, defaults=True):
def get_user_quotas(self, context, resources, project_id, user_id, quota_class=None, defaults=True, usages=True):
def get_project_quotas(self, context, resources, project_id, quota_class=None, defaults=True, usages=True, remains=False):
def limit_check(self, context, resources, values, project_id=None, user_id=None):
def reserve(self, context, resources, deltas, expire=None, project_id=None, user_id=None):
def commit(self, context, reservations, project_id=None, user_id=None):
def rollback(self, context, reservations, project_id=None, user_id=None):
def usage_reset(self, context, resources):
def destroy_all_by_project_and_user(self, context, project_id, user_id):
def destroy_all_by_project(self, context, project_id):
def expire(self, context):
class BaseResourceTestCase(test.TestCase):
def test_no_flag(self):
def test_with_flag(self):
def test_with_flag_no_quota(self):
def test_quota_no_project_no_class(self):
def test_quota_with_project_no_class(self):
def test_quota_no_project_with_class(self):
def test_quota_with_project_with_class(self):
def test_quota_override_project_with_class(self):
def test_quota_with_project_override_class(self):
class QuotaEngineTestCase(test.TestCase):
def test_init(self):
def test_init_override_string(self):
def test_init_override_obj(self):
def test_register_resource(self):
def test_register_resources(self):
def test_get_by_project_and_user(self):
def test_get_by_project(self):
def test_get_by_class(self):
def _make_quota_obj(self, driver):
def test_get_defaults(self):
def test_get_class_quotas(self):
def test_get_user_quotas(self):
def test_get_project_quotas(self):
def test_count_no_resource(self):
def test_count_wrong_resource(self):
def test_count(self):
def fake_count(context, *args, **kwargs):
def test_limit_check(self):
def test_reserve(self):
def test_commit(self):
def test_rollback(self):
def test_usage_reset(self):
def test_destroy_all_by_project_and_user(self):
def test_destroy_all_by_project(self):
def test_expire(self):
def test_resources(self):
class DbQuotaDriverTestCase(test.TestCase):
def setUp(self):
def test_get_defaults(self):
def _stub_quota_class_get_default(self):
def fake_qcgd(context):
def _stub_quota_class_get_all_by_name(self):
def fake_qcgabn(context, quota_class):
def test_get_class_quotas(self):
def test_get_class_quotas_no_defaults(self):
def _stub_get_by_project_and_user(self):
def fake_qgabpau(context, project_id, user_id):
def fake_qgabp(context, project_id):
def fake_qugabpau(context, project_id, user_id):
def test_get_user_quotas(self):
def _stub_get_by_project_and_user_specific(self):
def fake_quota_get(context, project_id, resource, user_id=None):
def test_get_by_project_and_user(self):
def _stub_get_by_project(self):
def fake_qgabp(context, project_id):
def fake_qugabp(context, project_id):
def test_get_project_quotas(self):
def test_get_user_quotas_alt_context_no_class(self):
def test_get_project_quotas_alt_context_no_class(self):
def test_get_user_quotas_alt_context_with_class(self):
def test_get_project_quotas_alt_context_with_class(self):
def test_get_user_quotas_no_defaults(self):
def test_get_project_quotas_no_defaults(self):
def test_get_user_quotas_no_usages(self):
def test_get_project_quotas_no_usages(self):
def _stub_get_settable_quotas(self):
def fake_get_project_quotas(context, resources, project_id, quota_class=None, defaults=True, usages=True, remains=False, project_quotas=None):
def fake_get_user_quotas(context, resources, project_id, user_id, quota_class=None, defaults=True, usages=True, project_quotas=None, user_quotas=None):
def fake_qgabpau(context, project_id, user_id):
def test_get_settable_quotas_with_user(self):
def test_get_settable_quotas_without_user(self):
def _stub_get_project_quotas(self):
def fake_get_project_quotas(context, resources, project_id, quota_class=None, defaults=True, usages=True, remains=False, project_quotas=None):
def test_get_quotas_has_sync_unknown(self):
def test_get_quotas_no_sync_unknown(self):
def test_get_quotas_has_sync_no_sync_resource(self):
def test_get_quotas_no_sync_has_sync_resource(self):
def test_get_quotas_has_sync(self):
def test_get_quotas_no_sync(self):
def test_limit_check_under(self):
def test_limit_check_over(self):
def test_limit_check_unlimited(self):
def test_limit_check(self):
def _stub_quota_reserve(self):
def fake_quota_reserve(context, resources, quotas, user_quotas, deltas, expire, until_refresh, max_age, project_id=None, user_id=None):
def test_reserve_bad_expire(self):
def test_reserve_default_expire(self):
def test_reserve_int_expire(self):
def test_reserve_timedelta_expire(self):
def test_reserve_datetime_expire(self):
def test_reserve_until_refresh(self):
def test_reserve_max_age(self):
def test_usage_reset(self):
def fake_quota_usage_update(context, project_id, user_id, resource, **kwargs):
class FakeSession(object):
def begin(self):
def add(self, instance):
def __enter__(self):
def __exit__(self, exc_type, exc_value, exc_traceback):
class FakeUsage(sqa_models.QuotaUsage):
def save(self, *args, **kwargs):
class QuotaReserveSqlAlchemyTestCase(test.TestCase):
def setUp(self):
def make_sync(res_name):
def fake_get_session():
def fake_get_project_quota_usages(context, session, project_id):
def fake_get_user_quota_usages(context, session, project_id, user_id):
def fake_quota_usage_create(context, project_id, user_id, resource, in_use, reserved, until_refresh, session=None, save=True):
def fake_reservation_create(context, uuid, usage_id, project_id, user_id, resource, delta, expire, session=None):
def _make_quota_usage(self, project_id, user_id, resource, in_use, reserved, until_refresh, created_at, updated_at):
def init_usage(self, project_id, user_id, resource, in_use, reserved=0, until_refresh=None, created_at=None, updated_at=None):
def compare_usage(self, usage_dict, expected):
def _make_reservation(self, uuid, usage_id, project_id, user_id, resource, delta, expire, created_at, updated_at):
def compare_reservation(self, reservations, expected):
def _update_reservations_list(self, usage_id_change=False, delta_change=False):
def _init_usages(self, *in_use, **kwargs):
def test_quota_reserve_create_usages(self):
def test_quota_reserve_negative_in_use(self):
def test_quota_reserve_until_refresh(self):
def test_quota_reserve_max_age(self):
def test_quota_reserve_no_refresh(self):
def test_quota_reserve_unders(self):
def test_quota_reserve_overs(self):
def test_quota_reserve_cores_unlimited(self):
def test_quota_reserve_ram_unlimited(self):
def test_quota_reserve_reduction(self):
class NoopQuotaDriverTestCase(test.TestCase):
def setUp(self):
def test_get_defaults(self):
def test_get_class_quotas(self):
def test_get_class_quotas_no_defaults(self):
def test_get_project_quotas(self):
def test_get_user_quotas(self):
def test_get_project_quotas_no_defaults(self):
def test_get_user_quotas_no_defaults(self):
def test_get_project_quotas_no_usages(self):
def test_get_user_quotas_no_usages(self):
\OpenStack\nova-2014.1\nova\tests\test_safeutils.py
class GetCallArgsTestCase(test.NoDBTestCase):
def _test_func(self, instance, red=None, blue=None):
def test_all_kwargs(self):
def test_all_args(self):
def test_mixed_args(self):
def test_partial_kwargs(self):
def test_partial_args(self):
def test_partial_mixed_args(self):
\OpenStack\nova-2014.1\nova\tests\test_service.py
class FakeManager(manager.Manager):
def test_method(self):
class ExtendedService(service.Service):
def test_method(self):
class ServiceManagerTestCase(test.TestCase):
def test_message_gets_to_manager(self):
def test_override_manager_method(self):
def test_service_with_min_down_time(self):
class ServiceFlagsTestCase(test.TestCase):
def test_service_enabled_on_create_based_on_flag(self):
def test_service_disabled_on_create_based_on_flag(self):
class ServiceTestCase(test.TestCase):
def setUp(self):
def test_create(self):
def _service_start_mocks(self):
def test_init_and_start_hooks(self):
def test_service_check_create_race(self):
def test_parent_graceful_shutdown(self):
def test_parent_graceful_shutdown_with_cleanup_host(self, mock_svc_get_by_args, mock_API):
def test_service_stop_waits_for_rpcserver( self, mock_rpc, mock_svc_get_by_args, mock_API):
class TestWSGIService(test.TestCase):
def setUp(self):
def test_service_random_port(self):
def test_service_start_with_illegal_workers(self):
def test_service_random_port_with_ipv6(self):
class TestLauncher(test.TestCase):
def setUp(self):
def test_launch_app(self):
\OpenStack\nova-2014.1\nova\tests\test_test.py
class IsolationTestCase(test.TestCase):
def test_service_isolation(self):
def test_rpc_consumer_isolation(self):
\OpenStack\nova-2014.1\nova\tests\test_test_utils.py
class TestUtilsTestCase(test.TestCase):
def test_get_test_admin_context(self):
def test_get_test_instance(self):
def _test_get_test_network_info(self):
def test_ipv6_supported(self):
def fake_open(path):
def fake_socket_fail(x, y):
def fake_socket_ok(x, y):
\OpenStack\nova-2014.1\nova\tests\test_utils.py
class GetMyIP4AddressTestCase(test.NoDBTestCase):
def test_get_my_ipv4_address_with_no_ipv4(self):
def fake_execute(*args, **kwargs):
OpenStack IndexPreviousNext
|