nova/nova/tests/unit/api/openstack/compute
Matt Riedemann dce8618166 Allow None for block_device_mapping_v2.boot_index
The legacy v2 API allowed None for the boot_index [1]. It
allowed this implicitly because the API code would convert
the block_device_mapping_v2 dict from the request into a
BlockDeviceMapping object, which has a boot_index field that
is nullable (allows None).

The API reference documentation [2] also says:

"To disable a device from booting, set the boot index
to a negative value or use the default boot index value,
which is None."

It appears that with the move to v2.1 and request schema
validation, the boot_index schema was erroneously set to
not allow None for a value, which is not backward compatible
with the v2 API behavior.

This change fixes the schema to allow boot_index=None again
and adds a test to show it working.

This should not require a microversion bump since it's fixing
a regression in the v2.1 API which worked in the v2 API and
is already handled throughout Nova's block device code.

Closes-Bug: #1662699

[1] https://github.com/openstack/nova/blob/13.0.0/nova/compute/api.py#L1268
[2] http://developer.openstack.org/api-ref/compute/#create-server

Change-Id: Ice78a0982bcce491f0c9690903ed2c6b6aaab1be
(cherry picked from commit e34f05edb2)
(cherry picked from commit ff1925ae47)
2017-02-09 10:33:35 -05:00
..
legacy_v2 Remove legacy v2 API tests which use wsgi_app() 2016-05-25 12:47:09 +09:00
__init__.py
admin_only_action_common.py objects: you want'em 2016-06-20 21:36:05 -04:00
basic.py Remove last of the plugins/v3 from unit tests 2015-08-18 15:25:46 +08:00
dummy_schema.py Remove last of the plugins/v3 from unit tests 2015-08-18 15:25:46 +08:00
microversions.py Remove last of the plugins/v3 from unit tests 2015-08-18 15:25:46 +08:00
test_access_ips.py remove access_ips extension 2016-06-24 14:32:23 -04:00
test_admin_actions.py Remove legacy v2 unit tests[a-e] 2016-05-04 10:22:04 -07:00
test_admin_password.py Allow authorization by user_id for server changePassword action 2016-08-12 12:51:45 +00:00
test_agents.py Remove legacy v2 unit tests[a-e] 2016-05-04 10:22:04 -07:00
test_aggregates.py Aggregate create and destroy work against API db 2016-08-01 08:22:08 -07:00
test_api.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_attach_interfaces.py Add separate create/delete policies to attach_interface 2016-08-09 11:01:26 -04:00
test_auth.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_availability_zone.py Fix invalid import order 2016-07-04 11:47:18 +05:30
test_baremetal_nodes.py Deprecate Baremetal and fping API 2016-07-26 14:14:44 +08:00
test_block_device_mapping.py Allow None for block_device_mapping_v2.boot_index 2017-02-09 10:33:35 -05:00
test_block_device_mapping_v1.py Fix BDM JSON-Schema validation 2016-12-28 04:15:30 +00:00
test_cells.py Merge "Trivial-Fix: Fix typos" 2016-06-20 18:18:05 +00:00
test_certificates.py Fix invalid import order 2016-07-04 11:47:18 +05:30
test_cloudpipe.py conf: Move cloudpipe options to a group 2016-08-22 09:31:03 +01:00
test_cloudpipe_update.py Trivial-Fix: Fix typos 2016-06-13 06:41:08 +00:00
test_config_drive.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_console_auth_tokens.py Fix ConsoleAuthTokens to work for all console types 2016-06-22 17:11:09 +03:00
test_console_output.py objects: you want'em 2016-06-20 21:36:05 -04:00
test_consoles.py Remove mox from unit/api/openstack/compute/test_consoles.py 2016-06-01 09:00:49 +00:00
test_create_backup.py Remove legacy v2 unit tests[a-e] 2016-05-04 10:22:04 -07:00
test_deferred_delete.py Add handle for 2 exceptions in force_delete 2016-11-22 09:53:40 +00:00
test_disk_config.py Allow authorization by user_id for server update 2016-08-12 13:18:55 +00:00
test_evacuate.py Allow authorization by user_id for server evacuate 2016-08-12 13:19:17 +00:00
test_extended_availability_zone.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_extended_hypervisors.py Microversion 2.33 adds pagination support for hypervisors 2016-07-01 08:47:50 +08:00
test_extended_ips.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_extended_ips_mac.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_extended_server_attributes.py Return HTTP 200 on list for invalid status 2016-06-30 16:09:53 +00:00
test_extended_status.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_extended_volumes.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_extension_info.py Merge ""nova list-extensions" not showing summary for all" 2016-07-27 14:13:47 +00:00
test_extensions.py remove processing of blacklist/whitelist/corelist extensions 2016-06-10 11:37:09 -04:00
test_fixed_ips.py Deprecate FixedIP related proxy APIs 2016-07-21 13:31:16 +08:00
test_flavor_access.py Remove legacy v2 unit tests[f-n] 2016-05-06 13:58:40 +09:00
test_flavor_disabled.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_flavor_manage.py Return 400 HTTP error for invalid flavor attributes 2016-05-26 09:49:39 +05:30
test_flavor_rxtx.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_flavor_swap.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_flavorextradata.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_flavors.py Remove deprecated legacy_api config options 2016-08-05 11:18:48 +00:00
test_flavors_extra_specs.py Stop using mox stubs in stub_out_key_pair_funcs 2016-06-08 13:20:07 +09:00
test_floating_ip_dns.py Deprecated floating ip related proxy APIs 2016-07-26 14:14:44 +08:00
test_floating_ip_pools.py Deprecated floating ip related proxy APIs 2016-07-26 14:14:44 +08:00
test_floating_ips.py Deprecated floating ip related proxy APIs 2016-07-26 14:14:44 +08:00
test_floating_ips_bulk.py Deprecated floating ip related proxy APIs 2016-07-26 14:14:44 +08:00
test_fping.py Deprecate Baremetal and fping API 2016-07-26 14:14:44 +08:00
test_hide_server_addresses.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_hosts.py Remove legacy v2 unit tests[f-n] 2016-05-06 13:58:40 +09:00
test_hypervisor_status.py Microversion 2.28 changes cpu_info string to JSON object 2016-06-01 16:25:17 +00:00
test_hypervisors.py Handle ComputeHostNotFound when listing hypervisors 2016-12-07 09:25:59 +00:00
test_image_metadata.py Remove legacy v2 unit tests[f-n] 2016-05-06 13:58:40 +09:00
test_image_size.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_images.py Depracate Images Proxy APIs 2016-07-21 00:50:36 +08:00
test_instance_actions.py objects: you want'em 2016-06-20 21:36:05 -04:00
test_instance_usage_audit_log.py Merge "Remove mox from compute/test_instance_usage_audit_log.py" 2016-06-09 10:34:29 +00:00
test_keypairs.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_limits.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_lock_server.py Fix policy tests for project_id enforcement 2016-09-11 23:43:41 +00:00
test_microversions.py Support for both microversion headers 2016-05-25 21:41:27 +00:00
test_migrate_server.py Add missing ComputeHostNotFound exception in live-migration 2016-07-29 10:17:26 +02:00
test_migrations.py Fix invalid import order 2016-07-04 11:47:18 +05:30
test_multinic.py objects: you want'em 2016-06-20 21:36:05 -04:00
test_multiple_create.py Stop using mox stubs in stub_out_key_pair_funcs 2016-06-08 13:20:07 +09:00
test_networks.py Provide more duplicate VLAN network error info 2016-08-23 00:14:10 +00:00
test_neutron_security_groups.py Merge "Tests: use fakes.HTTPRequest in compute tests" 2016-08-30 12:09:20 +00:00
test_pause_server.py Fix policy tests for project_id enforcement 2016-09-11 23:43:41 +00:00
test_pci.py Fix invalid import order 2016-07-04 16:03:42 +05:30
test_plugin_framework.py Remove unused CONF imports 2016-02-15 16:40:53 +11:00
test_quota_classes.py Remove legacy v2 unit tests[q-v] 2016-05-06 13:58:40 +09:00
test_quotas.py Add networks to quota's update json-schema when network quota enabled 2016-08-22 13:56:48 +08:00
test_remote_consoles.py objects: you want'em 2016-06-20 21:36:05 -04:00
test_rescue.py Fix policy tests for project_id enforcement 2016-09-11 23:43:41 +00:00
test_scheduler_hints.py Remove DictCompat from SecurityGroup 2016-07-06 14:30:09 -04:00
test_security_group_default_rules.py Remove deprecated security_group_api config option 2016-08-19 16:22:12 -05:00
test_security_groups.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_server_actions.py Allow authorization by user_id for server rebuild 2016-08-11 10:46:40 -04:00
test_server_diagnostics.py API: catch InstanceNotReady exception. 2016-07-07 16:48:13 +08:00
test_server_external_events.py Fix expected_attrs kwarg in server_external_events 2016-11-30 09:14:49 +00:00
test_server_group_quotas.py Remove legacy v2 unit tests[q-v] 2016-05-06 13:58:40 +09:00
test_server_groups.py Fix invalid import order 2016-07-04 16:03:42 +05:30
test_server_metadata.py Stop using mox stubs in stub_out_key_pair_funcs 2016-06-08 13:20:07 +09:00
test_server_migrations.py Fix invalid import order 2016-07-04 16:03:42 +05:30
test_server_password.py Move config options from nova/api directory (5) 2016-05-17 13:07:47 +00:00
test_server_reset_state.py objects: you want'em 2016-06-20 21:36:05 -04:00
test_server_start_stop.py Add tests for user_id policy enforcement on stop 2016-08-12 02:40:31 +00:00
test_server_tags.py Fix PUT server tag 201 to return empty content 2016-07-13 18:45:12 +09:00
test_server_usage.py Remove deprecated legacy_api config options 2016-08-05 11:18:48 +00:00
test_serversV21.py Merge "Update BuildRequest if instance currently being scheduled" 2016-09-13 20:30:39 +00:00
test_services.py Remove compute host from all host aggregates when compute service is deleted 2016-07-16 22:19:44 +03:00
test_shelve.py Allow authorization by user_id for server shelve action 2016-08-12 12:33:39 +09:00
test_simple_tenant_usage.py Fix up legacy resource fields in simple-tenant-usage 2016-07-12 09:16:35 -07:00
test_snapshots.py Deprecate volumes related APIs 2016-07-26 14:14:44 +08:00
test_suspend_server.py Fix policy tests for project_id enforcement 2016-09-11 23:43:41 +00:00
test_tenant_networks.py Deprecated networks related proxy APIs 2016-07-21 13:29:41 +08:00
test_urlmap.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_used_limits.py don't report network limits after 2.35 2016-08-18 23:55:58 +08:00
test_user_data.py Fix invalid import order 2016-07-04 16:03:42 +05:30
test_versions.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_virtual_interfaces.py objects: you want'em 2016-06-20 21:36:05 -04:00
test_volumes.py Merge "Catch DevicePathInUse in attach_volume" into stable/newton 2016-10-17 00:40:35 +00:00