blob: 2378790594ed4dd80b735ae962587a569739b4e9 [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
Ken'ichi Ohmichi6b279c72017-01-27 18:26:59 -080018from tempest.lib import decorators
Attila Fazekas9fa29472014-08-18 09:48:00 +020019
Attila Fazekas9fa29472014-08-18 09:48:00 +020020
21class VolumesV2ExtendTest(base.BaseVolumeTest):
22
Ken'ichi Ohmichi6b279c72017-01-27 18:26:59 -080023 @decorators.idempotent_id('9a36df71-a257-43a5-9555-dc7c88e66e0e')
Attila Fazekas9fa29472014-08-18 09:48:00 +020024 def test_volume_extend(self):
25 # Extend Volume Test.
zhufl7a8f29d2017-02-17 10:16:45 +080026 volume = self.create_volume()
Avi Avrahamd77d3d12017-02-15 16:45:25 +020027 extend_size = volume['size'] + 1
zhufl7a8f29d2017-02-17 10:16:45 +080028 self.volumes_client.extend_volume(volume['id'],
lkuchlanb21fc572016-11-28 12:25:22 +020029 new_size=extend_size)
30 waiters.wait_for_volume_status(self.volumes_client,
zhufl7a8f29d2017-02-17 10:16:45 +080031 volume['id'], 'available')
32 volume = self.volumes_client.show_volume(volume['id'])['volume']
Avi Avrahamd77d3d12017-02-15 16:45:25 +020033 self.assertEqual(volume['size'], extend_size)
Attila Fazekas9fa29472014-08-18 09:48:00 +020034
35
Attila Fazekas9fa29472014-08-18 09:48:00 +020036class VolumesV1ExtendTest(VolumesV2ExtendTest):
37 _api_version = 1