The nova.tests.api.openstack.compute.test_servers Module

class Base64ValidationTest(*args, **kwargs)

Bases: nova.test.TestCase

setUp()
test_decode_base64()
test_decode_base64_binary()
test_decode_base64_illegal_bytes()
test_decode_base64_invalid()
test_decode_base64_whitespace()
class MockSetAdminPassword

Bases: object

class QuantumV2Subclass

Bases: nova.network.quantumv2.api.API

Used to ensure that API handles subclasses properly.

class ServerStatusTest(*args, **kwargs)

Bases: nova.test.TestCase

setUp()
test_active()
test_confirm_resize_policy_fail()
test_password_update()
test_reboot()
test_reboot_hard()
test_reboot_resize_policy_fail()
test_rebuild()
test_rebuild_error()
test_resize()
test_revert_resize()
test_revert_resize_policy_fail()
test_stopped()
test_verify_resize()
class ServerXMLSerializationTest(*args, **kwargs)

Bases: nova.test.TestCase

FLAVOR_BOOKMARK = 'http://localhost/flavors/1'
IMAGE_BOOKMARK = 'http://localhost/images/5'
SERVER_BOOKMARK = 'http://localhost/servers/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
SERVER_HREF = 'http://localhost/v2/servers/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
SERVER_NEXT = 'http://localhost/v2/servers?limit=%s&marker=%s'
TIMESTAMP = '2010-10-11T10:30:22Z'
test_action()
test_create()
test_detail()
test_index()
test_show()
test_update()
test_xml_declaration()
class ServersAllExtensionsTestCase(*args, **kwargs)

Bases: nova.test.TestCase

Servers tests using default API router with all extensions enabled.

The intent here is to catch cases where extensions end up throwing an exception because of a malformed request before the core API gets a chance to validate the request and return a 422 response.

For example, ServerDiskConfigController extends servers.Controller:

@wsgi.extends def create(self, req, body):

if ‘server’ in body:
self._set_disk_config(body[‘server’])

resp_obj = (yield) self._show(req, resp_obj)

we want to ensure that the extension isn’t barfing on an invalid body.

setUp()
test_create_missing_server()
test_update_missing_server()
class ServersControllerCreateTest(*args, **kwargs)

Bases: nova.test.TestCase

setUp()

Shared implementation for tests below that create instance.

test_create_instance()
test_create_instance_above_quota_cores()
test_create_instance_above_quota_instances()
test_create_instance_above_quota_ram()
test_create_instance_admin_pass()
test_create_instance_admin_pass_empty()
test_create_instance_admin_pass_pass_disabled()
test_create_instance_bad_flavor_href()
test_create_instance_bad_format_access_ip_v4()
test_create_instance_bad_format_access_ip_v6()
test_create_instance_bad_href()
test_create_instance_image_ref_is_bookmark()
test_create_instance_image_ref_is_invalid()
test_create_instance_invalid_alpha_max()
test_create_instance_invalid_alpha_min()
test_create_instance_invalid_flavor_href()
test_create_instance_invalid_flavor_id_int()
test_create_instance_invalid_key_name()
test_create_instance_invalid_negative_max()
test_create_instance_invalid_negative_min()
test_create_instance_invalid_personality()
test_create_instance_local_href()
test_create_instance_metadata_key_blank()
test_create_instance_metadata_key_too_long()
test_create_instance_metadata_value_too_long()
test_create_instance_name_too_long()
test_create_instance_no_key_pair()
test_create_instance_pass_disabled()
test_create_instance_too_much_metadata()
test_create_instance_valid_key_name()
test_create_instance_with_access_ip()
test_create_instance_with_access_ip_pass_disabled()
test_create_instance_with_availability_zone_disabled()
test_create_instance_with_availability_zone_enabled()
test_create_instance_with_bad_config_drive()
test_create_instance_with_bdm_delete_on_termination()
test_create_instance_with_config_drive()
test_create_instance_with_config_drive_as_id()
test_create_instance_with_config_drive_disabled()
test_create_instance_with_device_name_empty()
test_create_instance_with_device_name_not_string()
test_create_instance_with_device_name_too_long()
test_create_instance_with_disk_config_disabled()
test_create_instance_with_disk_config_enabled()
test_create_instance_with_keypairs_disabled()
test_create_instance_with_keypairs_enabled()
test_create_instance_with_multiple_create_disabled()
test_create_instance_with_multiple_create_enabled()
test_create_instance_with_networks_disabled()
test_create_instance_with_networks_disabled_quantumv2()
test_create_instance_with_networks_enabled()
test_create_instance_with_scheduler_hints_disabled()
test_create_instance_with_scheduler_hints_enabled()
test_create_instance_with_security_group_disabled()
test_create_instance_with_security_group_enabled()
test_create_instance_with_space_in_device_name()
test_create_instance_with_user_data_disabled()
test_create_instance_with_user_data_enabled()
test_create_instance_with_volumes_disabled()
test_create_instance_with_volumes_enabled()
test_create_instance_with_volumes_enabled_and_bdms_no_image()

