nova/nova/tests/functional
Matt Riedemann 9a977cb28c Add functional recreate test for regression bug 1825537
Change I2d9ab06b485f76550dbbff46f79f40ff4c97d12f in Rocky
(and backported through to Pike) added error handling to
the resize_instance and finish_resize methods to revert
allocations in placement when a failure occurs.

This is OK for resize_instance, which runs on the source
compute, as long as the instance.host/node values have not
yet been changed to the dest host/node before RPC casting
to the finish_resize method on the dest compute. It's OK
because the instance is still on the source compute and the
DB says so, so any attempt to recover the instance via hard
reboot or rebuild will be on the source host.

This is not OK for finish_resize because if we fail there
and revert the allocations, the instance host/node values
are already pointing at the dest compute and by reverting
the allocations in placement, placement will be incorrectly
tracking the instance usage with the old flavor against the
source node resource provider rather than the new flavor
against the dest node resource provider - where the instance
is actually running and the nova DB says the instance lives.

This change adds a simple functional regression test to
recreate the bug with a multi-host resize. There is already
a same-host resize functional test marked here which will
need to be fixed as well.

Conflicts:
      nova/tests/functional/test_servers.py
      nova/virt/fake.py

NOTE(mriedem): The test_servers conflict is due to not having
change If6aa37d9b6b48791e070799ab026c816fda4441c in Rocky. As
a result, the new regression test also had to be modified for
the call to assertFlavorMatchesAllocation. The fake module
conflict is due to not having change
Iefff121640e04abdbb6a4ae546c447f168dc8af9 in Rocky.

Change-Id: Ie9e294db7e24d0e3cbe83eee847f0fbfb7478900
Related-Bug: #1825537
(cherry picked from commit f4bb672106)
(cherry picked from commit eaa1fc6159)
2019-07-05 10:21:13 -04:00
..
api Handle tags in _bury_in_cell0 2018-12-12 17:07:21 -05:00
api_sample_tests Fix os-simple-tenant-usage result order 2018-10-29 08:15:47 +00:00
compute Provide allocation_ratio/reserved amounts from update_provider_tree() 2018-10-31 11:49:46 -04:00
db Create request spec, build request and mappings in one transaction 2019-04-28 00:42:15 +00:00
libvirt Merge "Improve NeutronFixture and remove unncessary stubbing" 2018-08-02 17:44:55 +00:00
notification_sample_tests Fix race in test_volume_swap_server_with_error 2019-03-02 14:38:25 +00:00
regressions Add functional recreate test for regression bug 1825537 2019-07-05 10:21:13 -04:00
wsgi fixtures: Track volume attachments within CinderFixtureNewAttachFlow 2018-10-23 13:46:26 +01:00
__init__.py
api_paste_fixture.py Remove legacy v2 API functional tests 2016-05-04 18:17:23 +08:00
api_samples_test_base.py Fix os-simple-tenant-usage result order 2018-10-29 08:15:47 +00:00
integrated_helpers.py Add method to get cpu traits 2018-07-24 12:37:46 +00:00
test_aggregates.py Check hosts have no instances for AZ rename 2019-03-06 16:31:28 +03:00
test_availability_zones.py Update instance.availability_zone on revertResize 2019-03-28 10:20:07 -04:00
test_boot_from_volume.py Properly track local root disk usage during moves 2018-10-31 12:45:49 -04:00
test_compute_mgr.py remove unnecessary conf imports 2018-03-09 14:30:10 -05:00
test_images.py Share snapshot image membership with instance owner 2019-04-30 21:13:46 +09:00
test_instance_actions.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_legacy_v2_compatible_wrapper.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_list_servers_ip_filter.py Trivial: Nix duplicate PlacementFixture() in test 2017-12-01 15:39:28 -06:00
test_login.py
test_metadata.py Remove unused logging import 2017-02-17 15:17:51 +07:00
test_middleware.py Removes unnecessary utf-8 encoding 2016-12-20 10:27:01 +07:00
test_multiattach.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_nova_manage.py Merge "Delete instance_group_member records from API DB during archive" into stable/rocky 2018-09-21 12:01:46 +00:00
test_report_client.py Use placement microversion 1.26 in update_from_provider_tree 2018-08-20 11:48:57 -04:00
test_server_group.py Make scheduler.utils.setup_instance_group query all cells 2018-09-05 16:32:42 +00:00
test_servers.py Add functional recreate test for regression bug 1825537 2019-07-05 10:21:13 -04:00