Browse Source

Merge "[Pure] Fix failing consistency group tempest tests" into stable/victoria

changes/33/783933/1
Zuul 3 weeks ago
committed by Gerrit Code Review
parent
commit
e9013589c4
3 changed files with 6 additions and 28 deletions
  1. +0
    -28
      cinder/tests/unit/volume/drivers/test_pure.py
  2. +1
    -0
      cinder/volume/drivers/pure.py
  3. +5
    -0
      releasenotes/notes/pure_tempest_cg_fix-913d405f7487de00.yaml

+ 0
- 28
cinder/tests/unit/volume/drivers/test_pure.py View File

@ -1637,34 +1637,6 @@ class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):
self.assertEqual((None, None), result)
mock_create_cg.assert_called_with(mock_context, mock_group)
self.assertTrue(self.array.create_pgroup_snapshot.called)
self.assertEqual(num_volumes, self.array.copy_volume.call_count)
self.assertEqual(num_volumes, self.array.set_pgroup.call_count)
self.assertTrue(self.array.destroy_pgroup.called)
@mock.patch(BASE_DRIVER_OBJ + ".create_consistencygroup")
def test_create_consistencygroup_from_cg_with_error(self, mock_create_cg):
num_volumes = 5
mock_context = mock.MagicMock()
mock_group = mock.MagicMock()
mock_source_cg = mock.MagicMock()
mock_volumes = [mock.MagicMock() for i in range(num_volumes)]
mock_source_vols = [mock.MagicMock() for i in range(num_volumes)]
self.array.copy_volume.side_effect = FakePureStorageHTTPError()
self.assertRaises(
FakePureStorageHTTPError,
self.driver.create_consistencygroup_from_src,
mock_context,
mock_group,
mock_volumes,
source_cg=mock_source_cg,
source_vols=mock_source_vols
)
mock_create_cg.assert_called_with(mock_context, mock_group)
self.assertTrue(self.array.create_pgroup_snapshot.called)
# Make sure that the temp snapshot is cleaned up even when copying
# the volume fails!
self.assertTrue(self.array.destroy_pgroup.called)
@mock.patch(BASE_DRIVER_OBJ + ".delete_volume", autospec=True)


+ 1
- 0
cinder/volume/drivers/pure.py View File

@ -897,6 +897,7 @@ class PureBaseVolumeDriver(san.SanDriver):
'source_group': source_group.id})
current_array = self._get_current_array()
current_array.create_pgroup_snapshot(pgroup_name, suffix=tmp_suffix)
volumes, _ = self.update_provider_info(volumes, None)
try:
for source_vol, cloned_vol in zip(source_vols, volumes):
source_snap_name = self._get_pgroup_vol_snap_name(


+ 5
- 0
releasenotes/notes/pure_tempest_cg_fix-913d405f7487de00.yaml View File

@ -0,0 +1,5 @@
---
fixes:
- |
Pure Storage FlashArray driver fix to ensure cinder_tempest_plugin consistency
group tests pass.

Loading…
Cancel
Save