Modfied create image in region 'down' state to be tested in alt_region

Change-Id: I5c304daf72e0d76e0fa92446318bdeaaf4e5acda
This commit is contained in:
Chi Lo 2020-06-29 14:12:54 -07:00
parent 6daea23d65
commit fec00c7117

View File

@ -296,19 +296,24 @@ class TestTempestIms(ims_base.ImsBaseOrmTest):
self.assertRaises(exceptions.NotFound, self.client.get_image,
image['id'])
@SYNC('region')
@SYNC('alt_region')
@testtools.skipUnless(CONF.ranger.alt_region_available,
'Alt region not provided, skipping this test')
@decorators.idempotent_id('e642fa39-1b69-4d17-8bd1-aee90ea042a3')
def test_image_while_region_down(self):
# create region with status down
self._update_region(CONF.identity.region,
# update region with status in 'down' state
self._update_region(CONF.ranger.alt_region,
status={'status': 'down'})
# create image within that newly created region
# create image within that newly updated region in 'down' state
post_body = self._get_image_params()
post_body['regions'][0]['name'] = CONF.identity.region
post_body['regions'][0]['name'] = CONF.ranger.alt_region
self.assertRaises(exceptions.BadRequest,
self.client.create_image, **post_body)
self._update_region(CONF.identity.region)
# restore region with status in 'functional' state
self._update_region(CONF.ranger.alt_region)
@SYNC('region')
@decorators.idempotent_id('a1fee342-3000-41a6-97f9-b33fd2734e4d')
@ -447,7 +452,6 @@ class TestTempestIms(ims_base.ImsBaseOrmTest):
self.assertListEqual(image["tags"], tags)
self.assertDictEqual(image["properties"], properties)
@SYNC('region')
@decorators.idempotent_id('67aa7014-4dbb-4d66-bc7b-1a95a57494f8')
def test_create_image_with_uuid(self):
post_body = self._get_image_params()
@ -468,7 +472,7 @@ class TestTempestIms(ims_base.ImsBaseOrmTest):
image = body["image"]
self.assertEqual(image['id'], post_body['id'])
@SYNC('region')
@SYNC('alt_region')
@testtools.skipUnless(CONF.ranger.alt_region_available,
'Alt region not provided, skipping this test')
@decorators.idempotent_id('7ae78584-55af-45cb-a4a2-b28cc679699e')
@ -498,7 +502,7 @@ class TestTempestIms(ims_base.ImsBaseOrmTest):
self.assertEqual(image['status'], 'Success')
self.assertEqual(len(image['regions']), 2)
@SYNC('region')
@SYNC('alt_region')
@testtools.skipUnless(CONF.ranger.alt_region_available,
'Alt region not provided, skipping this test')
@decorators.idempotent_id('73c97918-2081-4f42-9c1e-6fd7a9fb8735')