Codebase list cinder-tempest-plugin / 6fa4c41
Modify revert tests to account for creating volumes != 1GB Some backends cannot create volumes in sizes of 1GB, such as ScaleIO. In that case, ensure volumes are created and extended in multiples of what they can support. Change-Id: I92a317e025b37efa09713ecf4ec254fabbff3437 Eric Young authored 8 years ago Eric Young committed 8 years ago
2 changed file(s) with 10 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
4242 def setUp(self):
4343 super(VolumeRevertTests, self).setUp()
4444 # Create volume
45 self.volume = self.create_volume(size=1)
45 self.volume = self.create_volume()
4646 # Create snapshot
4747 self.snapshot = self.create_snapshot(self.volume['id'])
4848
4949 @decorators.idempotent_id('87b7dcb7-4950-4a3a-802c-ece55491846d')
5050 def test_volume_revert_to_snapshot(self):
5151 """Test revert to snapshot"""
52 expected_size = self.volume['size']
5253 # Revert to snapshot
5354 self.volume_revert_client.revert_to_snapshot(self.volume,
5455 self.snapshot['id'])
6061 self.snapshot['id'], 'available')
6162 volume = self.volumes_client.show_volume(self.volume['id'])['volume']
6263
63 self.assertEqual(1, volume['size'])
64 self.assertEqual(expected_size, volume['size'])
6465
6566 @decorators.idempotent_id('4e8b0788-87fe-430d-be7a-444d7f8e0347')
6667 def test_volume_revert_to_snapshot_after_extended(self):
6768 """Test revert to snapshot after extended"""
69 # Extend volume to double the size
70 expected_size = self.volume['size'] * 2
6871 # Extend the volume
69 self.volumes_client.extend_volume(self.volume['id'], new_size=2)
72 self.volumes_client.extend_volume(self.volume['id'],
73 new_size=expected_size)
7074 waiters.wait_for_volume_resource_status(self.volumes_client,
7175 self.volume['id'], 'available')
7276 # Revert to snapshot
7983 self.snapshots_client,
8084 self.snapshot['id'], 'available')
8185 volume = self.volumes_client.show_volume(self.volume['id'])['volume']
82 self.assertEqual(2, volume['size'])
86 self.assertEqual(expected_size, volume['size'])
2323 def __init__(self, auth_provider, service, region, **kwargs):
2424 super(VolumeRevertClient, self).__init__(
2525 auth_provider, service, region, **kwargs)
26 # revert needs v3 of the volume API
27 self.api_version = 'v3'
2628
2729 def revert_to_snapshot(self, volume, snapshot_id):
2830 """Revert a volume to snapshot."""