blob: c9e80aac4f91942100e7611fda46f459b3141871 [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
17from tempest import config
18from tempest import test
19
20CONF = config.CONF
21
22
23class VolumesV2ExtendTest(base.BaseVolumeTest):
24
25 @classmethod
26 @test.safe_setup
27 def setUpClass(cls):
28 super(VolumesV2ExtendTest, cls).setUpClass()
29 cls.client = cls.volumes_client
30
31 @test.attr(type='gate')
32 def test_volume_extend(self):
33 # Extend Volume Test.
34 self.volume = self.create_volume()
35 extend_size = int(self.volume['size']) + 1
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +000036 _, body = self.client.extend_volume(self.volume['id'], extend_size)
Attila Fazekas9fa29472014-08-18 09:48:00 +020037 self.client.wait_for_volume_status(self.volume['id'], 'available')
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +000038 _, volume = self.client.get_volume(self.volume['id'])
Attila Fazekas9fa29472014-08-18 09:48:00 +020039 self.assertEqual(int(volume['size']), extend_size)
40
41
42class VolumesV2ExtendTestXML(VolumesV2ExtendTest):
43 _interface = "xml"
44
45
46class VolumesV1ExtendTest(VolumesV2ExtendTest):
47 _api_version = 1
48
49
50class VolumesV1ExtendTestXML(VolumesV1ExtendTest):
51 _interface = "xml"