"Fossies" - the Fresh Open Source Software Archive  

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

test_powermax_replication.py  (cinder-15.0.1):test_powermax_replication.py  (cinder-15.1.0)
skipping to change at line 35 skipping to change at line 35
from cinder.objects import group from cinder.objects import group
from cinder import test from cinder import test
from cinder.tests.unit.volume.drivers.dell_emc.powermax import ( from cinder.tests.unit.volume.drivers.dell_emc.powermax import (
powermax_data as tpd) powermax_data as tpd)
from cinder.tests.unit.volume.drivers.dell_emc.powermax import ( from cinder.tests.unit.volume.drivers.dell_emc.powermax import (
powermax_fake_objects as tpfo) powermax_fake_objects as tpfo)
from cinder.volume.drivers.dell_emc.powermax import common from cinder.volume.drivers.dell_emc.powermax import common
from cinder.volume.drivers.dell_emc.powermax import fc from cinder.volume.drivers.dell_emc.powermax import fc
from cinder.volume.drivers.dell_emc.powermax import iscsi from cinder.volume.drivers.dell_emc.powermax import iscsi
from cinder.volume.drivers.dell_emc.powermax import masking from cinder.volume.drivers.dell_emc.powermax import masking
from cinder.volume.drivers.dell_emc.powermax import metadata
from cinder.volume.drivers.dell_emc.powermax import provision from cinder.volume.drivers.dell_emc.powermax import provision
from cinder.volume.drivers.dell_emc.powermax import rest from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume.drivers.dell_emc.powermax import utils from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import volume_utils from cinder.volume import volume_utils
class PowerMaxReplicationTest(test.TestCase): class PowerMaxReplicationTest(test.TestCase):
def setUp(self): def setUp(self):
self.data = tpd.PowerMaxData() self.data = tpd.PowerMaxData()
super(PowerMaxReplicationTest, self).setUp() super(PowerMaxReplicationTest, self).setUp()
self.replication_device = { self.replication_device = {
skipping to change at line 240 skipping to change at line 241
@mock.patch.object(common.PowerMaxCommon, '_remove_members') @mock.patch.object(common.PowerMaxCommon, '_remove_members')
@mock.patch.object( @mock.patch.object(
common.PowerMaxCommon, '_get_replication_extra_specs', common.PowerMaxCommon, '_get_replication_extra_specs',
return_value=tpd.PowerMaxData.rep_extra_specs2) return_value=tpd.PowerMaxData.rep_extra_specs2)
@mock.patch.object( @mock.patch.object(
utils.PowerMaxUtils, 'is_volume_failed_over', return_value=True) utils.PowerMaxUtils, 'is_volume_failed_over', return_value=True)
def test_unmap_lun_volume_failed_over(self, mock_fo, mock_es, mock_rm): def test_unmap_lun_volume_failed_over(self, mock_fo, mock_es, mock_rm):
extra_specs = deepcopy(self.extra_specs) extra_specs = deepcopy(self.extra_specs)
extra_specs[utils.PORTGROUPNAME] = self.data.port_group_name_f extra_specs[utils.PORTGROUPNAME] = self.data.port_group_name_f
extra_specs[utils.IS_RE] = True
rep_config = self.utils.get_replication_config( rep_config = self.utils.get_replication_config(
[self.replication_device]) [self.replication_device])
self.common._unmap_lun(self.data.test_volume, self.data.connector) self.common._unmap_lun(self.data.test_volume, self.data.connector)
mock_es.assert_called_once_with(extra_specs, rep_config) mock_es.assert_called_once_with(extra_specs, rep_config)
@mock.patch.object(common.PowerMaxCommon, '_remove_members') @mock.patch.object(common.PowerMaxCommon, '_remove_members')
@mock.patch.object( @mock.patch.object(
common.PowerMaxCommon, '_get_replication_extra_specs', common.PowerMaxCommon, '_get_replication_extra_specs',
return_value=tpd.PowerMaxData.rep_extra_specs) return_value=tpd.PowerMaxData.rep_extra_specs)
@mock.patch.object( @mock.patch.object(
skipping to change at line 401 skipping to change at line 403
def test_setup_volume_replication_target( def test_setup_volume_replication_target(
self, mock_model, mock_create, mock_rm, mck_sync): self, mock_model, mock_create, mock_rm, mck_sync):
rep_status, rep_data, __ = self.common.setup_volume_replication( rep_status, rep_data, __ = self.common.setup_volume_replication(
self.data.array, self.data.test_volume, self.data.device_id, self.data.array, self.data.test_volume, self.data.device_id,
self.extra_specs, self.data.device_id2) self.extra_specs, self.data.device_id2)
self.assertEqual(fields.ReplicationStatus.ENABLED, rep_status) self.assertEqual(fields.ReplicationStatus.ENABLED, rep_status)
self.assertEqual({'array': self.data.remote_array, self.assertEqual({'array': self.data.remote_array,
'device_id': self.data.device_id2}, rep_data) 'device_id': self.data.device_id2}, rep_data)
mock_create.assert_not_called() mock_create.assert_not_called()
@mock.patch.object(common.PowerMaxCommon, 'get_rdf_details', @mock.patch.object(rest.PowerMaxRest, 'get_rdf_group', return_value={
return_value=(tpd.PowerMaxData.rdf_group_no, 'numDevices': 1})
tpd.PowerMaxData.remote_array)) @mock.patch.object(rest.PowerMaxRest, 'get_size_of_device_on_array')
@mock.patch.object(rest.PowerMaxRest, 'get_size_of_device_on_array',
return_value=2)
@mock.patch.object(common.PowerMaxCommon, '_get_replication_extra_specs', @mock.patch.object(common.PowerMaxCommon, '_get_replication_extra_specs',
return_value=tpd.PowerMaxData.rep_extra_specs5) return_value=tpd.PowerMaxData.rep_extra_specs6)
@mock.patch.object(common.PowerMaxCommon, '_create_volume', @mock.patch.object(common.PowerMaxCommon, '_create_volume', return_value={
return_value=tpd.PowerMaxData.provider_location) 'device_id': tpd.PowerMaxData.device_id2})
@mock.patch.object(rest.PowerMaxRest, 'get_storage_group',
return_value=None)
@mock.patch.object(rest.PowerMaxRest, 'create_storage_group')
@mock.patch.object(masking.PowerMaxMasking, 'add_volume_to_storage_group')
@mock.patch.object(common.PowerMaxCommon, '_sync_check') @mock.patch.object(common.PowerMaxCommon, '_sync_check')
@mock.patch.object(rest.PowerMaxRest, 'create_rdf_device_pair', @mock.patch.object(rest.PowerMaxRest, 'create_rdf_device_pair',
return_value=tpd.PowerMaxData.rdf_group_details) return_value={'rdf_dict'})
def test_setup_inuse_volume_replication(self, mck_create_rdf_pair, @mock.patch.object(metadata.PowerMaxVolumeMetadata,
mck_sync_chk, mck_create_vol, 'gather_replication_info',
mck_rep_specs, mck_get_vol_size, return_value={'rep_info_dict'})
mck_get_rdf_info): def test_setup_inuse_volume_replication(
self, mck_gather_rep_info, mck_create_rdf_pair, mck_sync_check,
mck_add_vol_to_sg, mck_create_sg, mck_get_sg, mck_create_vol,
mck_get_rep_specs, mck_get_size, mck_get_rdf_grp):
array = self.data.array array = self.data.array
device_id = self.data.device_id
volume = self.data.test_attached_volume volume = self.data.test_attached_volume
extra_specs = self.data.extra_specs_migrate volume_id = volume.id
self.rep_config = self.data.rep_extra_specs4 target_name = self.common.utils.get_volume_element_name(volume_id)
rep_status, rep_data, __ = ( target_device_id = tpd.PowerMaxData.device_id2
device_id = self.data.device_id
extra_specs = self.data.extra_specs_rep_enabled
self.common.rep_config['mode'] = utils.REP_METRO
rdf_group_no, remote_array = self.common.get_rdf_details(array)
rep_extra_specs = self.common._get_replication_extra_specs(
extra_specs, self.common.rep_config)
async_sg = self.common.utils.get_async_rdf_managed_grp_name(
self.common.rep_config)
status, driver_data, info_dict = (
self.common.setup_inuse_volume_replication( self.common.setup_inuse_volume_replication(
array, volume, device_id, extra_specs)) array, volume, device_id, extra_specs))
self.assertEqual('enabled', rep_status) self.assertEqual(status, common.REPLICATION_ENABLED)
self.assertEqual(self.data.rdf_group_details, rep_data) self.assertEqual(driver_data, {'rdf_dict'})
self.assertEqual(info_dict, {'rep_info_dict'})
mck_get_rdf_grp.assert_called_with(array, rdf_group_no)
mck_get_size.assert_called_once_with(array, device_id)
mck_get_rep_specs.assert_called_with(
extra_specs, self.common.rep_config)
mck_create_vol.assert_called_once()
mck_get_sg.assert_called_once_with(remote_array, async_sg)
mck_create_sg.assert_called_once_with(
remote_array, async_sg, extra_specs['srp'], extra_specs['slo'],
extra_specs['workload'], rep_extra_specs)
mck_sync_check.assert_called_once_with(array, device_id, extra_specs,
tgt_only=True)
mck_add_vol_to_sg.assert_called_once_with(
remote_array, target_device_id, async_sg, target_name,
rep_extra_specs, True)
mck_create_rdf_pair.assert_called_once_with(
array, device_id, rdf_group_no, target_device_id, remote_array,
extra_specs)
mck_gather_rep_info.assert_called_with(
volume_id, 'replication', False, rdf_group_no=rdf_group_no,
target_name=target_name, remote_array=remote_array,
target_device_id=target_device_id,
replication_status=common.REPLICATION_ENABLED,
rep_mode=rep_extra_specs['rep_mode'],
rdf_group_label=self.common.rep_config['rdf_group_label'],
target_array_model=rep_extra_specs['target_array_model'])
@mock.patch.object(rest.PowerMaxRest, 'get_array_model_info', @mock.patch.object(rest.PowerMaxRest, 'get_array_model_info',
return_value=('VMAX250F', False)) return_value=('VMAX250F', False))
@mock.patch.object(common.PowerMaxCommon, '_cleanup_remote_target') @mock.patch.object(common.PowerMaxCommon, '_cleanup_remote_target')
def test_cleanup_lun_replication_success(self, mock_clean, mock_model): def test_cleanup_lun_replication_success(self, mock_clean, mock_model):
rep_extra_specs = deepcopy(self.data.rep_extra_specs) rep_extra_specs = deepcopy(self.data.rep_extra_specs)
rep_extra_specs[utils.PORTGROUPNAME] = self.data.port_group_name_f rep_extra_specs[utils.PORTGROUPNAME] = self.data.port_group_name_f
rep_extra_specs['target_array_model'] = 'VMAX250F' rep_extra_specs['target_array_model'] = 'VMAX250F'
self.common.cleanup_lun_replication( self.common.cleanup_lun_replication(
self.data.test_volume, '1', self.data.device_id, self.data.test_volume, '1', self.data.device_id,
 End of changes. 8 change blocks. 
19 lines changed or deleted 60 lines changed or added

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