Attila Fazekas | 36b1fcf | 2013-01-31 16:41:04 +0100 | [diff] [blame] | 1 | # 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 Fazekas | 36b1fcf | 2013-01-31 16:41:04 +0100 | [diff] [blame] | 15 | from tempest.tests.volume import base |
| 16 | |
| 17 | |
Attila Fazekas | 3dcdae1 | 2013-02-14 12:50:04 +0100 | [diff] [blame] | 18 | class VolumesSnapshotTest(base.BaseVolumeTest): |
| 19 | _interface = "json" |
Attila Fazekas | 36b1fcf | 2013-01-31 16:41:04 +0100 | [diff] [blame] | 20 | |
| 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 Fazekas | 3dcdae1 | 2013-02-14 12:50:04 +0100 | [diff] [blame] | 28 | self.volumes_client.delete_volume(volume_snap['id']) |
Attila Fazekas | 36b1fcf | 2013-01-31 16:41:04 +0100 | [diff] [blame] | 29 | self.snapshots_client.wait_for_resource_deletion(snapshot['id']) |
| 30 | self.snapshots.remove(snapshot) |
Attila Fazekas | 3dcdae1 | 2013-02-14 12:50:04 +0100 | [diff] [blame] | 31 | self.volumes_client.delete_volume(volume_origin['id']) |
| 32 | self.volumes_client.wait_for_resource_deletion(volume_snap['id']) |
Attila Fazekas | 36b1fcf | 2013-01-31 16:41:04 +0100 | [diff] [blame] | 33 | self.volumes.remove(volume_snap) |
Attila Fazekas | 3dcdae1 | 2013-02-14 12:50:04 +0100 | [diff] [blame] | 34 | self.volumes_client.wait_for_resource_deletion(volume_origin['id']) |
Attila Fazekas | 36b1fcf | 2013-01-31 16:41:04 +0100 | [diff] [blame] | 35 | self.volumes.remove(volume_origin) |
| 36 | |
| 37 | |
Attila Fazekas | 3dcdae1 | 2013-02-14 12:50:04 +0100 | [diff] [blame] | 38 | class VolumesSnapshotTestXML(VolumesSnapshotTest): |
| 39 | _interface = "xml" |