blob: 7aea1c4a83428b6a6af0c1680f71cc619d7b1947 [file] [log] [blame]
Attila Fazekas9fa29472014-08-18 09:48:00 +02001# 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
16from tempest.api.volume import base
Yaroslav Lobankoved3a35b2016-03-24 22:41:30 -050017from tempest.common import waiters
Attila Fazekas9fa29472014-08-18 09:48:00 +020018from tempest import test
19
Attila Fazekas9fa29472014-08-18 09:48:00 +020020
21class VolumesV2ExtendTest(base.BaseVolumeTest):
22
23 @classmethod
Rohan Kanade05749152015-01-30 17:15:18 +053024 def setup_clients(cls):
25 super(VolumesV2ExtendTest, cls).setup_clients()
Attila Fazekas9fa29472014-08-18 09:48:00 +020026 cls.client = cls.volumes_client
27
Chris Hoge7579c1a2015-02-26 14:12:15 -080028 @test.idempotent_id('9a36df71-a257-43a5-9555-dc7c88e66e0e')
Attila Fazekas9fa29472014-08-18 09:48:00 +020029 def test_volume_extend(self):
30 # Extend Volume Test.
31 self.volume = self.create_volume()
32 extend_size = int(self.volume['size']) + 1
Ghanshyam58a9e872015-12-18 10:46:07 +090033 self.client.extend_volume(self.volume['id'], new_size=extend_size)
Yaroslav Lobankoved3a35b2016-03-24 22:41:30 -050034 waiters.wait_for_volume_status(self.client,
35 self.volume['id'], 'available')
John Warren6177c9e2015-08-19 20:00:17 +000036 volume = self.client.show_volume(self.volume['id'])['volume']
Attila Fazekas9fa29472014-08-18 09:48:00 +020037 self.assertEqual(int(volume['size']), extend_size)
38
39
Attila Fazekas9fa29472014-08-18 09:48:00 +020040class VolumesV1ExtendTest(VolumesV2ExtendTest):
41 _api_version = 1