blob: 453bb34a156e026816f482d9bf4bd62faecb50b8 [file] [log] [blame]
ZhiQiang Fan39f97222013-09-20 04:49:44 +08001# Copyright 2013 OpenStack Foundation
Hoisaleshwara Madan V S7cba1082013-11-26 12:43:04 +05302# Copyright 2013 IBM Corp
Matthew Treinisha62347f2013-03-01 16:37:30 -05003# All Rights Reserved.
Matthew Treinisha62347f2013-03-01 16:37:30 -05004#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
Matthew Treinisha62347f2013-03-01 16:37:30 -050017import random
18
Sirushti Murugesan12dc9732016-07-13 22:49:17 +053019import six
Matthew Treinish01472ff2015-02-20 17:26:52 -050020
Takashi NATSUME12a48512015-08-10 18:33:16 +090021from oslo_log import log as logging
Sean Dague1937d092013-05-17 16:36:38 -040022from tempest.api.image import base
Fei Long Wangd39431f2015-05-14 11:30:48 +120023from tempest.common.utils import data_utils
Takashi NATSUME12a48512015-08-10 18:33:16 +090024from tempest import config
Eiichi Aikawa9012f462014-03-05 16:43:32 +090025from tempest import test
Matthew Treinisha62347f2013-03-01 16:37:30 -050026
Takashi NATSUME12a48512015-08-10 18:33:16 +090027CONF = config.CONF
28LOG = logging.getLogger(__name__)
29
Matthew Treinisha62347f2013-03-01 16:37:30 -050030
Hoisaleshwara Madan V S7cba1082013-11-26 12:43:04 +053031class BasicOperationsImagesTest(base.BaseV2ImageTest):
Ken'ichi Ohmichi9e3dac02015-11-19 07:01:07 +000032 """Here we test the basic operations of images"""
Matthew Treinisha62347f2013-03-01 16:37:30 -050033
Sean Dague0a08c7e2015-04-30 08:37:02 -040034 @test.attr(type='smoke')
Chris Hoge7579c1a2015-02-26 14:12:15 -080035 @test.idempotent_id('139b765e-7f3d-4b3d-8b37-3ca3876ee318')
Hoisaleshwara Madan V Se50a6f12013-10-23 18:01:01 +053036 def test_register_upload_get_image_file(self):
Ken'ichi Ohmichi9e3dac02015-11-19 07:01:07 +000037 """Here we test these functionalities
Hoisaleshwara Madan V Se50a6f12013-10-23 18:01:01 +053038
Ken'ichi Ohmichi9e3dac02015-11-19 07:01:07 +000039 Register image, upload the image file, get image and get image
40 file api's
Hoisaleshwara Madan V Se50a6f12013-10-23 18:01:01 +053041 """
42
Sean Daguec6ec4762014-05-29 08:54:21 -040043 uuid = '00000000-1111-2222-3333-444455556666'
Hoisaleshwara Madan V Se50a6f12013-10-23 18:01:01 +053044 image_name = data_utils.rand_name('image')
Takashi NATSUME12a48512015-08-10 18:33:16 +090045 container_format = CONF.image.container_formats[0]
46 disk_format = CONF.image.disk_formats[0]
lkuchlanb3348792016-09-29 10:42:21 +030047 image = self.create_image(name=image_name,
48 container_format=container_format,
49 disk_format=disk_format,
50 visibility='private',
51 ramdisk_id=uuid)
lkuchlanb3348792016-09-29 10:42:21 +030052 self.assertIn('name', image)
53 self.assertEqual(image_name, image['name'])
54 self.assertIn('visibility', image)
55 self.assertEqual('private', image['visibility'])
56 self.assertIn('status', image)
57 self.assertEqual('queued', image['status'])
Matthew Treinisha62347f2013-03-01 16:37:30 -050058
59 # Now try uploading an image file
Mark Washenberger5c3b6fe2014-07-29 13:40:34 -070060 file_content = data_utils.random_bytes()
Sirushti Murugesan12dc9732016-07-13 22:49:17 +053061 image_file = six.BytesIO(file_content)
lkuchlanb3348792016-09-29 10:42:21 +030062 self.client.store_image_file(image['id'], image_file)
Hoisaleshwara Madan V Se50a6f12013-10-23 18:01:01 +053063
64 # Now try to get image details
lkuchlanb3348792016-09-29 10:42:21 +030065 body = self.client.show_image(image['id'])
66 self.assertEqual(image['id'], body['id'])
Hoisaleshwara Madan V Se50a6f12013-10-23 18:01:01 +053067 self.assertEqual(image_name, body['name'])
Sean Daguec6ec4762014-05-29 08:54:21 -040068 self.assertEqual(uuid, body['ramdisk_id'])
Attila Fazekase191cb12013-07-29 06:41:52 +020069 self.assertIn('size', body)
Matthew Treinisha62347f2013-03-01 16:37:30 -050070 self.assertEqual(1024, body.get('size'))
71
Hoisaleshwara Madan V Se50a6f12013-10-23 18:01:01 +053072 # Now try get image file
lkuchlanb3348792016-09-29 10:42:21 +030073 body = self.client.show_image_file(image['id'])
David Kranzd7e97b42015-02-16 09:37:31 -050074 self.assertEqual(file_content, body.data)
Hoisaleshwara Madan V Se50a6f12013-10-23 18:01:01 +053075
Sean Dague0a08c7e2015-04-30 08:37:02 -040076 @test.attr(type='smoke')
Chris Hoge7579c1a2015-02-26 14:12:15 -080077 @test.idempotent_id('f848bb94-1c6e-45a4-8726-39e3a5b23535')
Hoisaleshwara Madan V S7cba1082013-11-26 12:43:04 +053078 def test_delete_image(self):
Sergey Nikitinc6b2ee82014-02-03 17:13:50 +040079 # Deletes an image by image_id
Hoisaleshwara Madan V S7cba1082013-11-26 12:43:04 +053080
81 # Create image
82 image_name = data_utils.rand_name('image')
Takashi NATSUME12a48512015-08-10 18:33:16 +090083 container_format = CONF.image.container_formats[0]
84 disk_format = CONF.image.disk_formats[0]
Benny Kopilov900fceb2016-11-09 09:45:40 +020085 image = self.create_image(name=image_name,
86 container_format=container_format,
87 disk_format=disk_format,
88 visibility='private')
Hoisaleshwara Madan V S7cba1082013-11-26 12:43:04 +053089 # Delete Image
lkuchlanb3348792016-09-29 10:42:21 +030090 self.client.delete_image(image['id'])
91 self.client.wait_for_resource_deletion(image['id'])
Hoisaleshwara Madan V S7cba1082013-11-26 12:43:04 +053092
93 # Verifying deletion
John Warrenf3b3e952015-08-17 19:28:12 +000094 images = self.client.list_images()['images']
Sunil G29856a32014-07-17 23:17:58 +053095 images_id = [item['id'] for item in images]
lkuchlanb3348792016-09-29 10:42:21 +030096 self.assertNotIn(image['id'], images_id)
Hoisaleshwara Madan V S7cba1082013-11-26 12:43:04 +053097
Sean Dague0a08c7e2015-04-30 08:37:02 -040098 @test.attr(type='smoke')
Chris Hoge7579c1a2015-02-26 14:12:15 -080099 @test.idempotent_id('f66891a7-a35c-41a8-b590-a065c2a1caa6')
Sergey Nikitinc6b2ee82014-02-03 17:13:50 +0400100 def test_update_image(self):
101 # Updates an image by image_id
102
103 # Create image
104 image_name = data_utils.rand_name('image')
Takashi NATSUME12a48512015-08-10 18:33:16 +0900105 container_format = CONF.image.container_formats[0]
106 disk_format = CONF.image.disk_formats[0]
Benny Kopilov900fceb2016-11-09 09:45:40 +0200107 image = self.create_image(name=image_name,
108 container_format=container_format,
109 disk_format=disk_format,
110 visibility='private')
lkuchlanb3348792016-09-29 10:42:21 +0300111 self.assertEqual('queued', image['status'])
Sergey Nikitinc6b2ee82014-02-03 17:13:50 +0400112
113 # Now try uploading an image file
Sirushti Murugesan12dc9732016-07-13 22:49:17 +0530114 image_file = six.BytesIO(data_utils.random_bytes())
lkuchlanb3348792016-09-29 10:42:21 +0300115 self.client.store_image_file(image['id'], image_file)
Sergey Nikitinc6b2ee82014-02-03 17:13:50 +0400116
117 # Update Image
118 new_image_name = data_utils.rand_name('new-image')
lkuchlanb3348792016-09-29 10:42:21 +0300119 body = self.client.update_image(image['id'], [
Aaron Rosenc7720622014-05-20 10:38:10 -0700120 dict(replace='/name', value=new_image_name)])
Sergey Nikitinc6b2ee82014-02-03 17:13:50 +0400121
Sergey Nikitinc6b2ee82014-02-03 17:13:50 +0400122 # Verifying updating
123
lkuchlanb3348792016-09-29 10:42:21 +0300124 body = self.client.show_image(image['id'])
125 self.assertEqual(image['id'], body['id'])
Sergey Nikitinc6b2ee82014-02-03 17:13:50 +0400126 self.assertEqual(new_image_name, body['name'])
Sergey Nikitinc6b2ee82014-02-03 17:13:50 +0400127
Matthew Treinisha62347f2013-03-01 16:37:30 -0500128
Matthew Treinishce3ef922013-03-11 14:02:46 -0400129class ListImagesTest(base.BaseV2ImageTest):
Matthew Treinisha62347f2013-03-01 16:37:30 -0500130
131 @classmethod
Andrea Frittoli69a6b632014-09-15 13:14:53 +0100132 def resource_setup(cls):
133 super(ListImagesTest, cls).resource_setup()
Matthew Treinisha62347f2013-03-01 16:37:30 -0500134 # We add a few images here to test the listing functionality of
135 # the images API
Takashi NATSUME12a48512015-08-10 18:33:16 +0900136 container_fmts = CONF.image.container_formats
137 disk_fmts = CONF.image.disk_formats
138 all_pairs = [(container_fmt, disk_fmt)
139 for container_fmt in container_fmts
140 for disk_fmt in disk_fmts]
141
142 for (container_fmt, disk_fmt) in all_pairs[:6]:
hgangwxf186edc2015-12-28 21:12:59 +0800143 LOG.debug("Creating an image"
Takashi NATSUME12a48512015-08-10 18:33:16 +0900144 "(Container format: %s, Disk format: %s).",
145 container_fmt, disk_fmt)
146 cls._create_standard_image(container_fmt, disk_fmt)
Matthew Treinisha62347f2013-03-01 16:37:30 -0500147
148 @classmethod
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700149 def _create_standard_image(cls, container_format, disk_format):
Ken'ichi Ohmichi9e3dac02015-11-19 07:01:07 +0000150 """Create a new standard image and return the newly-registered image-id
151
152 Note that the size of the new image is a random number between
Matthew Treinisha62347f2013-03-01 16:37:30 -0500153 1024 and 4096
154 """
Mark Washenberger5c3b6fe2014-07-29 13:40:34 -0700155 size = random.randint(1024, 4096)
Sirushti Murugesan12dc9732016-07-13 22:49:17 +0530156 image_file = six.BytesIO(data_utils.random_bytes(size))
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700157 tags = [data_utils.rand_name('tag'), data_utils.rand_name('tag')]
zhufl08e42762016-10-18 16:07:56 +0800158 image = cls.create_image(container_format=container_format,
lkuchlanb3348792016-09-29 10:42:21 +0300159 disk_format=disk_format,
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700160 visibility='private',
161 tags=tags)
lkuchlanb3348792016-09-29 10:42:21 +0300162 cls.client.store_image_file(image['id'], data=image_file)
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700163 # Keep the data of one test image so it can be used to filter lists
164 cls.test_data = image
165 cls.test_data['size'] = size
Matthew Treinisha62347f2013-03-01 16:37:30 -0500166
lkuchlanb3348792016-09-29 10:42:21 +0300167 return image['id']
Matthew Treinisha62347f2013-03-01 16:37:30 -0500168
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700169
170class ListUserImagesTest(ListImagesTest):
171 """Here we test the listing of image information"""
172
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700173 def _list_by_param_value_and_assert(self, params):
Ken'ichi Ohmichi9e3dac02015-11-19 07:01:07 +0000174 """Perform list action with given params and validates result."""
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700175 # Retrieve the list of images that meet the filter
John Warrenf3b3e952015-08-17 19:28:12 +0000176 images_list = self.client.list_images(params=params)['images']
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700177 # Validating params of fetched images
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700178 msg = 'No images were found that met the filter criteria.'
179 self.assertNotEmpty(images_list, msg)
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700180 for image in images_list:
181 for key in params:
182 msg = "Failed to list images by %s" % key
183 self.assertEqual(params[key], image[key], msg)
184
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700185 def _list_sorted_by_image_size_and_assert(self, params, desc=False):
186 """Validate an image list that has been sorted by size
187
188 Perform list action with given params and validates the results are
189 sorted by image size in either ascending or descending order.
190 """
191 # Retrieve the list of images that meet the filter
192 images_list = self.client.list_images(params=params)['images']
193 # Validate that the list was fetched sorted accordingly
194 msg = 'No images were found that met the filter criteria.'
195 self.assertNotEmpty(images_list, msg)
196 sorted_list = [image['size'] for image in images_list]
197 msg = 'The list of images was not sorted correctly.'
198 self.assertEqual(sorted(sorted_list, reverse=desc), sorted_list, msg)
199
Chris Hoge7579c1a2015-02-26 14:12:15 -0800200 @test.idempotent_id('1e341d7a-90a9-494c-b143-2cdf2aeb6aee')
Flavio Percoco7e26be12015-09-15 22:33:19 +0200201 def test_list_no_params(self):
Matthew Treinisha62347f2013-03-01 16:37:30 -0500202 # Simple test to see all fixture images returned
John Warrenf3b3e952015-08-17 19:28:12 +0000203 images_list = self.client.list_images()['images']
Sirushti Murugesan935f2cc2016-07-12 19:48:24 +0530204 image_list = [image['id'] for image in images_list]
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700205
Matthew Treinisha62347f2013-03-01 16:37:30 -0500206 for image in self.created_images:
Attila Fazekase191cb12013-07-29 06:41:52 +0200207 self.assertIn(image, image_list)
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700208
Chris Hoge7579c1a2015-02-26 14:12:15 -0800209 @test.idempotent_id('9959ca1d-1aa7-4b7a-a1ea-0fff0499b37e')
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700210 def test_list_images_param_container_format(self):
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700211 # Test to get all images with a specific container_format
212 params = {"container_format": self.test_data['container_format']}
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700213 self._list_by_param_value_and_assert(params)
214
Chris Hoge7579c1a2015-02-26 14:12:15 -0800215 @test.idempotent_id('4a4735a7-f22f-49b6-b0d9-66e1ef7453eb')
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700216 def test_list_images_param_disk_format(self):
217 # Test to get all images with disk_format = raw
218 params = {"disk_format": "raw"}
219 self._list_by_param_value_and_assert(params)
220
Chris Hoge7579c1a2015-02-26 14:12:15 -0800221 @test.idempotent_id('7a95bb92-d99e-4b12-9718-7bc6ab73e6d2')
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700222 def test_list_images_param_visibility(self):
Aaron Rosenc7720622014-05-20 10:38:10 -0700223 # Test to get all images with visibility = private
224 params = {"visibility": "private"}
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700225 self._list_by_param_value_and_assert(params)
226
Chris Hoge7579c1a2015-02-26 14:12:15 -0800227 @test.idempotent_id('cf1b9a48-8340-480e-af7b-fe7e17690876')
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700228 def test_list_images_param_size(self):
229 # Test to get all images by size
Takashi NATSUME12a48512015-08-10 18:33:16 +0900230 image_id = self.created_images[0]
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700231 # Get image metadata
Ken'ichi Ohmichi5d410762015-05-22 01:10:03 +0000232 image = self.client.show_image(image_id)
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700233
234 params = {"size": image['size']}
235 self._list_by_param_value_and_assert(params)
236
Chris Hoge7579c1a2015-02-26 14:12:15 -0800237 @test.idempotent_id('4ad8c157-971a-4ba8-aa84-ed61154b1e7f')
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700238 def test_list_images_param_min_max_size(self):
239 # Test to get all images with size between 2000 to 3000
Takashi NATSUME12a48512015-08-10 18:33:16 +0900240 image_id = self.created_images[0]
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700241 # Get image metadata
Ken'ichi Ohmichi5d410762015-05-22 01:10:03 +0000242 image = self.client.show_image(image_id)
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700243
244 size = image['size']
245 params = {"size_min": size - 500, "size_max": size + 500}
John Warrenf3b3e952015-08-17 19:28:12 +0000246 images_list = self.client.list_images(params=params)['images']
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700247 image_size_list = map(lambda x: x['size'], images_list)
248
249 for image_size in image_size_list:
Béla Vancsics64862f72016-11-08 09:12:31 +0100250 self.assertGreaterEqual(image_size, params['size_min'],
251 "Failed to get images by size_min")
252 self.assertLessEqual(image_size, params['size_max'],
253 "Failed to get images by size_max")
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700254
Chris Hoge7579c1a2015-02-26 14:12:15 -0800255 @test.idempotent_id('7fc9e369-0f58-4d05-9aa5-0969e2d59d15')
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700256 def test_list_images_param_status(self):
Anju Tiwarica2249d2014-01-23 17:33:02 +0530257 # Test to get all active images
258 params = {"status": "active"}
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700259 self._list_by_param_value_and_assert(params)
260
Chris Hoge7579c1a2015-02-26 14:12:15 -0800261 @test.idempotent_id('e914a891-3cc8-4b40-ad32-e0a39ffbddbb')
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700262 def test_list_images_param_limit(self):
263 # Test to get images by limit
Takashi NATSUME12a48512015-08-10 18:33:16 +0900264 params = {"limit": 1}
John Warrenf3b3e952015-08-17 19:28:12 +0000265 images_list = self.client.list_images(params=params)['images']
Abhijeet Malawadef268d8e2013-09-17 06:20:23 -0700266
267 self.assertEqual(len(images_list), params['limit'],
268 "Failed to get images by limit")
raiesmh08a1ce3542014-03-04 11:58:29 +0530269
Li Wei14bf2412016-09-25 15:56:23 +0800270 @test.idempotent_id('e9a44b91-31c8-4b40-a332-e0a39ffb4dbb')
271 def test_list_image_param_owner(self):
272 # Test to get images by owner
273 image_id = self.created_images[0]
274 # Get image metadata
275 image = self.client.show_image(image_id)
276
277 params = {"owner": image['owner']}
278 self._list_by_param_value_and_assert(params)
279
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700280 @test.idempotent_id('55c8f5f5-bfed-409d-a6d5-4caeda985d7b')
281 def test_list_images_param_name(self):
282 # Test to get images by name
283 params = {'name': self.test_data['name']}
284 self._list_by_param_value_and_assert(params)
285
286 @test.idempotent_id('aa8ac4df-cff9-418b-8d0f-dd9c67b072c9')
287 def test_list_images_param_tag(self):
288 # Test to get images matching a tag
289 params = {'tag': self.test_data['tags'][0]}
290 images_list = self.client.list_images(params=params)['images']
291 # Validating properties of fetched images
292 self.assertNotEmpty(images_list)
293 for image in images_list:
294 msg = ("The image {image_name} does not have the expected tag "
295 "{expected_tag} among its tags: {observerd_tags}."
296 .format(image_name=image['name'],
297 expected_tag=self.test_data['tags'][0],
298 observerd_tags=image['tags']))
299 self.assertIn(self.test_data['tags'][0], image['tags'], msg)
300
301 @test.idempotent_id('eeadce49-04e0-43b7-aec7-52535d903e7a')
302 def test_list_images_param_sort(self):
303 params = {'sort': 'size:desc'}
304 self._list_sorted_by_image_size_and_assert(params, desc=True)
305
306 @test.idempotent_id('9faaa0c2-c3a5-43e1-8f61-61c54b409a49')
307 def test_list_images_param_sort_key_dir(self):
308 params = {'sort_key': 'size', 'sort_dir': 'desc'}
309 self._list_sorted_by_image_size_and_assert(params, desc=True)
310
Chris Hoge7579c1a2015-02-26 14:12:15 -0800311 @test.idempotent_id('622b925c-479f-4736-860d-adeaf13bc371')
raiesmh08a1ce3542014-03-04 11:58:29 +0530312 def test_get_image_schema(self):
313 # Test to get image schema
314 schema = "image"
Ken'ichi Ohmichi190b24e2016-06-07 23:20:09 +0900315 body = self.schemas_client.show_schema(schema)
raiesmh08a1ce3542014-03-04 11:58:29 +0530316 self.assertEqual("image", body['name'])
317
Chris Hoge7579c1a2015-02-26 14:12:15 -0800318 @test.idempotent_id('25c8d7b2-df21-460f-87ac-93130bcdc684')
raiesmh08a1ce3542014-03-04 11:58:29 +0530319 def test_get_images_schema(self):
320 # Test to get images schema
321 schema = "images"
Ken'ichi Ohmichi190b24e2016-06-07 23:20:09 +0900322 body = self.schemas_client.show_schema(schema)
raiesmh08a1ce3542014-03-04 11:58:29 +0530323 self.assertEqual("images", body['name'])
Castulo J. Martineze9c8ce82016-05-16 07:55:53 -0700324
325
326class ListSharedImagesTest(ListImagesTest):
327 """Here we test the listing of a shared image information"""
328
329 credentials = ['primary', 'alt']
330
331 @classmethod
332 def setup_clients(cls):
333 super(ListSharedImagesTest, cls).setup_clients()
334 cls.image_member_client = cls.os.image_member_client_v2
335 cls.alt_img_client = cls.os_alt.image_client_v2
336
337 @test.idempotent_id('3fa50be4-8e38-4c02-a8db-7811bb780122')
338 def test_list_images_param_member_status(self):
339 # Share one of the images created with the alt user
340 self.image_member_client.create_image_member(
341 image_id=self.test_data['id'],
342 member=self.alt_img_client.tenant_id)
343 # Update the info on the test data so it remains accurate
344 self.test_data['updated_at'] = self.client.show_image(
345 self.test_data['id'])['updated_at']
346 # As an image consumer you need to provide the member_status parameter
347 # along with the visibility=shared parameter in order for it to show
348 # results
349 params = {'member_status': 'pending', 'visibility': 'shared'}
350 fetched_images = self.alt_img_client.list_images(params)['images']
351 self.assertEqual(1, len(fetched_images))
352 self.assertEqual(self.test_data['id'], fetched_images[0]['id'])