"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_common.py" between
cinder-17.0.0.tar.gz and cinder-17.0.1.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 "Victoria" series (latest release).

test_powermax_common.py  (cinder-17.0.0):test_powermax_common.py  (cinder-17.0.1)
skipping to change at line 3538 skipping to change at line 3538
configuration = tpfo.FakeConfiguration( configuration = tpfo.FakeConfiguration(
None, 'CommonTests', 1, 1, san_ip='1.1.1.1', san_login='smc', None, 'CommonTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
powermax_array=self.data.array, powermax_srp='SRP_1', powermax_array=self.data.array, powermax_srp='SRP_1',
san_password='smc', san_password='smc',
powermax_port_groups=[self.data.port_group_name_i]) powermax_port_groups=[self.data.port_group_name_i])
self.common.configuration = configuration self.common.configuration = configuration
ref_port = utils.DEFAULT_PORT ref_port = utils.DEFAULT_PORT
port = self.common._get_unisphere_port() port = self.common._get_unisphere_port()
self.assertEqual(ref_port, port) self.assertEqual(ref_port, port)
@mock.patch.object(common.PowerMaxCommon,
'_do_sync_check')
def test_sync_check_no_source_device_on_array(self, mock_check):
with mock.patch.object(self.rest, 'get_volume',
side_effect=exception.VolumeBackendAPIException(
"404 00123 does not exist")):
array = self.data.array
device_id = self.data.device_id
extra_specs = self.data.extra_specs
self.common._sync_check(array, device_id, extra_specs,
source_device_id='00123')
mock_check.assert_not_called()
def test_sync_check(self): def test_sync_check(self):
array = self.data.array array = self.data.array
device_id = self.data.device_id device_id = self.data.device_id
extra_specs = self.data.extra_specs extra_specs = self.data.extra_specs
with mock.patch.object(self.common, '_do_sync_check') as mck_sync: with mock.patch.object(self.common, '_do_sync_check') as mck_sync:
self.common._sync_check(array, device_id, extra_specs, False, self.common._sync_check(array, device_id, extra_specs, False,
self.data.device_id2) self.data.device_id2)
mck_sync.assert_called_with(array, self.data.device_id2, mck_sync.assert_called_with(array, self.data.device_id,
extra_specs, False) extra_specs, False)
mck_sync.reset_mock() mck_sync.reset_mock()
with mock.patch.object(self.common, '_get_target_source_device', with mock.patch.object(self.common, '_get_target_source_device',
return_value=self.data.device_id3): return_value=self.data.device_id3):
self.common._sync_check(array, device_id, extra_specs, True) self.common._sync_check(array, device_id, extra_specs, True)
mck_sync.assert_called_with(array, self.data.device_id3, mck_sync.assert_called_with(array, self.data.device_id,
extra_specs, True) extra_specs, True)
mck_sync.reset_mock() mck_sync.reset_mock()
self.common._sync_check(array, device_id, extra_specs) self.common._sync_check(array, device_id, extra_specs)
mck_sync.assert_called_with(array, device_id, extra_specs, False) mck_sync.assert_called_with(array, device_id, extra_specs, False)
@mock.patch.object(common.PowerMaxCommon, @mock.patch.object(common.PowerMaxCommon,
'_unlink_targets_and_delete_temp_snapvx') '_unlink_targets_and_delete_temp_snapvx')
@mock.patch.object(rest.PowerMaxRest, 'find_snap_vx_sessions', @mock.patch.object(rest.PowerMaxRest, 'find_snap_vx_sessions',
return_value=(tpd.PowerMaxData.snap_src_sessions, return_value=(tpd.PowerMaxData.snap_src_sessions,
tpd.PowerMaxData.snap_tgt_session)) tpd.PowerMaxData.snap_tgt_session))
skipping to change at line 3588 skipping to change at line 3575
def test_do_sync_check(self, mck_rep, mck_find, mck_unlink): def test_do_sync_check(self, mck_rep, mck_find, mck_unlink):
array = self.data.array array = self.data.array
device_id = self.data.device_id device_id = self.data.device_id
extra_specs = self.data.extra_specs extra_specs = self.data.extra_specs
self.common._do_sync_check(array, device_id, extra_specs) self.common._do_sync_check(array, device_id, extra_specs)
self.assertEqual(3, mck_unlink.call_count) self.assertEqual(3, mck_unlink.call_count)
@mock.patch.object(provision.PowerMaxProvision, 'delete_temp_volume_snap') @mock.patch.object(provision.PowerMaxProvision, 'delete_temp_volume_snap')
@mock.patch.object(provision.PowerMaxProvision, 'unlink_snapvx_tgt_volume') @mock.patch.object(provision.PowerMaxProvision, 'unlink_snapvx_tgt_volume')
def test_unlink_targets_and_delete_temp_snapvx(self, mck_break, mck_del): def test_unlink_targets_and_delete_temp_snapvx_legacy(
self, mck_break, mck_del):
array = self.data.array array = self.data.array
extra_specs = self.data.extra_specs extra_specs = self.data.extra_specs
session = self.data.snap_tgt_session_cm_enabled session = deepcopy(self.data.snap_tgt_session_cm_enabled)
snap_name = session['snap_name'] legacy_snap_name = 'EMC_SMI'
session['snap_name'] = legacy_snap_name
source = session['source_vol_id'] source = session['source_vol_id']
snap_id = session['snapid'] snap_id = session['snapid']
target = session['target_vol_id'] target = session['target_vol_id']
self.common._unlink_targets_and_delete_temp_snapvx(
session, array, extra_specs)
mck_break.assert_called_with(array, target, source, legacy_snap_name,
extra_specs, snap_id, True)
mck_del.assert_called_once_with(
array, legacy_snap_name, source, snap_id)
@mock.patch.object(provision.PowerMaxProvision, 'delete_temp_volume_snap')
@mock.patch.object(provision.PowerMaxProvision, 'unlink_snapvx_tgt_volume')
def test_unlink_targets_and_delete_temp_snapvx_is_temp(
self, mck_break, mck_del):
array = self.data.array
extra_specs = self.data.extra_specs
session = deepcopy(self.data.snap_tgt_session_cm_enabled)
snap_name = session['snap_name']
source = session['source_vol_id']
snap_id = session['snapid']
target = session['target_vol_id']
self.common._unlink_targets_and_delete_temp_snapvx( self.common._unlink_targets_and_delete_temp_snapvx(
session, array, extra_specs) session, array, extra_specs)
mck_break.assert_called_with(array, target, source, snap_name, mck_break.assert_called_with(array, target, source, snap_name,
extra_specs, snap_id, True) extra_specs, snap_id, True)
mck_del.assert_called_once_with(array, snap_name, source, snap_id) mck_del.assert_called_once_with(array, snap_name, source, snap_id)
mck_break.reset_mock() def test_unlink_targets_and_delete_temp_snapvx_no_snap_name_found(self):
mck_del.reset_mock() array = self.data.array
extra_specs = self.data.extra_specs
session = dict()
self.assertRaises(exception.VolumeBackendAPIException,
self.common._unlink_targets_and_delete_temp_snapvx,
session, array, extra_specs)
session['copy_mode'] = False @mock.patch.object(provision.PowerMaxProvision, 'delete_temp_volume_snap')
session['expired'] = True @mock.patch.object(provision.PowerMaxProvision, 'unlink_snapvx_tgt_volume')
def test_unlink_targets_and_delete_temp_snapvx_not_legacy_not_temp(
self, mck_break, mck_del):
array = self.data.array
extra_specs = self.data.extra_specs
session = deepcopy(self.data.snap_tgt_session_cm_enabled)
session['snap_name'] = 'not_leg_or_tmp'
snap_name = session['snap_name']
source = session['source_vol_id']
snap_id = session['snapid']
target = session['target_vol_id']
self.common._unlink_targets_and_delete_temp_snapvx( self.common._unlink_targets_and_delete_temp_snapvx(
session, array, extra_specs) session, array, extra_specs)
mck_break.assert_called_with(array, target, source, snap_name, mck_break.assert_called_with(array, target, source, snap_name,
extra_specs, snap_id, False) extra_specs, snap_id, True)
mck_del.assert_not_called() mck_del.assert_not_called()
@mock.patch.object(rest.PowerMaxRest, 'find_snap_vx_sessions', @mock.patch.object(rest.PowerMaxRest, 'find_snap_vx_sessions',
return_value=(None, tpd.PowerMaxData.snap_tgt_session)) return_value=(None, tpd.PowerMaxData.snap_tgt_session))
@mock.patch.object(rest.PowerMaxRest, 'is_vol_in_rep_session', @mock.patch.object(rest.PowerMaxRest, 'is_vol_in_rep_session',
return_value=(True, False, False)) return_value=(True, False, False))
def test_get_target_source_device(self, mck_rep, mck_find): def test_get_target_source_device(self, mck_rep, mck_find):
array = self.data.array array = self.data.array
tgt_device = self.data.device_id2 tgt_device = self.data.device_id2
src_device = self.common._get_target_source_device(array, tgt_device) src_device = self.common._get_target_source_device(array, tgt_device)
 End of changes. 10 change blocks. 
23 lines changed or deleted 44 lines changed or added

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