@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'find_storageSystem',
- return_value=None)
- @mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'is_tiering_policy_enabled',
+ 'isArrayV3',
return_value=False)
- @mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_pool_capacities',
- return_value=(1234, 1200))
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'parse_array_name_from_file',
return_value="123456789")
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'isArrayV3',
+ 'get_pool_capacities',
+ return_value=(1234, 1200))
+ @mock.patch.object(
+ emc_vmax_fast.EMCVMAXFast,
+ 'is_tiering_policy_enabled',
return_value=False)
+ @mock.patch.object(
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_storageSystem',
+ return_value=None)
def test_get_volume_stats_no_fast(self,
mock_storage_system,
mock_is_fast_enabled,
mock_is_v3):
self.driver.get_volume_stats(True)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_create_volume_no_fast_success(
self, _mock_volume_type, mock_storage_system):
self.driver.create_volume(self.data.test_volume_v2)
+ @mock.patch.object(
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'storagetype: stripedmetacount': '4',
'volume_backend_name': 'ISCSINoFAST'})
- @mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
def test_create_volume_no_fast_striped_success(
self, _mock_volume_type, mock_storage_system):
self.driver.create_volume(self.data.test_volume_v2)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
- def test_create_volume_in_CG_no_fast_success(
- self, _mock_volume_type, mock_storage_system):
- self.driver.create_volume(self.data.test_volume_CG)
-
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'ISCSINoFAST'})
+ def test_create_volume_in_CG_no_fast_success(
+ self, _mock_volume_type, mock_storage_system):
+ self.driver.create_volume(self.data.test_volume_CG)
+
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_delete_volume_no_fast_success(
self, _mock_volume_type, mock_storage_system):
self.driver.delete_volume(self.data.test_volume)
self.driver.delete_volume(notfound_delete_vol)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_delete_volume_failed(
self, _mock_volume_type, mock_storage_system):
self.driver.create_volume(self.data.failed_delete_vol)
self.data.failed_delete_vol)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
- @mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
+ emc_vmax_common.EMCVMAXCommon,
+ '_is_same_host',
+ return_value=True)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'find_device_number',
return_value={'hostlunid': 1,
'storagesystem': EMCVMAXCommonData.storage_system})
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_is_same_host',
- return_value=True)
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_already_mapped_no_fast_success(
self, _mock_volume_type, mock_wrap_group, mock_wrap_device,
mock_is_same_host):
self.driver.initialize_connection(self.data.test_volume,
self.data.connector)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
+ '_check_adding_volume_to_storage_group',
return_value=None)
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
return_value='value')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- '_check_adding_volume_to_storage_group',
+ '_wrap_get_storage_group_from_volume',
return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_map_new_masking_view_no_fast_success(
self, _mock_volume_type, mock_wrap_group,
mock_storage_group, mock_add_volume):
self.driver.initialize_connection(self.data.test_volume,
self.data.connector)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
- @mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_find_masking_view',
+ '_get_initiator_group_from_masking_view',
return_value='value')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
return_value='value')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- '_get_initiator_group_from_masking_view',
+ '_find_masking_view',
return_value='value')
+ @mock.patch.object(
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_map_existing_masking_view_no_fast_success(
self, _mock_volume_type, mock_wrap_group, mock_storage_group,
mock_initiator_group, mock_ig_from_mv):
self.driver.initialize_connection(self.data.test_volume,
self.data.connector)
- @mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'find_device_number',
return_value={'storagesystem': EMCVMAXCommonData.storage_system})
+ @mock.patch.object(
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
def test_map_no_fast_failed(self, mock_wrap_group, mock_wrap_device):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.initialize_connection,
self.data.test_volume,
self.data.connector)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
- @mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_storage_masking_group',
- return_value=EMCVMAXCommonData.storagegroupname)
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- '_find_initiator_masking_group',
+ 'get_initiator_group_from_masking_view',
return_value='myInitGroup')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- 'get_initiator_group_from_masking_view',
+ '_find_initiator_masking_group',
return_value='myInitGroup')
+ @mock.patch.object(
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_storage_masking_group',
+ return_value=EMCVMAXCommonData.storagegroupname)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_detach_no_fast_success(
self, mock_volume_type, mock_storage_group,
mock_ig, mock_igc):
self.driver.terminate_connection(
self.data.test_volume, self.data.connector)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_size',
return_value='2147483648')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_extend_volume_no_fast_success(
self, _mock_volume_type, mock_volume_size):
newSize = '2'
self.driver.extend_volume(self.data.test_volume, newSize)
+ @mock.patch.object(
+ emc_vmax_utils.EMCVMAXUtils,
+ 'check_if_volume_is_extendable',
+ return_value='False')
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'storagetype: stripedmetacount': '4',
'volume_backend_name': 'ISCSINoFAST'})
- @mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'check_if_volume_is_extendable',
- return_value='False')
def test_extend_volume_striped_no_fast_failed(
self, _mock_volume_type, _mock_is_extendable):
newSize = '2'
newSize)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
+ emc_vmax_utils.EMCVMAXUtils,
+ 'get_meta_members_capacity_in_bit',
+ return_value=[1234567, 7654321])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_meta_head',
return_value=[EMCVMAXCommonData.test_volume])
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_meta_members_capacity_in_bit',
- return_value=[1234567, 7654321])
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_create_snapshot_different_sizes_meta_no_fast_success(
self, mock_volume_type, mock_volume,
mock_meta, mock_size, mock_pool):
self.driver.create_snapshot,
self.data.test_volume)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'find_sync_sv_by_target',
- return_value=(None, None))
+ 'get_meta_members_capacity_in_bit',
+ return_value=[1234567])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_meta_head',
return_value=[EMCVMAXCommonData.test_volume])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'get_meta_members_capacity_in_bit',
- return_value=[1234567])
+ 'find_sync_sv_by_target',
+ return_value=(None, None))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_create_volume_from_same_size_meta_snapshot(
self, mock_volume_type, mock_sync_sv, mock_meta, mock_size):
self.data.test_volume['volume_name'] = "vmax-1234567"
self.data.test_volume)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
- @mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
+ emc_vmax_utils.EMCVMAXUtils,
+ 'get_volume_meta_head',
+ return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_find_storage_sync_sv_sv',
return_value=(None, None))
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_volume_meta_head',
- return_value=None)
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_create_clone_simple_volume_no_fast_success(
self, mock_volume_type, mock_volume, mock_sync_sv,
mock_simple_volume):
self.driver.migrate_volume(self.data.test_ctxt, self.data.test_volume,
self.data.test_host)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'parse_pool_instance_id',
return_value=('silver', 'SYMMETRIX+000195900551'))
- def test_retype_volume_no_fast_success(self, _mock_volume_type,
- mock_values):
- self.driver.retype(
- self.data.test_ctxt, self.data.test_volume, self.data.new_type,
- self.data.diff, self.data.test_host)
-
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'ISCSINoFAST'})
+ def test_retype_volume_no_fast_success(
+ self, _mock_volume_type, mock_values):
+ self.driver.retype(
+ self.data.test_ctxt, self.data.test_volume, self.data.new_type,
+ self.data.diff, self.data.test_host)
+
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_create_CG_no_fast_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.create_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=None)
@mock.patch.object(
FakeDB,
'volume_get_all_by_group',
return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=None)
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_delete_CG_no_volumes_no_fast_success(
self, _mock_volume_type, _mock_storage_system,
_mock_db_volumes, _mock_members):
self.driver.delete_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
- def test_delete_CG_with_volumes_no_fast_success(
- self, _mock_volume_type, _mock_storage_system):
- self.driver.delete_consistencygroup(
- self.data.test_ctxt, self.data.test_CG)
-
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'ISCSINoFAST'})
+ def test_delete_CG_with_volumes_no_fast_success(
+ self, _mock_volume_type, _mock_storage_system):
+ self.driver.delete_consistencygroup(
+ self.data.test_ctxt, self.data.test_CG)
+
+ @mock.patch.object(
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_group_sync_rg_by_target',
+ return_value="")
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=())
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_find_consistency_group',
return_value=(None, EMCVMAXCommonData.test_CG))
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=())
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_group_sync_rg_by_target',
- return_value="")
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_create_snapshot_for_CG_no_fast_success(
self, _mock_volume_type, _mock_storage, _mock_cg, _mock_members,
_mock_rg):
self.driver.create_cgsnapshot(
self.data.test_ctxt, self.data.test_CG_snapshot)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSINoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSINoFAST'})
def test_delete_snapshot_for_CG_no_fast_success(
self, _mock_volume_type, _mock_storage):
self.driver.delete_cgsnapshot(
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'find_storageSystem',
- return_value=None)
+ 'parse_array_name_from_file',
+ return_value="123456789")
@mock.patch.object(
emc_vmax_fast.EMCVMAXFast,
- 'is_tiering_policy_enabled',
- return_value=True)
+ 'get_capacities_associated_to_policy',
+ return_value=(1234, 1200))
@mock.patch.object(
emc_vmax_fast.EMCVMAXFast,
'get_tier_policy_by_name',
return_value=None)
@mock.patch.object(
emc_vmax_fast.EMCVMAXFast,
- 'get_capacities_associated_to_policy',
- return_value=(1234, 1200))
+ 'is_tiering_policy_enabled',
+ return_value=True)
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'parse_array_name_from_file',
- return_value="123456789")
+ 'find_storageSystem',
+ return_value=None)
def test_get_volume_stats_fast(self,
mock_storage_system,
mock_is_fast_enabled,
self.driver.get_volume_stats(True)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_create_volume_fast_success(
self, _mock_volume_type, mock_storage_system, mock_pool_policy):
self.driver.create_volume(self.data.test_volume_v2)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'storagetype: stripedmetacount': '4',
- 'volume_backend_name': 'ISCSIFAST'})
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'storagetype: stripedmetacount': '4',
+ 'volume_backend_name': 'ISCSIFAST'})
def test_create_volume_fast_striped_success(
self, _mock_volume_type, mock_storage_system, mock_pool_policy):
self.driver.create_volume(self.data.test_volume_v2)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_create_volume_in_CG_fast_success(
self, _mock_volume_type, mock_storage_system, mock_pool_policy):
self.driver.create_volume(self.data.test_volume_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'_wrap_get_storage_group_from_volume',
return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_delete_volume_fast_success(
self, _mock_volume_type, mock_storage_group):
self.driver.delete_volume(self.data.test_volume)
self.driver.create_volume,
self.data.test_failed_volume)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'_wrap_get_storage_group_from_volume',
return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_delete_volume_fast_notfound(
self, _mock_volume_type, mock_wrapper):
notfound_delete_vol = {}
self.driver.delete_volume(notfound_delete_vol)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
- @mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_delete_volume_fast_failed(
self, _mock_volume_type, _mock_storage_group,
mock_storage_system, mock_policy_pool):
self.data.failed_delete_vol)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
- @mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
+ emc_vmax_common.EMCVMAXCommon,
+ '_is_same_host',
+ return_value=True)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'find_device_number',
return_value={'hostlunid': 1,
'storagesystem': EMCVMAXCommonData.storage_system})
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_is_same_host',
- return_value=True)
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_already_mapped_fast_success(
self, _mock_volume_type, mock_wrap_group, mock_wrap_device,
mock_is_same_host):
self.driver.initialize_connection(self.data.test_volume,
self.data.connector)
- @mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'find_device_number',
return_value={'storagesystem': EMCVMAXCommonData.storage_system})
+ @mock.patch.object(
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
def test_map_fast_failed(self, mock_wrap_group, mock_wrap_device):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.initialize_connection,
self.data.test_volume,
self.data.connector)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
- @mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_storage_masking_group',
- return_value=EMCVMAXCommonData.storagegroupname)
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- '_find_initiator_masking_group',
+ 'get_initiator_group_from_masking_view',
return_value='myInitGroup')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- 'get_initiator_group_from_masking_view',
+ '_find_initiator_masking_group',
return_value='myInitGroup')
+ @mock.patch.object(
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_storage_masking_group',
+ return_value=EMCVMAXCommonData.storagegroupname)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_detach_fast_success(
self, mock_volume_type, mock_storage_group,
mock_ig, mock_igc):
self.driver.terminate_connection(
self.data.test_volume, self.data.connector)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_size',
return_value='2147483648')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_extend_volume_fast_success(
self, _mock_volume_type, mock_volume_size):
newSize = '2'
self.driver.extend_volume(self.data.test_volume, newSize)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'check_if_volume_is_extendable',
return_value='False')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_extend_volume_striped_fast_failed(
self, _mock_volume_type, _mock_is_extendable):
newSize = '2'
self.data.test_volume,
newSize)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
- @mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
@mock.patch.object(
emc_vmax_fast.EMCVMAXFast,
'get_pool_associated_to_policy',
return_value=1)
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_volume_meta_head',
- return_value=[EMCVMAXCommonData.test_volume])
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_meta_members_capacity_in_bit',
return_value=[1234567, 7654321])
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ emc_vmax_utils.EMCVMAXUtils,
+ 'get_volume_meta_head',
+ return_value=[EMCVMAXCommonData.test_volume])
+ @mock.patch.object(
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_create_snapshot_different_sizes_meta_fast_success(
self, mock_volume_type, mock_volume,
mock_meta, mock_size, mock_pool, mock_policy):
self.driver.create_snapshot,
self.data.test_volume)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'find_sync_sv_by_target',
- return_value=(None, None))
+ 'get_meta_members_capacity_in_bit',
+ return_value=[1234567])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_meta_head',
return_value=[EMCVMAXCommonData.test_volume])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'get_meta_members_capacity_in_bit',
- return_value=[1234567])
+ 'find_sync_sv_by_target',
+ return_value=(None, None))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_create_volume_from_same_size_meta_snapshot(
self, mock_volume_type, mock_sync_sv, mock_meta, mock_size):
self.data.test_volume['volume_name'] = "vmax-1234567"
self.data.test_volume, self.data.test_volume)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST',
- 'FASTPOLICY': 'FC_GOLD1'})
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_sync_sv_by_target',
+ return_value=(None, None))
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'find_replication_service',
return_value=None)
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_sync_sv_by_target',
- return_value=(None, None))
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST',
+ 'FASTPOLICY': 'FC_GOLD1'})
def test_create_volume_from_snapshot_fast_failed(
self, mock_volume_type,
mock_rep_service, mock_sync_sv):
EMCVMAXCommonData.test_source_volume)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
- @mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
+ emc_vmax_utils.EMCVMAXUtils,
+ 'get_volume_meta_head',
+ return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_find_storage_sync_sv_sv',
return_value=(None, None))
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_volume_meta_head',
- return_value=None)
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_create_clone_simple_volume_fast_success(
self, mock_volume_type, mock_volume, mock_sync_sv,
mock_simple_volume):
EMCVMAXCommonData.test_source_volume)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
- @mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ emc_vmax_utils.EMCVMAXUtils,
+ 'get_meta_members_capacity_in_bit',
+ return_value=[1234567, 7654321])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_meta_head',
return_value=[EMCVMAXCommonData.test_volume])
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_meta_members_capacity_in_bit',
- return_value=[1234567, 7654321])
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_create_clone_fast_failed(
self, mock_volume_type, mock_vol,
mock_policy, mock_meta, mock_size, mock_pool):
self.data.test_host)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'parse_pool_instance_id',
return_value=('silver', 'SYMMETRIX+000195900551'))
@mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_retype_volume_fast_success(
self, _mock_volume_type, mock_values, mock_wrap):
self.driver.retype(
self.data.test_ctxt, self.data.test_volume, self.data.new_type,
self.data.diff, self.data.test_host)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_create_CG_fast_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.create_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=None)
@mock.patch.object(
FakeDB,
'volume_get_all_by_group',
return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=None)
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_delete_CG_no_volumes_fast_success(
self, _mock_volume_type, _mock_storage_system,
_mock_db_volumes, _mock_members):
self.driver.delete_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_delete_CG_with_volumes_fast_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.delete_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_group_sync_rg_by_target',
+ return_value="")
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=())
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_find_consistency_group',
return_value=(None, EMCVMAXCommonData.test_CG))
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=())
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_group_sync_rg_by_target',
- return_value="")
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_create_snapshot_for_CG_no_fast_success(
self, _mock_volume_type, _mock_storage, _mock_cg, _mock_members,
_mock_rg):
self.driver.create_cgsnapshot(
self.data.test_ctxt, self.data.test_CG_snapshot)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'ISCSIFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'ISCSIFAST'})
def test_delete_snapshot_for_CG_no_fast_success(
self, _mock_volume_type, _mock_storage):
self.driver.delete_cgsnapshot(
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'find_storageSystem',
- return_value=None)
- @mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'is_tiering_policy_enabled',
+ 'isArrayV3',
return_value=False)
- @mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_pool_capacities',
- return_value=(1234, 1200))
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'parse_array_name_from_file',
return_value="123456789")
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'isArrayV3',
+ 'get_pool_capacities',
+ return_value=(1234, 1200))
+ @mock.patch.object(
+ emc_vmax_fast.EMCVMAXFast,
+ 'is_tiering_policy_enabled',
return_value=False)
+ @mock.patch.object(
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_storageSystem',
+ return_value=None)
def test_get_volume_stats_no_fast(self,
mock_storage_system,
mock_is_fast_enabled,
mock_is_v3):
self.driver.get_volume_stats(True)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_create_volume_no_fast_success(
self, _mock_volume_type, mock_storage_system):
self.driver.create_volume(self.data.test_volume_v2)
+ @mock.patch.object(
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'storagetype: stripedmetacount': '4',
'volume_backend_name': 'FCNoFAST'})
- @mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
def test_create_volume_no_fast_striped_success(
self, _mock_volume_type, mock_storage_system):
self.driver.create_volume(self.data.test_volume_v2)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
- def test_create_volume_in_CG_no_fast_success(
- self, _mock_volume_type, mock_storage_system):
- self.driver.create_volume(self.data.test_volume_CG)
-
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'FCNoFAST'})
+ def test_create_volume_in_CG_no_fast_success(
+ self, _mock_volume_type, mock_storage_system):
+ self.driver.create_volume(self.data.test_volume_CG)
+
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_delete_volume_no_fast_success(
self, _mock_volume_type, mock_storage_system):
self.driver.delete_volume(self.data.test_volume)
notfound_delete_vol['provider_location'] = None
self.driver.delete_volume(notfound_delete_vol)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_delete_volume_failed(
self, _mock_volume_type, mock_storage_system):
self.driver.create_volume(self.data.failed_delete_vol)
self.data.failed_delete_vol)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST',
- 'FASTPOLICY': 'FC_GOLD1'})
+ emc_vmax_common.EMCVMAXCommon,
+ '_is_same_host',
+ return_value=True)
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'get_masking_view_from_storage_group',
return_value=EMCVMAXCommonData.lunmaskctrl_name)
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_is_same_host',
- return_value=True)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST',
+ 'FASTPOLICY': 'FC_GOLD1'})
def test_map_lookup_service_no_fast_success(
self, _mock_volume_type, mock_maskingview, mock_is_same_host):
self.data.test_volume['volume_name'] = "vmax-1234567"
for init, target in data['data']['initiator_target_map'].items():
self.assertEqual(init, target[0][::-1])
+ @mock.patch.object(
+ emc_vmax_common.EMCVMAXCommon,
+ 'find_device_number',
+ return_value={'Name': "0001"})
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'FCNoFAST',
'FASTPOLICY': 'FC_GOLD1'})
- @mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- 'find_device_number',
- return_value={'Name': "0001"})
- def test_map_no_fast_failed(self, mock_wrap_group, mock_maskingview):
+ def test_map_no_fast_failed(self, _mock_volume_type, mock_wrap_device):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.initialize_connection,
self.data.test_volume,
self.data.connector)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- 'get_masking_view_by_volume',
- return_value=EMCVMAXCommonData.lunmaskctrl_name)
+ 'get_initiator_group_from_masking_view',
+ return_value='myInitGroup')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'_find_initiator_masking_group',
return_value='myInitGroup')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- 'get_initiator_group_from_masking_view',
- return_value='myInitGroup')
+ 'get_masking_view_by_volume',
+ return_value=EMCVMAXCommonData.lunmaskctrl_name)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_detach_no_fast_last_volume_success(
self, mock_volume_type, mock_mv, mock_ig, mock_igc):
self.driver.terminate_connection(self.data.test_source_volume,
self.data.connector)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_size',
return_value='2147483648')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_extend_volume_no_fast_success(self, _mock_volume_type,
_mock_volume_size):
newSize = '2'
self.driver.extend_volume(self.data.test_volume, newSize)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'check_if_volume_is_extendable',
return_value='False')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_extend_volume_striped_no_fast_failed(
self, _mock_volume_type, _mock_is_extendable):
newSize = '2'
self.driver.migrate_volume(self.data.test_ctxt, self.data.test_volume,
self.data.test_host)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'parse_pool_instance_id',
return_value=('silver', 'SYMMETRIX+000195900551'))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_retype_volume_no_fast_success(
self, _mock_volume_type, mock_values):
self.driver.retype(
self.data.test_ctxt, self.data.test_volume, self.data.new_type,
self.data.diff, self.data.test_host)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_create_CG_no_fast_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.create_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=None)
@mock.patch.object(
FakeDB,
'volume_get_all_by_group',
return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=None)
- def test_delete_CG_no_volumes_no_fast_success(
- self, _mock_volume_type, _mock_storage_system,
- _mock_db_volumes, _mock_members):
- self.driver.delete_consistencygroup(
- self.data.test_ctxt, self.data.test_CG)
-
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'FCNoFAST'})
+ def test_delete_CG_no_volumes_no_fast_success(
+ self, _mock_volume_type, _mock_storage_system,
+ _mock_db_volumes, _mock_members):
+ self.driver.delete_consistencygroup(
+ self.data.test_ctxt, self.data.test_CG)
+
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_delete_CG_with_volumes_no_fast_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.delete_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_group_sync_rg_by_target',
+ return_value="")
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=())
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_find_consistency_group',
return_value=(None, EMCVMAXCommonData.test_CG))
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=())
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_group_sync_rg_by_target',
- return_value="")
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_create_snapshot_for_CG_no_fast_success(
self, _mock_volume_type, _mock_storage, _mock_cg, _mock_members,
_mock_rg):
self.driver.create_cgsnapshot(
self.data.test_ctxt, self.data.test_CG_snapshot)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCNoFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCNoFAST'})
def test_delete_snapshot_for_CG_no_fast_success(
self, _mock_volume_type, _mock_storage):
self.driver.delete_cgsnapshot(
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'find_storageSystem',
- return_value=None)
+ 'parse_array_name_from_file',
+ return_value="123456789")
@mock.patch.object(
emc_vmax_fast.EMCVMAXFast,
- 'is_tiering_policy_enabled',
- return_value=True)
+ 'get_capacities_associated_to_policy',
+ return_value=(1234, 1200))
@mock.patch.object(
emc_vmax_fast.EMCVMAXFast,
'get_tier_policy_by_name',
return_value=None)
@mock.patch.object(
emc_vmax_fast.EMCVMAXFast,
- 'get_capacities_associated_to_policy',
- return_value=(1234, 1200))
+ 'is_tiering_policy_enabled',
+ return_value=True)
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'parse_array_name_from_file',
- return_value="123456789")
+ 'find_storageSystem',
+ return_value=None)
def test_get_volume_stats_fast(self,
mock_storage_system,
mock_is_fast_enabled,
self.driver.get_volume_stats(True)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_create_volume_fast_success(
self, _mock_volume_type, mock_storage_system, mock_pool_policy):
self.driver.create_volume(self.data.test_volume_v2)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'storagetype: stripedmetacount': '4',
- 'volume_backend_name': 'FCFAST'})
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'storagetype: stripedmetacount': '4',
+ 'volume_backend_name': 'FCFAST'})
def test_create_volume_fast_striped_success(
self, _mock_volume_type, mock_storage_system, mock_pool_policy):
self.driver.create_volume(self.data.test_volume_v2)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_create_volume_in_CG_fast_success(
self, _mock_volume_type, mock_storage_system, mock_pool_policy):
self.driver.create_volume(self.data.test_volume_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'_wrap_get_storage_group_from_volume',
return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_delete_volume_fast_success(self, _mock_volume_type,
mock_storage_group):
self.driver.delete_volume(self.data.test_volume)
self.driver.delete_volume(notfound_delete_vol)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
- @mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_delete_volume_fast_failed(
self, _mock_volume_type, mock_wrapper,
mock_storage_system, mock_pool_policy):
self.data.failed_delete_vol)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST',
- 'FASTPOLICY': 'FC_GOLD1'})
+ emc_vmax_common.EMCVMAXCommon,
+ '_is_same_host',
+ return_value=True)
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'get_masking_view_from_storage_group',
return_value=EMCVMAXCommonData.lunmaskctrl_name)
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_is_same_host',
- return_value=True)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST',
+ 'FASTPOLICY': 'FC_GOLD1'})
def test_map_fast_success(self, _mock_volume_type, mock_maskingview,
mock_is_same_host):
common = self.driver.common
for init, target in data['data']['initiator_target_map'].items():
self.assertIn(init[::-1], target)
+ @mock.patch.object(
+ emc_vmax_common.EMCVMAXCommon,
+ 'find_device_number',
+ return_value={'Name': "0001"})
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'FCFAST',
'FASTPOLICY': 'FC_GOLD1'})
- @mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- 'find_device_number',
- return_value={'Name': "0001"})
- def test_map_fast_failed(self, mock_wrap_group, mock_maskingview):
+ def test_map_fast_failed(self, _mock_volume_type, mock_wrap_device):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.initialize_connection,
self.data.test_volume,
self.data.connector)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST',
- 'FASTPOLICY': 'FC_GOLD1'})
+ emc_vmax_common.EMCVMAXCommon,
+ 'get_masking_views_by_port_group',
+ return_value=[])
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- 'get_masking_view_by_volume',
- return_value=EMCVMAXCommonData.lunmaskctrl_name)
+ 'get_initiator_group_from_masking_view',
+ return_value='myInitGroup')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'_find_initiator_masking_group',
return_value='myInitGroup')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- 'get_initiator_group_from_masking_view',
- return_value='myInitGroup')
+ 'get_masking_view_by_volume',
+ return_value=EMCVMAXCommonData.lunmaskctrl_name)
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- 'get_masking_views_by_port_group',
- return_value=[])
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST',
+ 'FASTPOLICY': 'FC_GOLD1'})
def test_detach_fast_success(self, mock_volume_type, mock_maskingview,
mock_ig, mock_igc, mock_mv):
common = self.driver.common
numTargetWwns = len(EMCVMAXCommonData.target_wwns)
self.assertEqual(numTargetWwns, len(data['data']))
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_size',
return_value='2147483648')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_extend_volume_fast_success(self, _mock_volume_type,
_mock_volume_size):
newSize = '2'
self.driver.extend_volume(self.data.test_volume, newSize)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'check_if_volume_is_extendable',
return_value='False')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_extend_volume_striped_fast_failed(self,
_mock_volume_type,
_mock_is_extendable):
self.data.test_volume,
newSize)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
- @mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
@mock.patch.object(
emc_vmax_fast.EMCVMAXFast,
'get_pool_associated_to_policy',
return_value=1)
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_volume_meta_head',
- return_value=[EMCVMAXCommonData.test_volume])
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_meta_members_capacity_in_bit',
return_value=[1234567, 7654321])
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ emc_vmax_utils.EMCVMAXUtils,
+ 'get_volume_meta_head',
+ return_value=[EMCVMAXCommonData.test_volume])
+ @mock.patch.object(
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_create_snapshot_different_sizes_meta_fast_success(
self, mock_volume_type, mock_volume,
mock_meta, mock_size, mock_pool, mock_policy):
self.driver.create_snapshot,
self.data.test_volume)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'find_sync_sv_by_target',
- return_value=(None, None))
+ 'get_meta_members_capacity_in_bit',
+ return_value=[1234567])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_meta_head',
return_value=[EMCVMAXCommonData.test_volume])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'get_meta_members_capacity_in_bit',
- return_value=[1234567])
+ 'find_sync_sv_by_target',
+ return_value=(None, None))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_create_volume_from_same_size_meta_snapshot(
self, mock_volume_type, mock_sync_sv, mock_meta, mock_size):
self.data.test_volume['volume_name'] = "vmax-1234567"
self.data.test_volume, self.data.test_volume)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST',
- 'FASTPOLICY': 'FC_GOLD1'})
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_sync_sv_by_target',
+ return_value=(None, None))
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'find_replication_service',
return_value=None)
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_sync_sv_by_target',
- return_value=(None, None))
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST',
+ 'FASTPOLICY': 'FC_GOLD1'})
def test_create_volume_from_snapshot_fast_failed(
- self, mock_volume_type,
- mock_rep_service, mock_sync_sv):
+ self, mock_volume_type, mock_rep_service, mock_sync_sv):
self.data.test_volume['volume_name'] = "vmax-1234567"
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.create_volume_from_snapshot,
EMCVMAXCommonData.test_source_volume)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
- @mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
+ emc_vmax_utils.EMCVMAXUtils,
+ 'get_volume_meta_head',
+ return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_find_storage_sync_sv_sv',
return_value=(None, None))
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_volume_meta_head',
- return_value=None)
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_create_clone_simple_volume_fast_success(
self, mock_volume_type, mock_volume, mock_sync_sv,
mock_simple_volume):
EMCVMAXCommonData.test_source_volume)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
- @mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_fast.EMCVMAXFast,
- 'get_pool_associated_to_policy',
- return_value=1)
+ emc_vmax_utils.EMCVMAXUtils,
+ 'get_meta_members_capacity_in_bit',
+ return_value=[1234567, 7654321])
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'get_volume_meta_head',
return_value=[EMCVMAXCommonData.test_volume])
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'get_meta_members_capacity_in_bit',
- return_value=[1234567, 7654321])
+ emc_vmax_fast.EMCVMAXFast,
+ 'get_pool_associated_to_policy',
+ return_value=1)
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_create_clone_fast_failed(
self, mock_volume_type, mock_vol, mock_policy,
mock_meta, mock_size, mock_pool):
self.data.test_host)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
+ emc_vmax_masking.EMCVMAXMasking,
+ '_wrap_get_storage_group_from_volume',
+ return_value=None)
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'parse_pool_instance_id',
return_value=('silver', 'SYMMETRIX+000195900551'))
@mock.patch.object(
- emc_vmax_masking.EMCVMAXMasking,
- '_wrap_get_storage_group_from_volume',
- return_value=None)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_retype_volume_fast_success(
self, _mock_volume_type, mock_values, mock_wrap):
self.driver.retype(
self.data.test_ctxt, self.data.test_volume, self.data.new_type,
self.data.diff, self.data.test_host)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_create_CG_fast_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.create_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=None)
@mock.patch.object(
FakeDB,
'volume_get_all_by_group',
return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=None)
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_delete_CG_no_volumes_fast_success(
self, _mock_volume_type, _mock_storage_system,
_mock_db_volumes, _mock_members):
self.driver.delete_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_delete_CG_with_volumes_fast_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.delete_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_group_sync_rg_by_target',
+ return_value="")
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=())
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_find_consistency_group',
return_value=(None, EMCVMAXCommonData.test_CG))
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=())
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_group_sync_rg_by_target',
- return_value="")
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_create_snapshot_for_CG_no_fast_success(
self, _mock_volume_type, _mock_storage, _mock_cg, _mock_members,
_mock_rg):
self.driver.create_cgsnapshot(
- self.data.test_ctxt, self.data.test_CG_snapshot)
-
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'FCFAST'})
+ self.data.test_ctxt, self.data.test_CG_snapshot)
+
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'FCFAST'})
def test_delete_snapshot_for_CG_no_fast_success(
self, _mock_volume_type, _mock_storage):
self.driver.delete_cgsnapshot(
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'find_storageSystem',
- return_value=None)
+ 'isArrayV3',
+ return_value=True)
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'parse_array_name_from_file',
return_value="123456789")
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
- 'isArrayV3',
- return_value=True)
+ 'find_storageSystem',
+ return_value=None)
def test_get_volume_stats_v3(
self, mock_storage_system, mock_array, mock_is_v3):
self.driver.get_volume_stats(True)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
+ emc_vmax_provision_v3.EMCVMAXProvisionV3,
+ '_get_supported_size_range_for_SLO',
+ return_value={'MaximumVolumeSize': '30000000000',
+ 'MinimumVolumeSize': '100000'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_provision_v3.EMCVMAXProvisionV3,
- '_get_supported_size_range_for_SLO',
- return_value={'MaximumVolumeSize': '30000000000',
- 'MinimumVolumeSize': '100000'})
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_create_volume_v3_success(
self, _mock_volume_type, mock_storage_system, mock_range):
self.driver.create_volume(self.data.test_volume_v3)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
- @mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ emc_vmax_utils.EMCVMAXUtils,
+ 'parse_slo_from_file',
+ return_value='NONE')
@mock.patch.object(
emc_vmax_provision_v3.EMCVMAXProvisionV3,
'_get_supported_size_range_for_SLO',
return_value={'MaximumVolumeSize': '30000000000',
'MinimumVolumeSize': '100000'})
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'parse_slo_from_file',
- return_value='NONE')
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_create_volume_v3_no_slo_success(
self, _mock_volume_type, mock_storage_system,
mock_range, mock_slo):
self.driver.create_volume(self.data.test_volume_v3)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
- @mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ emc_vmax_utils.EMCVMAXUtils,
+ 'parse_slo_from_file',
+ return_value='Bogus')
@mock.patch.object(
emc_vmax_provision_v3.EMCVMAXProvisionV3,
'_get_supported_size_range_for_SLO',
return_value={'MaximumVolumeSize': '30000000000',
'MinimumVolumeSize': '100000'})
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'parse_slo_from_file',
- return_value='Bogus')
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_create_volume_v3_invalid_slo_failed(
self, _mock_volume_type, mock_storage_system,
mock_range, mock_slo):
self.data.test_volume)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
+ emc_vmax_provision_v3.EMCVMAXProvisionV3,
+ '_get_supported_size_range_for_SLO',
+ return_value={'MaximumVolumeSize': '30000000000',
+ 'MinimumVolumeSize': '100000'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_provision_v3.EMCVMAXProvisionV3,
- '_get_supported_size_range_for_SLO',
- return_value={'MaximumVolumeSize': '30000000000',
- 'MinimumVolumeSize': '100000'})
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_create_volume_in_CG_v3_success(
- self, _mock_volume_type, mock_storage_system,
- mock_range):
+ self, _mock_volume_type, mock_storage_system, mock_range):
self.driver.create_volume(self.data.test_volume_CG)
@mock.patch.object(
def test_delete_volume_v3_success(self, _mock_volume_type):
self.driver.delete_volume(self.data.test_volume)
- @mock.patch.object(
- FakeDB,
- 'volume_get',
- return_value=EMCVMAXCommonData.test_source_volume)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
- @mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
emc_vmax_provision_v3.EMCVMAXProvisionV3,
'_get_supported_size_range_for_SLO',
return_value={'MaximumVolumeSize': '30000000000',
'MinimumVolumeSize': '100000'})
- def test_create_snapshot_v3_success(
- self, mock_volume_db, mock_type, moke_pool, mock_siz):
- self.data.test_volume['volume_name'] = "vmax-1234567"
- self.driver.create_snapshot(self.data.test_volume)
-
+ @mock.patch.object(
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
FakeDB,
'volume_get',
return_value=EMCVMAXCommonData.test_source_volume)
- def test_delete_snapshot_v3_success(
- self, mock_volume_type, mock_db):
+ def test_create_snapshot_v3_success(
+ self, mock_volume_db, mock_type, moke_pool, mock_siz):
self.data.test_volume['volume_name'] = "vmax-1234567"
- self.driver.delete_snapshot(self.data.test_volume)
+ self.driver.create_snapshot(self.data.test_volume)
@mock.patch.object(
FakeDB,
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'V3_BE'})
- @mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ def test_delete_snapshot_v3_success(self, mock_volume_type, mock_db):
+ self.data.test_volume['volume_name'] = "vmax-1234567"
+ self.driver.delete_snapshot(self.data.test_volume)
+
@mock.patch.object(
emc_vmax_provision_v3.EMCVMAXProvisionV3,
'_get_supported_size_range_for_SLO',
return_value={'MaximumVolumeSize': '30000000000',
'MinimumVolumeSize': '100000'})
+ @mock.patch.object(
+ emc_vmax_common.EMCVMAXCommon,
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
+ @mock.patch.object(
+ FakeDB,
+ 'volume_get',
+ return_value=EMCVMAXCommonData.test_source_volume)
def test_create_cloned_volume_v3_success(
self, mock_volume_db, mock_type, moke_pool, mock_size):
self.data.test_volume['volume_name'] = "vmax-1234567"
self.driver.create_cloned_volume(cloneVol, self.data.test_volume)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_create_CG_v3_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.create_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=None)
@mock.patch.object(
FakeDB,
'volume_get_all_by_group',
return_value=None)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=None)
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_delete_CG_no_volumes_v3_success(
self, _mock_volume_type, _mock_storage_system,
_mock_db_volumes, _mock_members):
self.driver.delete_consistencygroup(
self.data.test_ctxt, self.data.test_CG)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_delete_CG_with_volumes_v3_success(
self, _mock_volume_type, _mock_storage_system):
self.driver.delete_consistencygroup(
self.data.test_host)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
- @mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- '_get_fast_settings_from_storage_group',
- return_value='Gold+DSS_REP')
+ emc_vmax_provision_v3.EMCVMAXProvisionV3,
+ '_find_new_storage_group',
+ return_value='Any')
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'wrap_get_storage_group_from_volume',
return_value=None)
@mock.patch.object(
- emc_vmax_provision_v3.EMCVMAXProvisionV3,
- '_find_new_storage_group',
- return_value='Any')
+ emc_vmax_utils.EMCVMAXUtils,
+ '_get_fast_settings_from_storage_group',
+ return_value='Gold+DSS_REP')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_retype_volume_v3_success(
self, _mock_volume_type, mock_fast_settings,
mock_storage_group, mock_found_SG):
self.data.test_ctxt, self.data.test_volume, self.data.new_type,
self.data.diff, self.data.test_host_v3))
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
@mock.patch.object(
emc_vmax_utils.EMCVMAXUtils,
'_get_fast_settings_from_storage_group',
return_value='Bronze+DSS')
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_retype_volume_same_host_failure(
self, _mock_volume_type, mock_fast_settings):
self.assertFalse(self.driver.retype(
self.data.diff, self.data.test_host_v3))
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
+ emc_vmax_utils.EMCVMAXUtils,
+ 'find_group_sync_rg_by_target',
+ return_value=1)
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_pool_and_storage_system',
- return_value=(None, EMCVMAXCommonData.storage_system))
+ '_get_members_of_replication_group',
+ return_value=())
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_find_consistency_group',
return_value=(None, EMCVMAXCommonData.test_CG))
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
- '_get_members_of_replication_group',
- return_value=())
+ '_get_pool_and_storage_system',
+ return_value=(None, EMCVMAXCommonData.storage_system))
@mock.patch.object(
- emc_vmax_utils.EMCVMAXUtils,
- 'find_group_sync_rg_by_target',
- return_value=1)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_create_cgsnapshot_v3_success(
self, _mock_volume_type, _mock_storage, _mock_cg, _mock_members,
mock_rg):
(None, EMCVMAXCommonData.test_CG), '12de',
EMCVMAXCommonData.extra_specs)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, EMCVMAXCommonData.storage_system))
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_delete_cgsnapshot_v3_success(
self, _mock_volume_type, _mock_storage):
self.driver.delete_cgsnapshot(
self.data.test_ctxt, self.data.test_CG_snapshot)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
+ emc_vmax_common.EMCVMAXCommon,
+ '_is_same_host',
+ return_value=True)
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'get_masking_view_from_storage_group',
return_value=EMCVMAXCommonData.lunmaskctrl_name)
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- '_is_same_host',
- return_value=True)
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_map_v3_success(
self, _mock_volume_type, mock_maskingview, mock_is_same_host):
common = self.driver.common
for init, target in data['data']['initiator_target_map'].items():
self.assertIn(init[::-1], target)
- @mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
@mock.patch.object(
emc_vmax_common.EMCVMAXCommon,
'find_device_number',
return_value={'Name': "0001"})
- def test_map_v3_failed(self, mock_wrap_group, mock_maskingview):
+ @mock.patch.object(
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
+ def test_map_v3_failed(self, _mock_volume_type, mock_wrap_device):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.initialize_connection,
self.data.test_volume,
self.data.connector)
@mock.patch.object(
- volume_types,
- 'get_volume_type_extra_specs',
- return_value={'volume_backend_name': 'V3_BE'})
+ emc_vmax_common.EMCVMAXCommon,
+ 'get_masking_views_by_port_group',
+ return_value=[])
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- 'get_masking_view_from_storage_group',
- return_value=EMCVMAXCommonData.lunmaskctrl_name)
+ 'get_initiator_group_from_masking_view',
+ return_value='myInitGroup')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
'_find_initiator_masking_group',
return_value='myInitGroup')
@mock.patch.object(
emc_vmax_masking.EMCVMAXMasking,
- 'get_initiator_group_from_masking_view',
- return_value='myInitGroup')
+ 'get_masking_view_from_storage_group',
+ return_value=EMCVMAXCommonData.lunmaskctrl_name)
@mock.patch.object(
- emc_vmax_common.EMCVMAXCommon,
- 'get_masking_views_by_port_group',
- return_value=[])
+ volume_types,
+ 'get_volume_type_extra_specs',
+ return_value={'volume_backend_name': 'V3_BE'})
def test_detach_v3_success(self, mock_volume_type, mock_maskingview,
mock_ig, mock_igc, mock_mv):
common = self.driver.common