Test that the create works if there is no image supplied but os-volumes extension is enabled and bdms are supplied

test_create_instance_with_volumes_enabled_no_image()

Test that the create will fail if there is no image and no bdms supplied in the request

test_create_instance_without_config_drive()
test_create_location()
test_create_multiple_instance_with_non_integer_max_count()
test_create_multiple_instance_with_non_integer_min_count()
test_create_multiple_instances()

Test creating multiple instances but not asking for reservation_id

test_create_multiple_instances_pass_disabled()

Test creating multiple instances but not asking for reservation_id

test_create_multiple_instances_resv_id_return()

Test creating multiple instances with asking for reservation_id

test_create_multiple_instances_with_multiple_volume_bdm()

Test that a BadRequest is raised if multiple instances are requested with a list of block device mappings for volumes.

test_create_multiple_instances_with_single_volume_bdm()

Test that a BadRequest is raised if multiple instances are requested to boot from a single volume.

test_create_server_bad_image_href()
class ServersControllerTest(*args, **kwargs)

Bases: nova.test.TestCase

setUp()
test_admin_restricted_tenant()
test_all_tenants_fail_policy()
test_all_tenants_pass_policy()
test_can_check_loaded_extensions()
test_delete_server_instance()
test_delete_server_instance_not_found()
test_delete_server_instance_while_building()
test_delete_server_instance_while_resize()
test_get_all_server_details()
test_get_all_server_details_with_host()

We want to make sure that if two instances are on the same host, then they return the same hostId. If two instances are on different hosts, they should return different hostId’s. In this test, there are 5 instances - 2 on one host and 3 on another.

test_get_server_addresses_from_cache()
test_get_server_addresses_nonexistent_network()
test_get_server_addresses_nonexistent_server()
test_get_server_by_id()
test_get_server_by_uuid()
test_get_server_details_empty()
test_get_server_details_with_limit()
test_get_server_details_with_limit_and_other_params()
test_get_server_details_with_limit_bad_value()
test_get_server_list()
test_get_server_list_empty()
test_get_server_list_with_reservation_id()
test_get_server_list_with_reservation_id_details()
test_get_server_list_with_reservation_id_empty()
test_get_server_with_active_status_by_id()
test_get_server_with_id_image_ref_by_id()
test_get_servers_admin_allows_ip()

Test getting servers by ip with admin_api enabled and admin context

test_get_servers_admin_allows_ip6()

Test getting servers by ip6 with admin_api enabled and admin context

test_get_servers_admin_filters_as_user()

Test getting servers by admin-only or unknown options when context is not admin. Make sure the admin and unknown options are stripped before they get to compute_api.get_all()

test_get_servers_admin_options_as_admin()

Test getting servers by admin-only or unknown options when context is admin. All options should be passed

test_get_servers_allows_changes_since()
test_get_servers_allows_changes_since_bad_value()
test_get_servers_allows_flavor()
test_get_servers_allows_image()
test_get_servers_allows_name()
test_get_servers_allows_status()
test_get_servers_deleted_status_as_admin()
test_get_servers_deleted_status_as_user()
test_get_servers_invalid_status()
test_get_servers_with_bad_flavor()
test_get_servers_with_bad_limit()
test_get_servers_with_bad_marker()
test_get_servers_with_bad_option()
test_get_servers_with_limit()
test_get_servers_with_limit_and_marker()
test_get_servers_with_limit_bad_value()
test_get_servers_with_marker()
test_get_servers_with_too_big_limit()
test_rebuild_instance_fails_when_min_disk_too_small()
test_rebuild_instance_fails_when_min_ram_too_small()
test_rebuild_instance_with_access_ipv4_bad_format()
test_rebuild_instance_with_access_ipv6_bad_format()
test_rebuild_instance_with_blank_metadata_key()
test_rebuild_instance_with_metadata_key_too_long()
test_rebuild_instance_with_metadata_value_too_long()
test_requested_networks_api_enabled_with_v2_subclass()
test_requested_networks_prefix()
test_requested_networks_quantumv2_disabled_with_port()
test_requested_networks_quantumv2_enabled_with_network()
test_requested_networks_quantumv2_enabled_with_network_and_port()
test_requested_networks_quantumv2_enabled_with_port()
test_requested_networks_quantumv2_subclass_with_port()
test_tenant_id_filter_converts_to_project_id_for_admin()
test_unique_host_id()

