Codebase list cinder-tempest-plugin / 79a7760
Merge "Add snapshot deletion test" Zuul authored 1 year, 11 months ago Gerrit Code Review committed 1 year, 11 months ago
1 changed file(s) with 36 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1313 # under the License.
1414
1515 from tempest.common import utils
16 from tempest.common import waiters
17 from tempest import config
1618 from tempest.lib import decorators
1719
20 import testtools
21
1822 from cinder_tempest_plugin.scenario import manager
23
24 CONF = config.CONF
1925
2026
2127 class SnapshotDataIntegrityTests(manager.ScenarioTest):
120126
121127 self.assertEqual(count_snap, i)
122128 self.assertEqual(file_map[i], md5_file)
129
130
131 class SnapshotDependencyTests(manager.ScenarioTest):
132 @testtools.skipUnless(CONF.volume_feature_enabled.volume_image_dep_tests,
133 'dependency tests not enabled')
134 @decorators.idempotent_id('e7028f52-f6d4-479c-8809-6f6cf96cfe0f')
135 @utils.services('image', 'volume')
136 def test_snapshot_removal(self):
137 volume_1 = self.create_volume()
138
139 snapshot_1 = self.create_volume_snapshot(volume_1['id'], force=True)
140 waiters.wait_for_volume_resource_status(
141 self.snapshots_client, snapshot_1['id'], 'available')
142
143 clone_kwargs = {'snapshot_id': snapshot_1['id'],
144 'size': volume_1['size']}
145 volume_2 = self.volumes_client.create_volume(**clone_kwargs)['volume']
146
147 waiters.wait_for_volume_resource_status(
148 self.volumes_client, volume_2['id'], 'available')
149 volume_2 = self.volumes_client.show_volume(volume_2['id'])['volume']
150
151 self.snapshots_client.delete_snapshot(snapshot_1['id'])
152 self.snapshots_client.wait_for_resource_deletion(snapshot_1['id'])
153
154 self.volumes_client.delete_volume(volume_1['id'])
155 self.volumes_client.wait_for_resource_deletion(volume_1['id'])
156
157 self.volumes_client.delete_volume(volume_2['id'])
158 self.volumes_client.wait_for_resource_deletion(volume_2['id'])