blob: e7fa97d40c7f717613d32795be1d50f821897933 [file] [log] [blame]
Attila Fazekas36b1fcf2013-01-31 16:41:04 +01001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
Attila Fazekas36b1fcf2013-01-31 16:41:04 +010015from tempest.tests.volume import base
16
17
Attila Fazekas3dcdae12013-02-14 12:50:04 +010018class VolumesSnapshotTest(base.BaseVolumeTest):
19 _interface = "json"
Attila Fazekas36b1fcf2013-01-31 16:41:04 +010020
21 def test_volume_from_snapshot(self):
22 volume_origin = self.create_volume(size=1)
23 snapshot = self.create_snapshot(volume_origin['id'])
24 volume_snap = self.create_volume(size=1,
25 snapshot_id=
26 snapshot['id'])
27 self.snapshots_client.delete_snapshot(snapshot['id'])
Attila Fazekas3dcdae12013-02-14 12:50:04 +010028 self.volumes_client.delete_volume(volume_snap['id'])
Attila Fazekas36b1fcf2013-01-31 16:41:04 +010029 self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
30 self.snapshots.remove(snapshot)
Attila Fazekas3dcdae12013-02-14 12:50:04 +010031 self.volumes_client.delete_volume(volume_origin['id'])
32 self.volumes_client.wait_for_resource_deletion(volume_snap['id'])
Attila Fazekas36b1fcf2013-01-31 16:41:04 +010033 self.volumes.remove(volume_snap)
Attila Fazekas3dcdae12013-02-14 12:50:04 +010034 self.volumes_client.wait_for_resource_deletion(volume_origin['id'])
Attila Fazekas36b1fcf2013-01-31 16:41:04 +010035 self.volumes.remove(volume_origin)
36
37
Attila Fazekas3dcdae12013-02-14 12:50:04 +010038class VolumesSnapshotTestXML(VolumesSnapshotTest):
39 _interface = "xml"