"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/tests/unit/volume/drivers/test_pure.py" between
cinder-15.5.0.tar.gz and cinder-15.6.0.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Train" series (maintained release).

test_pure.py  (cinder-15.5.0):test_pure.py  (cinder-15.6.0)
skipping to change at line 1558 skipping to change at line 1558
result = self.driver.create_consistencygroup_from_src( result = self.driver.create_consistencygroup_from_src(
mock_context, mock_context,
mock_group, mock_group,
mock_volumes, mock_volumes,
source_cg=mock_source_cg, source_cg=mock_source_cg,
source_vols=mock_source_vols source_vols=mock_source_vols
) )
self.assertEqual((None, None), result) self.assertEqual((None, None), result)
mock_create_cg.assert_called_with(mock_context, mock_group) mock_create_cg.assert_called_with(mock_context, mock_group)
self.assertTrue(self.array.create_pgroup_snapshot.called) 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) self.assertTrue(self.array.destroy_pgroup.called)
@mock.patch(BASE_DRIVER_OBJ + ".delete_volume", autospec=True) @mock.patch(BASE_DRIVER_OBJ + ".delete_volume", autospec=True)
def test_delete_consistencygroup(self, mock_delete_volume): def test_delete_consistencygroup(self, mock_delete_volume):
mock_context = mock.Mock() mock_context = mock.Mock()
mock_cgroup = fake_group.fake_group_obj(mock_context) mock_cgroup = fake_group.fake_group_obj(mock_context)
mock_volume = fake_volume.fake_volume_obj(mock_context) mock_volume = fake_volume.fake_volume_obj(mock_context)
model_update, volumes = self.driver.delete_consistencygroup( model_update, volumes = self.driver.delete_consistencygroup(
mock_context, mock_cgroup, [mock_volume]) mock_context, mock_cgroup, [mock_volume])
 End of changes. 1 change blocks. 
28 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)