| ZhiQiang Fan | 39f9722 | 2013-09-20 04:49:44 +0800 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | |
| songwenping | 8c3dac1 | 2021-02-22 09:12:37 +0800 | [diff] [blame] | 16 | import io |
| jeremy.zhang | 0a42716 | 2017-04-21 12:47:56 +0800 | [diff] [blame] | 17 | |
| Sean Dague | 1937d09 | 2013-05-17 16:36:38 -0400 | [diff] [blame] | 18 | from tempest.api.volume import base |
| Andrea Frittoli | cd36841 | 2017-08-14 21:37:56 +0100 | [diff] [blame] | 19 | from tempest.common import utils |
| jeremy.zhang | 0a42716 | 2017-04-21 12:47:56 +0800 | [diff] [blame] | 20 | from tempest.common import waiters |
| 21 | from tempest import config |
| Ken'ichi Ohmichi | ef1c1ce | 2017-03-10 11:07:10 -0800 | [diff] [blame] | 22 | from tempest.lib.common.utils import data_utils |
| jeremy.zhang | 0a42716 | 2017-04-21 12:47:56 +0800 | [diff] [blame] | 23 | from tempest.lib.common.utils import test_utils |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 24 | from tempest.lib import decorators |
| Andrea Frittoli (andreaf) | db9672e | 2016-02-23 14:07:24 -0500 | [diff] [blame] | 25 | from tempest.lib import exceptions as lib_exc |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 26 | |
| jeremy.zhang | 0a42716 | 2017-04-21 12:47:56 +0800 | [diff] [blame] | 27 | CONF = config.CONF |
| 28 | |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 29 | |
| Ken'ichi Ohmichi | e8afb8c | 2017-03-27 11:25:37 -0700 | [diff] [blame] | 30 | class VolumesNegativeTest(base.BaseVolumeTest): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 31 | """Negative tests of volumes""" |
| Attila Fazekas | 3dcdae1 | 2013-02-14 12:50:04 +0100 | [diff] [blame] | 32 | |
| Sofiia Tavrovska | c817edd | 2025-04-22 17:43:12 +0200 | [diff] [blame] | 33 | create_default_network = True |
| 34 | |
| Attila Fazekas | 3dcdae1 | 2013-02-14 12:50:04 +0100 | [diff] [blame] | 35 | @classmethod |
| Andrea Frittoli | 61a12e2 | 2014-09-15 13:14:54 +0100 | [diff] [blame] | 36 | def resource_setup(cls): |
| Ken'ichi Ohmichi | e8afb8c | 2017-03-27 11:25:37 -0700 | [diff] [blame] | 37 | super(VolumesNegativeTest, cls).resource_setup() |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 38 | |
| Zhi Kun Liu | 3bdfe09 | 2013-09-02 01:31:58 +0800 | [diff] [blame] | 39 | # Create a test shared instance and volume for attach/detach tests |
| Ken'ichi Ohmichi | 5687d55 | 2013-12-26 19:00:12 +0900 | [diff] [blame] | 40 | cls.volume = cls.create_volume() |
| Zhi Kun Liu | 3bdfe09 | 2013-09-02 01:31:58 +0800 | [diff] [blame] | 41 | |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 42 | def create_image(self): |
| 43 | # Create image |
| Martin Kopec | 213d0a4 | 2023-11-30 10:28:14 +0100 | [diff] [blame] | 44 | image_name = data_utils.rand_name( |
| 45 | prefix=CONF.resource_name_prefix, |
| 46 | name=self.__class__.__name__ + "-image") |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 47 | image = self.images_client.create_image( |
| 48 | name=image_name, |
| 49 | container_format=CONF.image.container_formats[0], |
| Dan Smith | 507d0de | 2024-09-26 06:59:19 -0700 | [diff] [blame] | 50 | disk_format='raw', |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 51 | visibility='private', |
| Martin Kopec | 37c4bd3 | 2021-06-24 15:46:00 +0000 | [diff] [blame] | 52 | min_disk=CONF.volume.volume_size + CONF.volume.volume_size_extend) |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 53 | self.addCleanup(test_utils.call_and_ignore_notfound_exc, |
| 54 | self.images_client.delete_image, image['id']) |
| 55 | |
| 56 | # Upload image with 1KB data |
| songwenping | 8c3dac1 | 2021-02-22 09:12:37 +0800 | [diff] [blame] | 57 | image_file = io.BytesIO(data_utils.random_bytes()) |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 58 | self.images_client.store_image_file(image['id'], image_file) |
| 59 | waiters.wait_for_image_status(self.images_client, |
| 60 | image['id'], 'active') |
| 61 | return image |
| 62 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 63 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 64 | @decorators.idempotent_id('f131c586-9448-44a4-a8b0-54ca838aa43e') |
| nayna-patel | 179077c | 2014-01-15 12:27:16 +0000 | [diff] [blame] | 65 | def test_volume_get_nonexistent_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 66 | """Test getting non existent volume should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 67 | self.assertRaises(lib_exc.NotFound, self.volumes_client.show_volume, |
| Ken'ichi Ohmichi | d079c89 | 2016-04-19 11:23:36 -0700 | [diff] [blame] | 68 | data_utils.rand_uuid()) |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 69 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 70 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 71 | @decorators.idempotent_id('555efa6e-efcd-44ef-8a3b-4a7ca4837a29') |
| nayna-patel | 179077c | 2014-01-15 12:27:16 +0000 | [diff] [blame] | 72 | def test_volume_delete_nonexistent_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 73 | """Test deleting non existent volume should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 74 | self.assertRaises(lib_exc.NotFound, self.volumes_client.delete_volume, |
| Ken'ichi Ohmichi | d079c89 | 2016-04-19 11:23:36 -0700 | [diff] [blame] | 75 | data_utils.rand_uuid()) |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 76 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 77 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 78 | @decorators.idempotent_id('1ed83a8a-682d-4dfb-a30e-ee63ffd6c049') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 79 | def test_create_volume_with_invalid_size(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 80 | """Test creating volume with invalid size should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 81 | self.assertRaises(lib_exc.BadRequest, |
| zhufl | 9751b3d | 2017-03-29 18:01:01 +0800 | [diff] [blame] | 82 | self.volumes_client.create_volume, size='#$%') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 83 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 84 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 85 | @decorators.idempotent_id('9387686f-334f-4d31-a439-33494b9e2683') |
| zhufl | e2fb43e | 2016-11-24 10:52:16 +0800 | [diff] [blame] | 86 | def test_create_volume_without_passing_size(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 87 | """Test creating volume with empty size should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 88 | self.assertRaises(lib_exc.BadRequest, |
| zhufl | 9751b3d | 2017-03-29 18:01:01 +0800 | [diff] [blame] | 89 | self.volumes_client.create_volume, size='') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 90 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 91 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 92 | @decorators.idempotent_id('41331caa-eaf4-4001-869d-bc18c1869360') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 93 | def test_create_volume_with_size_zero(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 94 | """Test creating volume with zero size should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 95 | self.assertRaises(lib_exc.BadRequest, |
| zhufl | 9751b3d | 2017-03-29 18:01:01 +0800 | [diff] [blame] | 96 | self.volumes_client.create_volume, size='0') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 97 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 98 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 99 | @decorators.idempotent_id('8b472729-9eba-446e-a83b-916bdb34bef7') |
| wanghao | c2abb6c | 2013-09-29 19:14:09 +0800 | [diff] [blame] | 100 | def test_create_volume_with_size_negative(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 101 | """Test creating volume with negative size should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 102 | self.assertRaises(lib_exc.BadRequest, |
| zhufl | 9751b3d | 2017-03-29 18:01:01 +0800 | [diff] [blame] | 103 | self.volumes_client.create_volume, size='-1') |
| wanghao | c2abb6c | 2013-09-29 19:14:09 +0800 | [diff] [blame] | 104 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 105 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 106 | @decorators.idempotent_id('10254ed8-3849-454e-862e-3ab8e6aa01d2') |
| nayna-patel | 179077c | 2014-01-15 12:27:16 +0000 | [diff] [blame] | 107 | def test_create_volume_with_nonexistent_volume_type(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 108 | """Test creating volume with non existent volume type should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 109 | self.assertRaises(lib_exc.NotFound, self.volumes_client.create_volume, |
| TommyLike | fcda77b | 2018-01-18 15:25:12 +0800 | [diff] [blame] | 110 | size=CONF.volume.volume_size, |
| 111 | volume_type=data_utils.rand_uuid()) |
| zhangyanzi | b866f05 | 2013-10-12 11:41:32 +0800 | [diff] [blame] | 112 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 113 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 114 | @decorators.idempotent_id('0c36f6ae-4604-4017-b0a9-34fdc63096f9') |
| nayna-patel | 179077c | 2014-01-15 12:27:16 +0000 | [diff] [blame] | 115 | def test_create_volume_with_nonexistent_snapshot_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 116 | """Test creating volume with non existent snapshot should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 117 | self.assertRaises(lib_exc.NotFound, self.volumes_client.create_volume, |
| TommyLike | fcda77b | 2018-01-18 15:25:12 +0800 | [diff] [blame] | 118 | size=CONF.volume.volume_size, |
| 119 | snapshot_id=data_utils.rand_uuid()) |
| zhangyanzi | b866f05 | 2013-10-12 11:41:32 +0800 | [diff] [blame] | 120 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 121 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 122 | @decorators.idempotent_id('47c73e08-4be8-45bb-bfdf-0c4e79b88344') |
| nayna-patel | 179077c | 2014-01-15 12:27:16 +0000 | [diff] [blame] | 123 | def test_create_volume_with_nonexistent_source_volid(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 124 | """Test creating volume with non existent source volume should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 125 | self.assertRaises(lib_exc.NotFound, self.volumes_client.create_volume, |
| TommyLike | fcda77b | 2018-01-18 15:25:12 +0800 | [diff] [blame] | 126 | size=CONF.volume.volume_size, |
| 127 | source_volid=data_utils.rand_uuid()) |
| zhangyanzi | b866f05 | 2013-10-12 11:41:32 +0800 | [diff] [blame] | 128 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 129 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 130 | @decorators.idempotent_id('0186422c-999a-480e-a026-6a665744c30c') |
| nayna-patel | 179077c | 2014-01-15 12:27:16 +0000 | [diff] [blame] | 131 | def test_update_volume_with_nonexistent_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 132 | """Test updating non existent volume should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 133 | self.assertRaises(lib_exc.NotFound, self.volumes_client.update_volume, |
| zhufl | 0672955 | 2020-06-03 16:41:03 +0800 | [diff] [blame] | 134 | volume_id=data_utils.rand_uuid(), name="n") |
| wanghao | c2abb6c | 2013-09-29 19:14:09 +0800 | [diff] [blame] | 135 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 136 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 137 | @decorators.idempotent_id('e66e40d6-65e6-4e75-bdc7-636792fa152d') |
| wanghao | c2abb6c | 2013-09-29 19:14:09 +0800 | [diff] [blame] | 138 | def test_update_volume_with_invalid_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 139 | """Test updating volume with invalid volume id should fail""" |
| Martin Kopec | 213d0a4 | 2023-11-30 10:28:14 +0100 | [diff] [blame] | 140 | self.assertRaises( |
| 141 | lib_exc.NotFound, self.volumes_client.update_volume, |
| 142 | volume_id=data_utils.rand_name( |
| 143 | prefix=CONF.resource_name_prefix, |
| 144 | name='invalid'), name="n") |
| wanghao | c2abb6c | 2013-09-29 19:14:09 +0800 | [diff] [blame] | 145 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 146 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 147 | @decorators.idempotent_id('72aeca85-57a5-4c1f-9057-f320f9ea575b') |
| wanghao | c2abb6c | 2013-09-29 19:14:09 +0800 | [diff] [blame] | 148 | def test_update_volume_with_empty_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 149 | """Test updating volume with empty volume id should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 150 | self.assertRaises(lib_exc.NotFound, self.volumes_client.update_volume, |
| zhufl | 9751b3d | 2017-03-29 18:01:01 +0800 | [diff] [blame] | 151 | volume_id='') |
| wanghao | c2abb6c | 2013-09-29 19:14:09 +0800 | [diff] [blame] | 152 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 153 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 154 | @decorators.idempotent_id('30799cfd-7ee4-446c-b66c-45b383ed211b') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 155 | def test_get_invalid_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 156 | """Test getting volume with invalid volume id should fail""" |
| Martin Kopec | 213d0a4 | 2023-11-30 10:28:14 +0100 | [diff] [blame] | 157 | self.assertRaises( |
| 158 | lib_exc.NotFound, self.volumes_client.show_volume, |
| 159 | data_utils.rand_name( |
| 160 | prefix=CONF.resource_name_prefix, name='invalid')) |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 161 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 162 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 163 | @decorators.idempotent_id('c6c3db06-29ad-4e91-beb0-2ab195fe49e3') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 164 | def test_get_volume_without_passing_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 165 | """Test getting volume with empty volume id should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 166 | self.assertRaises(lib_exc.NotFound, |
| 167 | self.volumes_client.show_volume, '') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 168 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 169 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 170 | @decorators.idempotent_id('1f035827-7c32-4019-9240-b4ec2dbd9dfd') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 171 | def test_delete_invalid_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 172 | """Test deleting volume with invalid volume id should fail""" |
| Martin Kopec | 213d0a4 | 2023-11-30 10:28:14 +0100 | [diff] [blame] | 173 | self.assertRaises( |
| 174 | lib_exc.NotFound, self.volumes_client.delete_volume, |
| 175 | data_utils.rand_name( |
| 176 | prefix=CONF.resource_name_prefix, name='invalid')) |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 177 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 178 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 179 | @decorators.idempotent_id('441a1550-5d44-4b30-af0f-a6d402f52026') |
| Rohit Karajgi | dd47d7e | 2012-07-31 04:11:01 -0700 | [diff] [blame] | 180 | def test_delete_volume_without_passing_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 181 | """Test deleting volume with empty volume id should fail""" |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 182 | self.assertRaises(lib_exc.NotFound, |
| 183 | self.volumes_client.delete_volume, '') |
| Matthew Treinish | 9854d5b | 2012-09-20 10:22:13 -0400 | [diff] [blame] | 184 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 185 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 186 | @decorators.idempotent_id('f5e56b0a-5d02-43c1-a2a7-c9b792c2e3f6') |
| Andrea Frittoli | cd36841 | 2017-08-14 21:37:56 +0100 | [diff] [blame] | 187 | @utils.services('compute') |
| Zhi Kun Liu | 3bdfe09 | 2013-09-02 01:31:58 +0800 | [diff] [blame] | 188 | def test_attach_volumes_with_nonexistent_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 189 | """Test attaching non existent volume to server should fail""" |
| lkuchlan | d4ecd0e | 2017-06-11 12:01:27 +0300 | [diff] [blame] | 190 | server = self.create_server() |
| Joseph Lanoux | a074c01 | 2015-08-04 15:44:07 +0000 | [diff] [blame] | 191 | |
| Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 192 | self.assertRaises(lib_exc.NotFound, |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 193 | self.volumes_client.attach_volume, |
| Ken'ichi Ohmichi | d079c89 | 2016-04-19 11:23:36 -0700 | [diff] [blame] | 194 | data_utils.rand_uuid(), |
| Ghanshyam | 8fc0ed2 | 2015-12-18 10:25:14 +0900 | [diff] [blame] | 195 | instance_uuid=server['id'], |
| lkuchlan | a54f170 | 2017-09-11 11:06:55 +0300 | [diff] [blame] | 196 | mountpoint="/dev/vdc") |
| Zhi Kun Liu | 3bdfe09 | 2013-09-02 01:31:58 +0800 | [diff] [blame] | 197 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 198 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 199 | @decorators.idempotent_id('9f9c24e4-011d-46b5-b992-952140ce237a') |
| Zhi Kun Liu | 3bdfe09 | 2013-09-02 01:31:58 +0800 | [diff] [blame] | 200 | def test_detach_volumes_with_invalid_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 201 | """Test detaching volume with invalid volume id should fail""" |
| Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 202 | self.assertRaises(lib_exc.NotFound, |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 203 | self.volumes_client.detach_volume, |
| Zhi Kun Liu | 3bdfe09 | 2013-09-02 01:31:58 +0800 | [diff] [blame] | 204 | 'xxx') |
| 205 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 206 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 207 | @decorators.idempotent_id('e0c75c74-ee34-41a9-9288-2a2051452854') |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 208 | def test_volume_extend_with_size_smaller_than_original_size(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 209 | """Test extending volume with decreasing size should fail""" |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 210 | extend_size = 0 |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 211 | self.assertRaises(lib_exc.BadRequest, |
| 212 | self.volumes_client.extend_volume, |
| Ghanshyam | 58a9e87 | 2015-12-18 10:46:07 +0900 | [diff] [blame] | 213 | self.volume['id'], new_size=extend_size) |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 214 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 215 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 216 | @decorators.idempotent_id('5d0b480d-e833-439f-8a5a-96ad2ed6f22f') |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 217 | def test_volume_extend_with_non_number_size(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 218 | """Test extending volume with non-integer size should fail""" |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 219 | extend_size = 'abc' |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 220 | self.assertRaises(lib_exc.BadRequest, |
| 221 | self.volumes_client.extend_volume, |
| Ghanshyam | 58a9e87 | 2015-12-18 10:46:07 +0900 | [diff] [blame] | 222 | self.volume['id'], new_size=extend_size) |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 223 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 224 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 225 | @decorators.idempotent_id('355218f1-8991-400a-a6bb-971239287d92') |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 226 | def test_volume_extend_with_None_size(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 227 | """Test extending volume with none size should fail""" |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 228 | extend_size = None |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 229 | self.assertRaises(lib_exc.BadRequest, |
| 230 | self.volumes_client.extend_volume, |
| Ghanshyam | 58a9e87 | 2015-12-18 10:46:07 +0900 | [diff] [blame] | 231 | self.volume['id'], new_size=extend_size) |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 232 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 233 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 234 | @decorators.idempotent_id('8f05a943-013c-4063-ac71-7baf561e82eb') |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 235 | def test_volume_extend_with_nonexistent_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 236 | """Test extending non existent volume should fail""" |
| Martin Kopec | 37c4bd3 | 2021-06-24 15:46:00 +0000 | [diff] [blame] | 237 | extend_size = self.volume['size'] + CONF.volume.volume_size_extend |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 238 | self.assertRaises(lib_exc.NotFound, self.volumes_client.extend_volume, |
| Ken'ichi Ohmichi | d079c89 | 2016-04-19 11:23:36 -0700 | [diff] [blame] | 239 | data_utils.rand_uuid(), new_size=extend_size) |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 240 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 241 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 242 | @decorators.idempotent_id('aff8ba64-6d6f-4f2e-bc33-41a08ee9f115') |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 243 | def test_volume_extend_without_passing_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 244 | """Test extending volume without passing volume id should fail""" |
| Martin Kopec | 37c4bd3 | 2021-06-24 15:46:00 +0000 | [diff] [blame] | 245 | extend_size = self.volume['size'] + CONF.volume.volume_size_extend |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 246 | self.assertRaises(lib_exc.NotFound, self.volumes_client.extend_volume, |
| Ghanshyam | 58a9e87 | 2015-12-18 10:46:07 +0900 | [diff] [blame] | 247 | None, new_size=extend_size) |
| wanghao | 5b98175 | 2013-10-22 11:41:41 +0800 | [diff] [blame] | 248 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 249 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 250 | @decorators.idempotent_id('ac6084c0-0546-45f9-b284-38a367e0e0e2') |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 251 | def test_reserve_volume_with_nonexistent_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 252 | """Test reserving non existent volume should fail""" |
| Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 253 | self.assertRaises(lib_exc.NotFound, |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 254 | self.volumes_client.reserve_volume, |
| Ken'ichi Ohmichi | d079c89 | 2016-04-19 11:23:36 -0700 | [diff] [blame] | 255 | data_utils.rand_uuid()) |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 256 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 257 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 258 | @decorators.idempotent_id('eb467654-3dc1-4a72-9b46-47c29d22654c') |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 259 | def test_unreserve_volume_with_nonexistent_volume_id(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 260 | """Test unreserving non existent volume should fail""" |
| Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 261 | self.assertRaises(lib_exc.NotFound, |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 262 | self.volumes_client.unreserve_volume, |
| Ken'ichi Ohmichi | d079c89 | 2016-04-19 11:23:36 -0700 | [diff] [blame] | 263 | data_utils.rand_uuid()) |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 264 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 265 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 266 | @decorators.idempotent_id('449c4ed2-ecdd-47bb-98dc-072aeccf158c') |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 267 | def test_reserve_volume_with_negative_volume_status(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 268 | """Test reserving already reserved volume should fail""" |
| Roman Bubyr | ed1f02b | 2022-08-03 13:49:37 +0300 | [diff] [blame] | 269 | |
| 270 | # Skip test if the volume has "multiattach" property |
| 271 | volume = self.volumes_client.show_volume(self.volume['id']) |
| 272 | if volume['multiattach']: |
| 273 | raise self.skipException('Reserving multiattach volumes is not' |
| 274 | ' supported.') |
| 275 | |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 276 | # Mark volume as reserved. |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 277 | self.volumes_client.reserve_volume(self.volume['id']) |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 278 | # Mark volume which is marked as reserved before |
| Masayuki Igawa | 4b29e47 | 2015-02-16 10:41:54 +0900 | [diff] [blame] | 279 | self.assertRaises(lib_exc.BadRequest, |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 280 | self.volumes_client.reserve_volume, |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 281 | self.volume['id']) |
| 282 | # Unmark volume as reserved. |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 283 | self.volumes_client.unreserve_volume(self.volume['id']) |
| zhangyanzi | 6b63243 | 2013-10-24 19:08:50 +0800 | [diff] [blame] | 284 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 285 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 286 | @decorators.idempotent_id('0f4aa809-8c7b-418f-8fb3-84c7a5dfc52f') |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 287 | def test_list_volumes_with_nonexistent_name(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 288 | """Test listing volumes with non existent name should get nothing""" |
| Martin Kopec | 213d0a4 | 2023-11-30 10:28:14 +0100 | [diff] [blame] | 289 | v_name = data_utils.rand_name( |
| 290 | prefix=CONF.resource_name_prefix, |
| 291 | name=self.__class__.__name__ + '-Volume') |
| zhufl | a57530c | 2017-03-23 11:38:12 +0800 | [diff] [blame] | 292 | params = {'name': v_name} |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 293 | fetched_volume = self.volumes_client.list_volumes( |
| 294 | params=params)['volumes'] |
| Masayuki Igawa | f9009b4 | 2017-04-10 14:49:29 +0900 | [diff] [blame] | 295 | self.assertEmpty(fetched_volume) |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 296 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 297 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 298 | @decorators.idempotent_id('9ca17820-a0e7-4cbd-a7fa-f4468735e359') |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 299 | def test_list_volumes_detail_with_nonexistent_name(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 300 | """Test listing volume details with non existent name |
| 301 | |
| 302 | Listing volume details with non existent name should get nothing. |
| 303 | """ |
| Martin Kopec | 213d0a4 | 2023-11-30 10:28:14 +0100 | [diff] [blame] | 304 | v_name = data_utils.rand_name( |
| 305 | prefix=CONF.resource_name_prefix, |
| 306 | name=self.__class__.__name__ + '-Volume') |
| zhufl | a57530c | 2017-03-23 11:38:12 +0800 | [diff] [blame] | 307 | params = {'name': v_name} |
| Joseph Lanoux | 6809bab | 2014-12-18 14:57:18 +0000 | [diff] [blame] | 308 | fetched_volume = \ |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 309 | self.volumes_client.list_volumes( |
| 310 | detail=True, params=params)['volumes'] |
| Masayuki Igawa | f9009b4 | 2017-04-10 14:49:29 +0900 | [diff] [blame] | 311 | self.assertEmpty(fetched_volume) |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 312 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 313 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 314 | @decorators.idempotent_id('143b279b-7522-466b-81be-34a87d564a7c') |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 315 | def test_list_volumes_with_invalid_status(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 316 | """Test listing volumes with invalid status should get nothing""" |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 317 | params = {'status': 'null'} |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 318 | fetched_volume = self.volumes_client.list_volumes( |
| 319 | params=params)['volumes'] |
| Masayuki Igawa | f9009b4 | 2017-04-10 14:49:29 +0900 | [diff] [blame] | 320 | self.assertEmpty(fetched_volume) |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 321 | |
| Jordan Pittier | 3b46d27 | 2017-04-12 16:17:28 +0200 | [diff] [blame] | 322 | @decorators.attr(type=['negative']) |
| Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 323 | @decorators.idempotent_id('ba94b27b-be3f-496c-a00e-0283b373fa75') |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 324 | def test_list_volumes_detail_with_invalid_status(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 325 | """Test listing volume details with invalid status |
| 326 | |
| 327 | Listing volume details with invalid status should get nothing |
| 328 | """ |
| Zhi Kun Liu | 4240318 | 2013-10-11 18:05:08 +0800 | [diff] [blame] | 329 | params = {'status': 'null'} |
| Joseph Lanoux | 6809bab | 2014-12-18 14:57:18 +0000 | [diff] [blame] | 330 | fetched_volume = \ |
| lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 331 | self.volumes_client.list_volumes(detail=True, |
| 332 | params=params)['volumes'] |
| Masayuki Igawa | f9009b4 | 2017-04-10 14:49:29 +0900 | [diff] [blame] | 333 | self.assertEmpty(fetched_volume) |
| jeremy.zhang | 0a42716 | 2017-04-21 12:47:56 +0800 | [diff] [blame] | 334 | |
| 335 | @decorators.attr(type=['negative']) |
| 336 | @decorators.idempotent_id('5b810c91-0ad1-47ce-aee8-615f789be78f') |
| Andrea Frittoli | cd36841 | 2017-08-14 21:37:56 +0100 | [diff] [blame] | 337 | @utils.services('image') |
| jeremy.zhang | 0a42716 | 2017-04-21 12:47:56 +0800 | [diff] [blame] | 338 | def test_create_volume_from_image_with_decreasing_size(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 339 | """Test creating volume from image with decreasing size should fail""" |
| jeremy.zhang | 0a42716 | 2017-04-21 12:47:56 +0800 | [diff] [blame] | 340 | # Create image |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 341 | image = self.create_image() |
| jeremy.zhang | 0a42716 | 2017-04-21 12:47:56 +0800 | [diff] [blame] | 342 | |
| 343 | # Note(jeremyZ): To shorten the test time (uploading a big size image |
| 344 | # is time-consuming), here just consider the scenario that volume size |
| 345 | # is smaller than the min_disk of image. |
| 346 | self.assertRaises(lib_exc.BadRequest, |
| 347 | self.volumes_client.create_volume, |
| 348 | size=CONF.volume.volume_size, |
| 349 | imageRef=image['id']) |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 350 | |
| 351 | @decorators.attr(type=['negative']) |
| 352 | @decorators.idempotent_id('d15e7f35-2cfc-48c8-9418-c8223a89bcbb') |
| Andrea Frittoli | cd36841 | 2017-08-14 21:37:56 +0100 | [diff] [blame] | 353 | @utils.services('image') |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 354 | def test_create_volume_from_deactivated_image(self): |
| zhufl | a568237 | 2020-08-14 14:56:57 +0800 | [diff] [blame] | 355 | """Test creating volume from deactivated image should fail""" |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 356 | # Create image |
| 357 | image = self.create_image() |
| 358 | |
| 359 | # Deactivate the image |
| 360 | self.images_client.deactivate_image(image['id']) |
| Felix Huettner | d05536b | 2021-03-08 08:48:43 +0100 | [diff] [blame] | 361 | self.addCleanup(test_utils.call_and_ignore_notfound_exc, |
| 362 | self.images_client.reactivate_image, image['id']) |
| 363 | |
| lkuchlan | 13736ae | 2017-04-24 14:49:45 +0300 | [diff] [blame] | 364 | body = self.images_client.show_image(image['id']) |
| 365 | self.assertEqual("deactivated", body['status']) |
| 366 | # Try creating a volume from deactivated image |
| 367 | self.assertRaises(lib_exc.BadRequest, |
| 368 | self.create_volume, |
| 369 | imageRef=image['id']) |