From 931d39ec382a187ca52babe4c3d2d3516b079465 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 12 Aug 2020 09:28:46 -0700 Subject: [PATCH] Functional reproducer for bug 1891352 This reproduces the behavior described in the referenced bug, showing the behavior before the fix. This asserts the *broken* behavior and leaves examples of what the asserts should be for the fix patch. Partial-Bug: #1891352 Change-Id: I992a14abb7cb41e2472741bf08b93976d4320ace (cherry picked from commit ec372377b1e69eb143e4d08b0041b8199459ee15) --- glance/tests/functional/v2/test_images.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/glance/tests/functional/v2/test_images.py b/glance/tests/functional/v2/test_images.py index 311d5637e4..aac41057e8 100644 --- a/glance/tests/functional/v2/test_images.py +++ b/glance/tests/functional/v2/test_images.py @@ -5604,6 +5604,17 @@ class TestImagesMultipleBackend(functional.MultipleBackendFunctionalTest): self.assertIn('file1', jsonutils.loads(response.text)['stores']) self.assertNotIn('file2', jsonutils.loads(response.text)['stores']) self.assertNotIn('file3', jsonutils.loads(response.text)['stores']) + fail_key = 'os_glance_failed_import' + pend_key = 'os_glance_importing_to_stores' + # NOTE(danms): This is bug #1891352, where a failed import when + # all_stores_must_succeed=True will leave the failed store in the + # importing list forever and never put it into the failed list. + # When the bug is fixed, this is what should happen: + # self.assertEqual('file3', jsonutils.loads(response.text)[fail_key]) + # self.assertEqual('', jsonutils.loads(response.text)[pend_key]) + # but until it is fixed, this asserts the *broken* behavior: + self.assertEqual('', jsonutils.loads(response.text)[fail_key]) + self.assertEqual('file3', jsonutils.loads(response.text)[pend_key]) # Copy newly created image to file2 and file3 stores and # all_stores_must_succeed set to false.