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 |
| 17 | from tempest import config |
| 18 | from tempest import test |
| 19 | |
| 20 | CONF = config.CONF |
| 21 | |
| 22 | |
| 23 | class VolumesV2ExtendTest(base.BaseVolumeTest): |
| 24 | |
| 25 | @classmethod |
Rohan Kanade | 0574915 | 2015-01-30 17:15:18 +0530 | [diff] [blame] | 26 | def setup_clients(cls): |
| 27 | super(VolumesV2ExtendTest, cls).setup_clients() |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 28 | cls.client = cls.volumes_client |
| 29 | |
Chris Hoge | 7579c1a | 2015-02-26 14:12:15 -0800 | [diff] [blame] | 30 | @test.idempotent_id('9a36df71-a257-43a5-9555-dc7c88e66e0e') |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 31 | def test_volume_extend(self): |
| 32 | # Extend Volume Test. |
| 33 | self.volume = self.create_volume() |
| 34 | extend_size = int(self.volume['size']) + 1 |
Ghanshyam | 58a9e87 | 2015-12-18 10:46:07 +0900 | [diff] [blame^] | 35 | self.client.extend_volume(self.volume['id'], new_size=extend_size) |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 36 | self.client.wait_for_volume_status(self.volume['id'], 'available') |
John Warren | 6177c9e | 2015-08-19 20:00:17 +0000 | [diff] [blame] | 37 | volume = self.client.show_volume(self.volume['id'])['volume'] |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 38 | self.assertEqual(int(volume['size']), extend_size) |
| 39 | |
| 40 | |
Attila Fazekas | 9fa2947 | 2014-08-18 09:48:00 +0200 | [diff] [blame] | 41 | class VolumesV1ExtendTest(VolumesV2ExtendTest): |
| 42 | _api_version = 1 |