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

class MockSetAdminPassword

Bases: object

class ServerStatusTest(methodName='runTest')

Bases: nova.test.TestCase

setUp()
test_active()
test_password_update()
test_reboot()
test_reboot_hard()
test_rebuild()
test_rebuild_error()
test_resize()
test_revert_resize()
test_stopped()
test_verify_resize()
class ServerXMLSerializationTest(methodName='runTest')

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(methodName='runTest')

Bases: nova.test.TestCase

Servers tests using default API router with all extensions enabled.

setUp()
test_create_missing_server()

Test create with malformed body

test_update_missing_server()

Test create with malformed body

class ServersControllerCreateTest(methodName='runTest')

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_local_href()
test_create_instance_malformed_entity()
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_config_drive()
test_create_instance_with_config_drive_as_id()
test_create_instance_with_config_drive_disabled()
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_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_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_without_config_drive()
test_create_location()
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_server_bad_image_href()
class ServersControllerTest(methodName='runTest')

Bases: nova.test.TestCase

setUp()
test_admin_all_tenants()
test_admin_restricted_tenant()
test_all_tenants()
test_can_check_loaded_extensions()
test_delete_server_instance()
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_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_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 getting servers by invalid status

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_prefix()
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_name()
test_update_server_name_too_long()
test_update_server_no_body()
test_update_server_not_found()
test_update_server_not_found_on_update()
class ServersViewBuilderTest(methodName='runTest')

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_with_project_id()
test_get_flavor_deleted_instance_type()
test_get_flavor_valid_instance_type()
class TestAddressesXMLSerialization(methodName='runTest')

Bases: nova.test.TestCase

index_serializer = <nova.api.openstack.xmlutil.MasterTemplate object version 1 at 0x12c1e78c>
show_serializer = <nova.api.openstack.xmlutil.MasterTemplate object version 1 at 0x12c1ea2c>
test_index()
test_show()
test_xml_declaration()
class TestServerCreateRequestXMLDeserializer(methodName='runTest')

Bases: nova.test.TestCase

setUp()
test_access_ip()
test_access_ipv4()
test_access_ipv6()
test_admin_pass()
test_empty_metadata_personality()
test_minimal_request()
test_multiple_metadata_items()
test_multiple_personality_files()
test_request_with_empty_networks()
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_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_by_reservation(context, reservation_id='')
return_servers_by_reservation_empty(context, reservation_id='')

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