Ken'ichi Ohmichi | f72343e | 2017-03-10 12:53:14 -0800 | [diff] [blame] | 1 | # Copyright 2017 NEC Corporation. All rights reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | from tempest.api.image import base |
| 16 | from tempest.lib import decorators |
Ken'ichi Ohmichi | f72343e | 2017-03-10 12:53:14 -0800 | [diff] [blame] | 17 | |
| 18 | |
| 19 | class VersionsTest(base.BaseV2ImageTest): |
zhufl | e68f435 | 2020-04-21 13:44:55 +0800 | [diff] [blame] | 20 | """Test image versions""" |
Ken'ichi Ohmichi | f72343e | 2017-03-10 12:53:14 -0800 | [diff] [blame] | 21 | |
| 22 | @decorators.idempotent_id('659ea30a-a17c-4317-832c-0f68ed23c31d') |
Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 23 | @decorators.attr(type='smoke') |
Ken'ichi Ohmichi | f72343e | 2017-03-10 12:53:14 -0800 | [diff] [blame] | 24 | def test_list_versions(self): |
zhufl | e68f435 | 2020-04-21 13:44:55 +0800 | [diff] [blame] | 25 | """Test listing image versions""" |
Ken'ichi Ohmichi | f72343e | 2017-03-10 12:53:14 -0800 | [diff] [blame] | 26 | versions = self.versions_client.list_versions()['versions'] |
| 27 | expected_resources = ('id', 'links', 'status') |
| 28 | |
| 29 | for version in versions: |
| 30 | for res in expected_resources: |
| 31 | self.assertIn(res, version) |