Create two servers with the same host and different project_ids and check that the hostId’s are unique

test_update_server_access_ipv4()
test_update_server_access_ipv4_bad_format()
test_update_server_access_ipv4_blank()
test_update_server_access_ipv4_none()
test_update_server_access_ipv6()
test_update_server_access_ipv6_bad_format()
test_update_server_access_ipv6_blank()
test_update_server_access_ipv6_none()
test_update_server_adminPass_ignored()
test_update_server_all_attributes()
test_update_server_invalid_xml_raises_expat()
test_update_server_invalid_xml_raises_lookup()
test_update_server_name()
test_update_server_name_too_long()
test_update_server_not_found()
test_update_server_not_found_on_update()
test_update_server_personality()
class ServersUnprocessableEntityTestCase(*args, **kwargs)

Bases: nova.test.TestCase

Tests of places we throw 422 Unprocessable Entity from

setUp()
test_create_server_malformed_entity()
test_create_server_missing_server()
test_create_server_no_body()
test_create_update_malformed_entity()
test_update_server_missing_server()
test_update_server_no_body()
class ServersViewBuilderTest(*args, **kwargs)

Bases: nova.test.TestCase

setUp()
test_build_server()
test_build_server_detail()
test_build_server_detail_active_status()
test_build_server_detail_with_accessipv4()
test_build_server_detail_with_accessipv6()
test_build_server_detail_with_fault()
test_build_server_detail_with_fault_admin()
test_build_server_detail_with_fault_but_active()
test_build_server_detail_with_fault_no_details_admin()
test_build_server_detail_with_fault_no_details_not_admin()
test_build_server_detail_with_metadata()
test_build_server_no_image()
test_build_server_with_project_id()
test_get_flavor_valid_instance_type()
class TestAddressesXMLSerialization(*args, **kwargs)

Bases: nova.test.TestCase

index_serializer = <nova.api.openstack.xmlutil.MasterTemplate object version 1 at 0x16b18250>
show_serializer = <nova.api.openstack.xmlutil.MasterTemplate object version 1 at 0x16abcd90>
test_index()
test_show()
test_xml_declaration()
class TestServerActionRequestXMLDeserializer(*args, **kwargs)

Bases: nova.test.TestCase

setUp()
test_rebuild_request()
test_rebuild_request_auto_disk_config_compat()
test_resize_request()
test_resize_request_auto_disk_config_compat()
class TestServerCreateRequestXMLDeserializer(*args, **kwargs)

Bases: nova.test.TestCase

setUp()
test_access_ip()
test_access_ipv4()
test_access_ipv6()
test_admin_pass()
test_corrupt_xml()

Should throw a 400 error on corrupt xml.

test_empty_metadata_personality()
test_minimal_request()
test_multiple_metadata_items()
test_multiple_personality_files()
test_request_with_alternate_namespace_prefix()
test_request_with_availability_zone()
test_request_with_block_device_mapping()
test_request_with_config_drive()
test_request_with_disk_config()
test_request_with_empty_networks()
test_request_with_multiple_create_args()
test_request_with_networks_duplicate_ids()
test_request_with_one_network()
test_request_with_one_network_empty_fixed_ip()
test_request_with_one_network_empty_id()
test_request_with_one_network_missing_fixed_ip()
test_request_with_one_network_missing_id()
test_request_with_scheduler_hints()
test_request_with_scheduler_hints_and_alternate_namespace_prefix()
test_request_with_second_network_node_ignored()
test_request_with_two_networks()
test_spec_request()
fake_compute_api(cls, req, id)
fake_gen_uuid()
instance_update(context, instance_uuid, values)
return_security_group(context, instance_id, security_group_id)
return_servers_empty(context, *args, **kwargs)

Previous topic

The nova.tests.api.openstack.compute.test_server_metadata Module

Next topic

The nova.tests.api.openstack.compute.test_urlmap Module

This Page