Codebase list cinder-tempest-plugin / f208601
Fix volume revert to snapshot tests According to the revert to snapshot spec, it should not be possible to revert a volume to a snapshot after the volume is extended. This was fixed on [1] but the cinder_tempest_plugin test still was being considering the old behavior. [1] https://bugs.launchpad.net/cinder/+bug/1798503 Change-Id: I21d0b2291608922e46278ae5799478a5df0c4904 Erlon R. Cruz 7 years ago
1 changed file(s) with 7 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1515 from tempest.common import waiters
1616 from tempest import config
1717 from tempest.lib import decorators
18 from tempest.lib import exceptions
1819
1920 from cinder_tempest_plugin.api.volume import base
2021 from cinder_tempest_plugin import cinder_clients
6465 self.assertEqual(expected_size, volume['size'])
6566
6667 @decorators.idempotent_id('4e8b0788-87fe-430d-be7a-444d7f8e0347')
67 def test_volume_revert_to_snapshot_after_extended(self):
68 def test_volume_revert_to_snapshot_after_extended_negative(self):
6869 """Test revert to snapshot after extended"""
6970 # Extend volume to double the size
7071 expected_size = self.volume['size'] * 2
7374 new_size=expected_size)
7475 waiters.wait_for_volume_resource_status(self.volumes_client,
7576 self.volume['id'], 'available')
76 # Revert to snapshot
77 self.volume_revert_client.revert_to_snapshot(self.volume,
78 self.snapshot['id'])
79 waiters.wait_for_volume_resource_status(
80 self.volumes_client,
81 self.volume['id'], 'available')
82 waiters.wait_for_volume_resource_status(
83 self.snapshots_client,
84 self.snapshot['id'], 'available')
85 volume = self.volumes_client.show_volume(self.volume['id'])['volume']
86 self.assertEqual(expected_size, volume['size'])
77
78 # Destination volume smaller than source, API should block that
79 self.assertRaises(exceptions.BadRequest,
80 self.volume_revert_client.revert_to_snapshot,
81 self.volume, self.snapshot)