Merge "PowerMax Driver - Metro Volume Metadata change"

This commit is contained in:
Zuul 2019-09-25 23:29:18 +00:00 committed by Gerrit Code Review
commit 4ad31038bf
3 changed files with 52 additions and 0 deletions

View File

@ -1152,6 +1152,29 @@ class PowerMaxData(object):
'SRDFGroupNumber': 1,
'SRDFRemoteGroupNumber': 1}]}}
priv_vol_response_metro_active_rep = {
'volumeHeader': {
'private': False, 'capGB': 1.0, 'capMB': 1026.0,
'serviceState': 'Normal', 'emulationType': 'FBA',
'volumeId': '00001', 'status': 'Ready', 'mapped': False,
'numStorageGroups': 0, 'reservationInfo': {'reserved': False},
'encapsulated': False, 'formattedName': '00001',
'system_resource': False, 'numSymDevMaskingViews': 0,
'nameModifier': "", 'configuration': 'TDEV',
'userDefinedIdentifier': 'OS-00001'},
'maskingInfo': {'masked': False},
'rdfInfo': {
'dynamicRDF': False, 'RDF': True,
'concurrentRDF': False,
'getDynamicRDFCapability': 'RDF1_Capable', 'RDFA': False,
'RDFSession': [
{'SRDFStatus': 'Ready',
'SRDFReplicationMode': 'Active',
'remoteDeviceID': device_id2,
'remoteSymmetrixID': remote_array,
'SRDFGroupNumber': 1,
'SRDFRemoteGroupNumber': 1}]}}
priv_vol_response_no_rep = {
'volumeHeader': {
'private': False, 'capGB': 1.0, 'capMB': 1026.0,

View File

@ -2902,6 +2902,32 @@ class PowerMaxCommonTest(test.TestCase):
act_metadata = self.common.get_volume_metadata(array, device_id)
self.assertEqual(ref_metadata, act_metadata)
@mock.patch.object(rest.PowerMaxRest, '_get_private_volume',
return_value=tpd.PowerMaxData.
priv_vol_response_metro_active_rep)
@mock.patch.object(rest.PowerMaxRest, 'get_array_model_info',
return_value=(tpd.PowerMaxData.array_model, None))
@mock.patch.object(rest.PowerMaxRest, 'get_rdf_group',
return_value=(tpd.PowerMaxData.rdf_group_details))
def test_get_volume_metadata_metro_active_rep(self, mck_rdf,
mck_model, mck_priv):
ref_metadata = {
'DeviceID': self.data.device_id,
'DeviceLabel': self.data.device_label, 'ArrayID': self.data.array,
'ArrayModel': self.data.array_model, 'ServiceLevel': 'None',
'Workload': 'None', 'Emulation': 'FBA', 'Configuration': 'TDEV',
'CompressionDisabled': 'True', 'ReplicationEnabled': 'True',
'R2-DeviceID': self.data.device_id2,
'R2-ArrayID': self.data.remote_array,
'R2-ArrayModel': self.data.array_model,
'ReplicationMode': 'Metro',
'RDFG-Label': self.data.rdf_group_name,
'R1-RDFG': 1, 'R2-RDFG': 1}
array = self.data.array
device_id = self.data.device_id
act_metadata = self.common.get_volume_metadata(array, device_id)
self.assertEqual(ref_metadata, act_metadata)
@mock.patch.object(rest.PowerMaxRest, '_get_private_volume',
return_value=tpd.PowerMaxData.priv_vol_response_no_rep)
@mock.patch.object(rest.PowerMaxRest, 'get_array_model_info',

View File

@ -5394,6 +5394,9 @@ class PowerMaxCommon(object):
'RDFG-Label': rdfg_info['label'],
'R1-RDFG': rdf_session['SRDFGroupNumber'],
'R2-RDFG': rdf_session['SRDFRemoteGroupNumber']})
if metadata.get('ReplicationMode') == utils.RDF_ACTIVE.title():
metadata['ReplicationMode'] = utils.REP_METRO
else:
metadata['ReplicationEnabled'] = 'False'