Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
| 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 | |
| 16 | from tempest.api.volume import base |
Yaroslav Lobankov | ed3a35b | 2016-03-24 22:41:30 -0500 | [diff] [blame] | 17 | from tempest.common import waiters |
Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 18 | from tempest.lib import decorators |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 19 | |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 20 | |
| 21 | class VolumesV2ExtendTest(base.BaseVolumeTest): |
| 22 | |
Ken'ichi Ohmichi | 6b279c7 | 2017-01-27 18:26:59 -0800 | [diff] [blame] | 23 | @decorators.idempotent_id('9a36df71-a257-43a5-9555-dc7c88e66e0e') |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 24 | def test_volume_extend(self): |
| 25 | # Extend Volume Test. |
zhufl | 7a8f29d | 2017-02-17 10:16:45 +0800 | [diff] [blame] | 26 | volume = self.create_volume() |
Avi Avraham | d77d3d1 | 2017-02-15 16:45:25 +0200 | [diff] [blame] | 27 | extend_size = volume['size'] + 1 |
zhufl | 7a8f29d | 2017-02-17 10:16:45 +0800 | [diff] [blame] | 28 | self.volumes_client.extend_volume(volume['id'], |
lkuchlan | b21fc57 | 2016-11-28 12:25:22 +0200 | [diff] [blame] | 29 | new_size=extend_size) |
| 30 | waiters.wait_for_volume_status(self.volumes_client, |
zhufl | 7a8f29d | 2017-02-17 10:16:45 +0800 | [diff] [blame] | 31 | volume['id'], 'available') |
| 32 | volume = self.volumes_client.show_volume(volume['id'])['volume'] |
Avi Avraham | d77d3d1 | 2017-02-15 16:45:25 +0200 | [diff] [blame] | 33 | self.assertEqual(volume['size'], extend_size) |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 34 | |
| 35 | |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 36 | class VolumesV1ExtendTest(VolumesV2ExtendTest): |
| 37 | _api_version = 1 |