nova/nova/tests/functional/regressions
Lee Yarwood bf89a23d91 api: Reject requests to force up computes when `done` evacuation records exist
When evacuating an instance the evacuation migration record moves from a
state of `accepted` to `pre-migrating` and eventually `done` once the
instance has been rebuilt on the new compute host. At present the
migration record remains in this state until the original compute host
is restarted and the service cleans up any leftovers of the instance
before it is moved to a state of `completed`.

Bug #1922053 details a use case where an operator might unintentionally
forget to ensure the compute service is restarted before forcing the
service up leaving evacuation migration records stuck as `done`.

This could become an issue in the future if the instance is moved back
to this compute before the service is restarted. Any future restart
invoking the cleanup logic and potentially damaging the running
instance.

This change aims to address this by blocking requests to force up
computes associated to `done` evacuation records. Forcing operators to
restart the service allowing them to move to a `completed` state before
the service can be forced up again.

To allow this to be backportable these requests are rejected with a 400
BadRequest return code from the API. A TODO is left to move this to a
409 Conflict during the Xena release under a new microversion.

Finally, some additional functional tests have been updated to ensure
they restart the source compute service of an evacuation before
attempting to force up the service, ensuring any migration records are
marked as completed.

Closes-Bug: #1922053
Change-Id: I95882ea28564a31a6b4f8b665de462774d84edfc
2021-04-01 19:28:34 +01:00
..
README.rst add a place for functional test to block specific regressions 2016-02-24 18:14:27 +00:00
__init__.py add a place for functional test to block specific regressions 2016-02-24 18:14:27 +00:00
test_bug_1404867.py func: Add CinderFixture to _IntegratedTestBase 2020-08-03 20:41:18 +01:00
test_bug_1522536.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1541691.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1548980.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1552888.py Trivial-Fix: Fix typos 2016-06-13 06:41:08 +00:00
test_bug_1554631.py Catching OverQuota Exception 2017-05-03 19:00:34 +00:00
test_bug_1558866.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1568208.py Fix generation of Guru Meditation Report 2016-04-13 17:00:32 +03:00
test_bug_1595962.py libvirt: Remove support for '[libvirt] use_usb_tablet' 2020-10-06 13:16:11 +01:00
test_bug_1620248.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1669054.py Use _evacuate_server helper in func test 2020-11-04 13:23:40 +00:00
test_bug_1670627.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1671648.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1675570.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1678326.py functional: Rework '_delete_server' 2019-11-15 16:06:57 +00:00
test_bug_1679750.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1682693.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1689692.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1702454.py Refactoring of functional.regression.test_bug_1702454 2020-12-15 16:43:03 +01:00
test_bug_1713783.py Use _evacuate_server helper in func test 2020-11-04 13:23:40 +00:00
test_bug_1718455.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1718512.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1719730.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1732947.py func: Add CinderFixture to _IntegratedTestBase 2020-08-03 20:41:18 +01:00
test_bug_1735407.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1741125.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_bug_1741307.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1746483.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1764556.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1764883.py Use _evacuate_server helper in func test 2020-11-04 13:23:40 +00:00
test_bug_1778305.py Don't generate service UUID for deleted services 2019-07-30 18:48:51 +00:00
test_bug_1780373.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1781286.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1781710.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1784353.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1790204.py Make API always RPC cast to conductor for resize/migrate 2019-11-13 10:19:53 -05:00
test_bug_1794996.py Use _evacuate_server helper in func test 2020-11-04 13:23:40 +00:00
test_bug_1797580.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1806064.py functional: Add '_delete_server' to 'InstanceHelperMixin' 2020-01-15 10:31:24 +00:00
test_bug_1806515.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1815153.py Use _evacuate_server helper in func test 2020-11-04 13:23:40 +00:00
test_bug_1823370.py Use _evacuate_server helper in func test 2020-11-04 13:23:40 +00:00
test_bug_1825020.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1825034.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1825537.py functional: Remove 'api' parameter 2019-12-06 15:35:33 +00:00
test_bug_1830747.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1831771.py functional: Avoid race and fix use of self.api within test_bug_1831771 2020-03-04 13:39:45 +00:00
test_bug_1835822.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1837955.py functional: Drop '_api' suffix from placement fixture 2020-08-19 18:07:25 +01:00
test_bug_1839560.py nova-manage db archive_deleted_rows is not multi-cell aware 2019-08-27 06:01:58 +00:00
test_bug_1843090.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_bug_1843708.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1845291.py functional: Remove 'api' parameter 2019-12-06 15:35:33 +00:00
test_bug_1848343.py functional: Add '_create_server' helper 2020-01-20 14:32:43 +00:00
test_bug_1849165.py functional: Remove 'api' parameter 2019-12-06 15:35:33 +00:00
test_bug_1849409.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1852458.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1862633.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1879878.py functional: Enable real policy fixture by default 2020-09-16 11:31:23 +01:00
test_bug_1886418.py functional: Enable real policy fixture by default 2020-09-16 11:31:23 +01:00
test_bug_1888395.py fakelibvirt: make kB_mem default not laughable 2021-03-09 15:38:57 -05:00
test_bug_1889108.py Track error migrations in resource tracker 2020-09-10 05:30:39 +00:00
test_bug_1893284.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_bug_1894966.py api: Set min, maxItems for server_group.policies field 2020-09-16 11:13:47 +01:00
test_bug_1895696.py compute: Skip cinder_encryption_key_id check when booting from volume 2020-09-17 12:16:54 +01:00
test_bug_1896463.py Set instance host and drop migration under lock 2020-11-04 15:02:35 +01:00
test_bug_1899649.py fakelibvirt: make kB_mem default not laughable 2021-03-09 15:38:57 -05:00
test_bug_1899835.py Add regression test for bug #1899835 2020-10-21 09:12:28 +01:00
test_bug_1902925.py Fix the compute RPC 5.12 issue 2020-11-05 16:58:03 +01:00
test_bug_1908075.py api: Reject volume attach requests when an active bdm exists 2021-02-04 14:05:31 +00:00
test_bug_1909120.py Remove short call timeout from func test 2021-02-24 16:44:29 +01:00
test_bug_1914777.py Handle instance = None in _local_delete_cleanup 2021-02-19 04:40:35 +00:00
test_bug_1922053.py api: Reject requests to force up computes when `done` evacuation records exist 2021-04-01 19:28:34 +01:00

README.rst

Tests for Specific Regressions

When we have a bug reported by end users that we can write a full stack reproduce on, we should. And we should keep a regression test for that bug in our tree. It can be deleted at some future date if needed, but largely should not be changed.

Writing Regression Tests

  • These should be full stack tests which inherit from nova.test.TestCase directly. (This is to prevent coupling with other tests).
  • They should setup a full stack cloud in their setUp via fixtures
  • They should each live in a file which is named test_bug######.py

Writing Tests Before the Bug is Fixed

TODO describe writing and landing tests before the bug is fixed as a reproduce.