From 1dde22e41fba6f097b172614db83fd2292185fc1 Mon Sep 17 00:00:00 2001 From: Tom Swanson Date: Tue, 31 Jan 2017 14:31:40 -0600 Subject: [PATCH] Dell EMC: Moved SC driver under dell_emc Moved driver from cinder/cinder/volume/drivers/dell to cinder/cinder/volume/drivers/dell_emc/sc. Removed Dell from the driver names and classes. Test directory moved in a similar manner. Fixed copyright. Change-Id: I0dec53df462dbb6039ddbe96945c0ac334e0adb0 --- cinder/opts.py | 8 +- .../drivers/{dell => dell_emc/sc}/__init__.py | 0 .../test_dellfc.py => dell_emc/sc/test_fc.py} | 170 +- .../test_dellsc.py => dell_emc/sc/test_sc.py} | 627 ++++--- .../sc/test_scapi.py} | 1448 ++++++++--------- .../drivers/{dell => dell_emc/sc}/__init__.py | 0 .../sc/storagecenter_api.py} | 31 +- .../sc/storagecenter_common.py} | 23 +- .../sc/storagecenter_fc.py} | 17 +- .../sc/storagecenter_iscsi.py} | 18 +- cinder/volume/manager.py | 8 + ...r-to-dell_emc-folder-e5d6fb1f1cf84149.yaml | 9 + 12 files changed, 1185 insertions(+), 1174 deletions(-) rename cinder/tests/unit/volume/drivers/{dell => dell_emc/sc}/__init__.py (100%) rename cinder/tests/unit/volume/drivers/{dell/test_dellfc.py => dell_emc/sc/test_fc.py} (87%) rename cinder/tests/unit/volume/drivers/{dell/test_dellsc.py => dell_emc/sc/test_sc.py} (90%) rename cinder/tests/unit/volume/drivers/{dell/test_dellscapi.py => dell_emc/sc/test_scapi.py} (89%) rename cinder/volume/drivers/{dell => dell_emc/sc}/__init__.py (100%) rename cinder/volume/drivers/{dell/dell_storagecenter_api.py => dell_emc/sc/storagecenter_api.py} (99%) rename cinder/volume/drivers/{dell/dell_storagecenter_common.py => dell_emc/sc/storagecenter_common.py} (99%) rename cinder/volume/drivers/{dell/dell_storagecenter_fc.py => dell_emc/sc/storagecenter_fc.py} (96%) rename cinder/volume/drivers/{dell/dell_storagecenter_iscsi.py => dell_emc/sc/storagecenter_iscsi.py} (96%) create mode 100644 releasenotes/notes/Dell-SC-Driver-to-dell_emc-folder-e5d6fb1f1cf84149.yaml diff --git a/cinder/opts.py b/cinder/opts.py index 011bdbb9091..1e44001e608 100644 --- a/cinder/opts.py +++ b/cinder/opts.py @@ -72,10 +72,10 @@ from cinder.volume.drivers.coprhd import scaleio as \ cinder_volume_drivers_coprhd_scaleio from cinder.volume.drivers.datera import datera_iscsi as \ cinder_volume_drivers_datera_dateraiscsi -from cinder.volume.drivers.dell import dell_storagecenter_common as \ - cinder_volume_drivers_dell_dellstoragecentercommon from cinder.volume.drivers.dell_emc import ps as \ cinder_volume_drivers_dell_emc_ps +from cinder.volume.drivers.dell_emc.sc import storagecenter_common as \ + cinder_volume_drivers_dell_emc_sc_storagecentercommon from cinder.volume.drivers.dell_emc.scaleio import driver as \ cinder_volume_drivers_dell_emc_scaleio_driver from cinder.volume.drivers.dell_emc.unity import driver as \ @@ -276,9 +276,9 @@ def list_opts(): cinder_volume_drivers_coprhd_common.volume_opts, cinder_volume_drivers_coprhd_scaleio.scaleio_opts, cinder_volume_drivers_datera_dateraiscsi.d_opts, - cinder_volume_drivers_dell_dellstoragecentercommon. - common_opts, cinder_volume_drivers_dell_emc_ps.eqlx_opts, + cinder_volume_drivers_dell_emc_sc_storagecentercommon. + common_opts, cinder_volume_drivers_dell_emc_scaleio_driver.scaleio_opts, cinder_volume_drivers_dell_emc_unity_driver.UNITY_OPTS, cinder_volume_drivers_dell_emc_vmax_common.emc_opts, diff --git a/cinder/tests/unit/volume/drivers/dell/__init__.py b/cinder/tests/unit/volume/drivers/dell_emc/sc/__init__.py similarity index 100% rename from cinder/tests/unit/volume/drivers/dell/__init__.py rename to cinder/tests/unit/volume/drivers/dell_emc/sc/__init__.py diff --git a/cinder/tests/unit/volume/drivers/dell/test_dellfc.py b/cinder/tests/unit/volume/drivers/dell_emc/sc/test_fc.py similarity index 87% rename from cinder/tests/unit/volume/drivers/dell/test_dellfc.py rename to cinder/tests/unit/volume/drivers/dell_emc/sc/test_fc.py index 7bcd0307901..fd59e0a121f 100644 --- a/cinder/tests/unit/volume/drivers/dell/test_dellfc.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/sc/test_fc.py @@ -18,18 +18,18 @@ from cinder import context from cinder import exception from cinder import test from cinder.tests.unit import fake_constants as fake -from cinder.volume.drivers.dell import dell_storagecenter_api -from cinder.volume.drivers.dell import dell_storagecenter_fc +from cinder.volume.drivers.dell_emc.sc import storagecenter_api +from cinder.volume.drivers.dell_emc.sc import storagecenter_fc # We patch these here as they are used by every test to keep # from trying to contact a Dell Storage Center. -@mock.patch.object(dell_storagecenter_api.HttpClient, +@mock.patch.object(storagecenter_api.HttpClient, '__init__', return_value=None) -@mock.patch.object(dell_storagecenter_api.StorageCenterApi, +@mock.patch.object(storagecenter_api.SCApi, 'open_connection') -@mock.patch.object(dell_storagecenter_api.StorageCenterApi, +@mock.patch.object(storagecenter_api.SCApi, 'close_connection') class DellSCSanFCDriverTestCase(test.TestCase): @@ -145,7 +145,7 @@ class DellSCSanFCDriverTestCase(test.TestCase): self.configuration.dell_sc_api_port = 3033 self._context = context.get_admin_context() - self.driver = dell_storagecenter_fc.DellStorageCenterFCDriver( + self.driver = storagecenter_fc.SCFCDriver( configuration=self.configuration) self.driver.do_setup(None) @@ -172,22 +172,22 @@ class DellSCSanFCDriverTestCase(test.TestCase): 'initiator': 'iqn.1993-08.org.debian:01:e1b1312f9e1', 'wwpns': ['21000024ff30441c', '21000024ff30441d']} - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPING) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(1, [u'5000D31000FCBE3D', @@ -225,25 +225,25 @@ class DellSCSanFCDriverTestCase(test.TestCase): mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None, False) mock_get_volume.assert_called_once_with(self.VOLUME[u'instanceId']) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPING) - @mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, + @mock.patch.object(storagecenter_fc.SCFCDriver, '_is_live_vol') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns') - @mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, + @mock.patch.object(storagecenter_fc.SCFCDriver, 'initialize_secondary') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_live_volume') def test_initialize_connection_live_vol(self, mock_get_live_volume, @@ -293,23 +293,23 @@ class DellSCSanFCDriverTestCase(test.TestCase): mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None, True) mock_get_volume.assert_called_once_with(self.VOLUME[u'instanceId']) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPING) - @mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, + @mock.patch.object(storagecenter_fc.SCFCDriver, '_is_live_vol') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns') - @mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, + @mock.patch.object(storagecenter_fc.SCFCDriver, 'initialize_secondary') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_live_volume') def test_initialize_connection_live_vol_afo(self, mock_get_live_volume, @@ -361,19 +361,19 @@ class DellSCSanFCDriverTestCase(test.TestCase): fake.VOLUME_ID, '101.101', True) mock_get_volume.assert_called_once_with('102.101') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPING) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(None, [], {})) def test_initialize_connection_no_wwns(self, @@ -392,19 +392,19 @@ class DellSCSanFCDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPING) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(None, [], {})) def test_initialize_connection_no_server(self, @@ -423,16 +423,16 @@ class DellSCSanFCDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPING) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(None, [], {})) def test_initialize_connection_vol_not_found(self, @@ -450,16 +450,16 @@ class DellSCSanFCDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(None, [], {})) def test_initialize_connection_map_vol_fail(self, @@ -573,16 +573,16 @@ class DellSCSanFCDriverTestCase(test.TestCase): expected = (None, [], {}) self.assertEqual(expected, ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(1, [u'5000D31000FCBE3D', @@ -591,7 +591,7 @@ class DellSCSanFCDriverTestCase(test.TestCase): [u'5000D31000FCBE35'], u'21000024FF30441D': [u'5000D31000FCBE3D']})) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume_count', return_value=1) def test_terminate_connection(self, @@ -611,16 +611,16 @@ class DellSCSanFCDriverTestCase(test.TestCase): 'data': {}} self.assertEqual(expected, res, 'Unexpected return data') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(1, [u'5000D31000FCBE3D', @@ -629,12 +629,12 @@ class DellSCSanFCDriverTestCase(test.TestCase): [u'5000D31000FCBE35'], u'21000024FF30441D': [u'5000D31000FCBE3D']})) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume_count', return_value=1) - @mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, + @mock.patch.object(storagecenter_fc.SCFCDriver, '_is_live_vol') - @mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, + @mock.patch.object(storagecenter_fc.SCFCDriver, 'terminate_secondary') def test_terminate_connection_live_vol(self, mock_terminate_secondary, @@ -657,16 +657,16 @@ class DellSCSanFCDriverTestCase(test.TestCase): 'data': {}} self.assertEqual(expected, res, 'Unexpected return data') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(1, [u'5000D31000FCBE3D', @@ -675,7 +675,7 @@ class DellSCSanFCDriverTestCase(test.TestCase): [u'5000D31000FCBE35'], u'21000024FF30441D': [u'5000D31000FCBE3D']})) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume_count', return_value=1) def test_terminate_connection_no_server(self, @@ -694,16 +694,16 @@ class DellSCSanFCDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(1, [u'5000D31000FCBE3D', @@ -712,7 +712,7 @@ class DellSCSanFCDriverTestCase(test.TestCase): [u'5000D31000FCBE35'], u'21000024FF30441D': [u'5000D31000FCBE3D']})) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume_count', return_value=1) def test_terminate_connection_no_volume(self, @@ -731,21 +731,21 @@ class DellSCSanFCDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(None, [], {})) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume_count', return_value=1) def test_terminate_connection_no_wwns(self, @@ -764,16 +764,16 @@ class DellSCSanFCDriverTestCase(test.TestCase): 'data': {}} self.assertEqual(expected, res, 'Unexpected return data') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(1, [u'5000D31000FCBE3D', @@ -782,7 +782,7 @@ class DellSCSanFCDriverTestCase(test.TestCase): [u'5000D31000FCBE35'], u'21000024FF30441D': [u'5000D31000FCBE3D']})) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume_count', return_value=1) def test_terminate_connection_failure(self, @@ -801,16 +801,16 @@ class DellSCSanFCDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_wwns', return_value=(1, [u'5000D31000FCBE3D', @@ -819,7 +819,7 @@ class DellSCSanFCDriverTestCase(test.TestCase): [u'5000D31000FCBE35'], u'21000024FF30441D': [u'5000D31000FCBE3D']})) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume_count', return_value=0) def test_terminate_connection_vol_count_zero(self, @@ -863,7 +863,7 @@ class DellSCSanFCDriverTestCase(test.TestCase): expected = (None, [], {}) self.assertEqual(expected, ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_storage_usage', return_value={'availableSpace': 100, 'freeSpace': 50}) def test_update_volume_stats_with_refresh(self, @@ -875,7 +875,7 @@ class DellSCSanFCDriverTestCase(test.TestCase): self.assertEqual('FC', stats['storage_protocol']) mock_get_storage_usage.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_storage_usage', return_value={'availableSpace': 100, 'freeSpace': 50}) def test_get_volume_stats_no_refresh(self, diff --git a/cinder/tests/unit/volume/drivers/dell/test_dellsc.py b/cinder/tests/unit/volume/drivers/dell_emc/sc/test_sc.py similarity index 90% rename from cinder/tests/unit/volume/drivers/dell/test_dellsc.py rename to cinder/tests/unit/volume/drivers/dell_emc/sc/test_sc.py index 28e569dc505..4427dd2d694 100644 --- a/cinder/tests/unit/volume/drivers/dell/test_dellsc.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/sc/test_sc.py @@ -23,23 +23,22 @@ from cinder import test from cinder.tests.unit import fake_constants as fake from cinder.tests.unit import fake_snapshot from cinder.tests.unit import fake_volume -from cinder.volume.drivers.dell import dell_storagecenter_api -from cinder.volume.drivers.dell import dell_storagecenter_iscsi +from cinder.volume.drivers.dell_emc.sc import storagecenter_api +from cinder.volume.drivers.dell_emc.sc import storagecenter_iscsi from cinder.volume import volume_types - # We patch these here as they are used by every test to keep # from trying to contact a Dell Storage Center. MOCKAPI = mock.MagicMock() -@mock.patch.object(dell_storagecenter_api.HttpClient, +@mock.patch.object(storagecenter_api.HttpClient, '__init__', return_value=None) -@mock.patch.object(dell_storagecenter_api.StorageCenterApi, +@mock.patch.object(storagecenter_api.SCApi, 'open_connection', return_value=MOCKAPI) -@mock.patch.object(dell_storagecenter_api.StorageCenterApi, +@mock.patch.object(storagecenter_api.SCApi, 'close_connection') class DellSCSanISCSIDriverTestCase(test.TestCase): @@ -229,7 +228,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.configuration.iscsi_port = 3260 self._context = context.get_admin_context() - self.driver = dell_storagecenter_iscsi.DellStorageCenterISCSIDriver( + self.driver = storagecenter_iscsi.SCISCSIDriver( configuration=self.configuration) self.driver.do_setup(None) @@ -240,7 +239,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'driver_version': '1.0.1', 'total_capacity_gb': 12388, 'reserved_percentage': 0, - 'vendor_name': 'Dell', + 'vendor_name': 'Dell EMC', 'storage_protocol': 'iSCSI'} # Start with none. Add in the specific tests later. @@ -280,7 +279,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.fake_iqn) } - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') def test_check_for_setup_error(self, mock_find_sc, @@ -328,7 +327,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.check_for_setup_error() mock_find_sc.assert_called_once_with() - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_volume_extra_specs') def test__create_replications(self, mock_get_volume_extra_specs, @@ -412,7 +411,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual({}, res) self.driver.backends = backends - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_volume_extra_specs') def test__create_replications_live_volume(self, mock_get_volume_extra_specs, @@ -477,7 +476,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.backends = backends - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_volume_extra_specs') def test__delete_replications(self, mock_get_volume_extra_specs, @@ -507,7 +506,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_api.delete_replication.assert_any_call(scvol, 67890) self.driver.backends = backends - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_volume_extra_specs') def test__delete_live_volume(self, mock_get_volume_extra_specs, @@ -558,7 +557,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.backends = backends - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) def test_create_volume(self, @@ -571,12 +570,12 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_create_volume.assert_called_once_with( fake.VOLUME_ID, 1, None, None, None, None, None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value='fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_cg_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) def test_create_volume_with_group(self, @@ -594,7 +593,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_find_replay_profile.called) self.assertTrue(mock_update_cg_volumes.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) @mock.patch.object( @@ -612,7 +611,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_create_volume.assert_called_once_with( fake.VOLUME_ID, 1, None, None, 'volumeqos', None, None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) @mock.patch.object( @@ -630,7 +629,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_create_volume.assert_called_once_with( fake.VOLUME_ID, 1, None, None, None, 'groupqos', None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) @mock.patch.object( @@ -648,7 +647,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_create_volume.assert_called_once_with( fake.VOLUME_ID, 1, None, None, None, None, 'drprofile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) @mock.patch.object( @@ -666,7 +665,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_create_volume.assert_called_once_with( fake.VOLUME_ID, 1, "HighPriority", None, None, None, None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) @mock.patch.object( @@ -684,10 +683,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_create_volume.assert_called_once_with( fake.VOLUME_ID, 1, None, 'Daily', None, None, None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications', return_value={'replication_status': 'enabled', 'replication_driver_data': 'ssn'}) @@ -703,12 +702,12 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'replication_driver_data': 'ssn', 'provider_id': self.VOLUME[u'instanceId']}, ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') def test_create_volume_replication_raises(self, mock_create_replications, @@ -725,10 +724,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume) self.assertTrue(mock_delete_volume.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_volume_failure(self, mock_delete_volume, @@ -741,12 +740,12 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.create_volume, volume) self.assertTrue(mock_delete_volume.called) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_delete_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume', return_value=True) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs', return_value={'enabled': True, 'live': False}) @@ -768,12 +767,12 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_delete_replications.called) self.assertEqual(2, mock_delete_replications.call_count) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_delete_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume', return_value=True) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs', return_value={'enabled': True, 'live': False}) @@ -789,12 +788,12 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.delete_volume(volume) mock_delete_volume.assert_called_once_with(fake.VOLUME2_ID, None) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_delete_live_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume', return_value=True) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs', return_value={'enabled': True, 'live': True}) @@ -810,12 +809,12 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_delete_volume.assert_called_with(fake.VOLUME_ID, '1.1') self.assertTrue(mock_delete_live_volume.called) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_delete_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume', return_value=False) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs', return_value={'enabled': True, 'live': False}) @@ -832,22 +831,22 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume) self.assertTrue(mock_delete_replications.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS[0]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_iscsi_properties', return_value=ISCSI_PROPERTIES) def test_initialize_connection(self, @@ -874,22 +873,22 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'driver_volume_type': 'iscsi'} self.assertEqual(expected, data, 'Unexpected return value') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS[0]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_iscsi_properties', return_value=ISCSI_PROPERTIES) def test_initialize_connection_multi_path(self, @@ -918,16 +917,16 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'driver_volume_type': 'iscsi'} self.assertEqual(expected, data, 'Unexpected return value') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_iscsi_properties', return_value=None) def test_initialize_connection_no_iqn(self, @@ -946,19 +945,19 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_iscsi_properties', return_value=None) def test_initialize_connection_no_server(self, @@ -977,16 +976,16 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_iscsi_properties', return_value=None) def test_initialize_connection_vol_not_found(self, @@ -1004,19 +1003,19 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_iscsi_properties', return_value=ISCSI_PROPERTIES) def test_initialize_connection_map_vol_fail(self, @@ -1036,27 +1035,27 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS[0]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_iscsi_properties', return_value=ISCSI_PROPERTIES) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_is_live_vol') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'initialize_secondary') def test_initialize_connection_live_volume(self, mock_initialize_secondary, @@ -1096,26 +1095,26 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'driver_volume_type': 'iscsi'} self.assertEqual(expected, ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS[0]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_iscsi_properties') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_live_volume') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_is_live_vol') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'initialize_secondary') def test_initialize_connection_live_volume_afo(self, mock_initialize_secondary, @@ -1165,7 +1164,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual(expected, ret) self.assertFalse(mock_initialize_secondary.called) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs', return_value={'enabled': True, 'live': True}) def test_is_live_vol(self, @@ -1178,7 +1177,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): ret = self.driver._is_live_vol(volume) self.assertTrue(ret) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs', return_value={'enabled': True, 'live': False}) def test_is_live_vol_repl_not_live(self, @@ -1190,7 +1189,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): ret = self.driver._is_live_vol(volume) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs', return_value={'enabled': False, 'live': False}) def test_is_live_vol_no_repl(self, @@ -1326,13 +1325,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_api.unmap_volume.assert_called_once_with(self.VOLUME, self.SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) def test_terminate_connection(self, @@ -1348,20 +1347,20 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_unmap_volume.assert_called_once_with(self.VOLUME, self.SCSERVER) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_is_live_vol') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'terminate_secondary') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_live_volume') def test_terminate_connection_live_volume(self, mock_get_live_vol, @@ -1387,13 +1386,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertIsNone(res, 'None expected') self.assertTrue(mock_terminate_secondary.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) def test_terminate_connection_no_server(self, @@ -1410,13 +1409,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) def test_terminate_connection_no_volume(self, @@ -1433,13 +1432,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, connector) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_server', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=False) def test_terminate_connection_failure(self, @@ -1478,10 +1477,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): return snapshot - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay', return_value='fake') def test_create_snapshot(self, @@ -1497,10 +1496,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): ret = self.driver.create_snapshot(snapshot) self.assertEqual(expected, ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay', return_value=None) def test_create_snapshot_no_volume(self, @@ -1514,10 +1513,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.create_snapshot, snapshot) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay', return_value=None) def test_create_snapshot_failure(self, @@ -1531,17 +1530,17 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.create_snapshot, snapshot) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value='fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_view_volume', return_value=VOLUME) def test_create_volume_from_snapshot(self, @@ -1568,17 +1567,17 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_create_replications.called) self.assertEqual(model_update, res) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_view_volume') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_volume_extra_specs') def test_create_volume_from_snapshot_with_profiles( self, mock_get_volume_extra_specs, mock_create_view_volume, @@ -1610,20 +1609,20 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_create_replications.called) self.assertEqual(model_update, res) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value='fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_view_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'expand_volume', return_value=VOLUME) def test_create_volume_from_snapshot_expand(self, @@ -1652,20 +1651,20 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_expand_volume.assert_called_once_with(self.VOLUME, 2) self.assertEqual(model_update, res) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value='fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_cg_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value='fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_view_volume', return_value=VOLUME) def test_create_volume_from_snapshot_cg(self, @@ -1695,18 +1694,18 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_create_replications.called) self.assertEqual(model_update, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value='fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_view_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_volume_from_snapshot_failed(self, mock_delete_volume, @@ -1727,18 +1726,18 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertFalse(mock_find_replay_profile.called) self.assertTrue(mock_delete_volume.called) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value='fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_view_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_volume_from_snapshot_failed_replication( self, @@ -1760,13 +1759,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, snapshot) self.assertTrue(mock_delete_volume.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_view_volume', return_value=VOLUME) def test_create_volume_from_snapshot_no_replay(self, @@ -1785,13 +1784,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_find_replay.called) self.assertFalse(mock_create_view_volume.called) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications', return_value={}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_cloned_volume', return_value=VOLUME) def test_create_cloned_volume(self, @@ -1810,13 +1809,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_find_volume.called) self.assertEqual({'provider_id': provider_id}, ret) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_cloned_volume') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_volume_extra_specs') def test_create_cloned_volume_with_profiles( self, mock_get_volume_extra_specs, mock_create_cloned_volume, @@ -1841,16 +1840,16 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_find_volume.called) self.assertEqual({'provider_id': provider_id}, ret) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications', return_value={}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_cloned_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'expand_volume', return_value=VOLUME) def test_create_cloned_volume_expand(self, @@ -1871,16 +1870,16 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual({'provider_id': provider_id}, ret) self.assertTrue(mock_expand_volume.called) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications', return_value={}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_cloned_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_cloned_volume_failed(self, mock_delete_volume, @@ -1897,18 +1896,18 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, src_vref) self.assertTrue(mock_delete_volume.called) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications', return_value={}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_cloned_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'expand_volume') def test_create_cloned_volume_expand_failed(self, mock_expand_volume, @@ -1928,14 +1927,14 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, src_vref) self.assertTrue(mock_delete_volume.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_cloned_volume', return_value=VOLUME) def test_create_cloned_volume_replication_fail(self, @@ -1955,15 +1954,15 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, src_vref) self.assertTrue(mock_delete_volume.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value='fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_cg_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_cloned_volume', return_value=VOLUME) def test_create_cloned_volume_consistency_group(self, @@ -1985,10 +1984,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_find_replay_profile.called) self.assertTrue(mock_update_cg_volumes.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_cloned_volume', return_value=VOLUME) def test_create_cloned_volume_no_volume(self, @@ -2005,10 +2004,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertTrue(mock_find_volume.called) self.assertFalse(mock_create_cloned_volume.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_replay', return_value=True) def test_delete_snapshot(self, @@ -2023,10 +2022,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_delete_replay.assert_called_once_with( self.VOLUME, fake.SNAPSHOT_ID) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_replay', return_value=True) def test_delete_snapshot_no_volume(self, @@ -2041,7 +2040,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.delete_snapshot, snapshot) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) def test_ensure_export(self, @@ -2054,7 +2053,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.ensure_export(context, volume) mock_find_volume.assert_called_once_with(fake.VOLUME_ID, 'fake', False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) def test_ensure_export_failed(self, @@ -2069,7 +2068,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): context, volume) mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None, False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) def test_ensure_export_no_volume(self, @@ -2083,10 +2082,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.ensure_export, context, volume) mock_find_volume.assert_called_once_with(fake.VOLUME_ID, 'fake', False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'expand_volume', return_value=VOLUME) def test_extend_volume(self, @@ -2101,10 +2100,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None) mock_expand_volume.assert_called_once_with(self.VOLUME, new_size) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'expand_volume', return_value=None) def test_extend_volume_no_volume(self, @@ -2120,10 +2119,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): volume, new_size) mock_find_volume.assert_called_once_with(fake.VOLUME_ID, 'fake') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'expand_volume', return_value=None) def test_extend_volume_fail(self, @@ -2139,7 +2138,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None) mock_expand_volume.assert_called_once_with(self.VOLUME, new_size) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_storage_usage', return_value={'availableSpace': 100, 'freeSpace': 50}) def test_update_volume_stats_with_refresh(self, @@ -2151,7 +2150,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual('iSCSI', stats['storage_protocol']) self.assertTrue(mock_get_storage_usage.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_storage_usage', return_value={'availableSpace': 100, 'freeSpace': 50}) def test_update_volume_stats_with_refresh_and_repl( @@ -2172,7 +2171,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.backends = backends self.driver.replication_enabled = repliation_enabled - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_storage_usage', return_value={'availableSpace': 100, 'freeSpace': 50}) def test_get_volume_stats_no_refresh(self, @@ -2184,10 +2183,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual('iSCSI', stats['storage_protocol']) self.assertFalse(mock_get_storage_usage.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'rename_volume', return_value=True) def test_update_migrated_volume(self, @@ -2205,10 +2204,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_rename_volume.assert_called_once_with(self.VOLUME, fake.VOLUME_ID) self.assertEqual(model_update, rt) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'rename_volume', return_value=False) def test_update_migrated_volume_rename_fail(self, @@ -2236,7 +2235,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'available') self.assertEqual({'_name_id': fake.VOLUME2_NAME_ID}, rt) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) def test_update_migrated_volume_no_backend_id(self, @@ -2251,7 +2250,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_find_volume.assert_called_once_with(None, None) self.assertEqual({'_name_id': None}, rt) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay_profile', return_value=SCRPLAYPROFILE) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2280,7 +2279,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertRaises(NotImplementedError, self.driver.create_group, context, group) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay_profile', return_value=None) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2297,12 +2296,12 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_create_replay_profile.assert_called_once_with(fake.GROUP_ID) self.assertEqual({'status': 'error'}, model_update) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_replay_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=SCRPLAYPROFILE) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'delete_volume') @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', return_value=True) @@ -2341,12 +2340,12 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertRaises(NotImplementedError, self.driver.delete_group, context, group, [volume]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_replay_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=None) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'delete_volume') @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', return_value=True) @@ -2368,10 +2367,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual(group['status'], model_update['status']) self.assertEqual([], volumes) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_cg_volumes', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=SCRPLAYPROFILE) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2411,7 +2410,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertRaises(NotImplementedError, self.driver.update_group, context, group, add_volumes, remove_volumes) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=None) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2434,10 +2433,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): remove_volumes) mock_find_replay_profile.assert_called_once_with(fake.GROUP_ID) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_cg_volumes', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=SCRPLAYPROFILE) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2464,11 +2463,11 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): add_volumes, remove_volumes) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'update_group') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'create_group') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'create_cloned_volume') @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', return_value=True) @@ -2492,11 +2491,11 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual({'status': 'available'}, model_update) self.assertEqual(expected, volumes_model_update) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'update_group') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'create_group') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'create_volume_from_snapshot') @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', return_value=True) @@ -2547,10 +2546,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): context, group, volumes, None, None, source_group, source_volumes) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'snap_cg_replay', return_value={'instanceId': '100'}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=SCRPLAYPROFILE) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2577,7 +2576,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual('available', model_update['status']) self.assertEqual(expected_snapshots, snapshots) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=None) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2608,10 +2607,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.create_group_snapshot, context, cggrp, []) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'snap_cg_replay', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=SCRPLAYPROFILE) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2633,10 +2632,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual({'status': 'error'}, model_update) self.assertIsNone(snapshot_updates) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_cg_replay', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=SCRPLAYPROFILE) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2661,9 +2660,9 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual([{'id': fake.SNAPSHOT_ID, 'status': 'deleted'}], snapshots) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_cg_replay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=None) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2686,10 +2685,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual({'status': 'error'}, model_update) self.assertIsNone(snapshots) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_cg_replay', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=SCRPLAYPROFILE) @mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', @@ -2719,13 +2718,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.delete_group_snapshot, context, cgsnap, []) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value={'id': 'guid'}) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'manage_existing') def test_manage_existing(self, mock_manage_existing, @@ -2742,13 +2741,13 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_manage_existing.assert_called_once_with(fake.VOLUME_ID, existing_ref) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value={'id': 'guid'}) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'manage_existing') def test_manage_existing_id(self, mock_manage_existing, @@ -2775,7 +2774,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.manage_existing, volume, existing_ref) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_unmanaged_volume_size', return_value=4) def test_manage_existing_get_size(self, @@ -2791,7 +2790,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): # The above is 4GB and change. self.assertEqual(4, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_unmanaged_volume_size', return_value=4) def test_manage_existing_get_size_id(self, @@ -2817,16 +2816,16 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.manage_existing_get_size, volume, existing_ref) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_storage_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_replay_profiles') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_replicate_active_replay') def test_retype_not_our_extra_specs(self, mock_update_replicate_active_replay, @@ -2845,10 +2844,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertFalse(mock_update_replay_profile.called) self.assertFalse(mock_update_storage_profile.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_replay_profiles') def test_retype_replay_profiles(self, mock_update_replay_profiles, @@ -2871,14 +2870,14 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_create_replications', return_value={'replication_status': 'enabled', 'replication_driver_data': '54321'}) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_delete_replications') def test_retype_create_replications(self, mock_delete_replications, @@ -2905,9 +2904,9 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual((True, {'replication_status': 'disabled', 'replication_driver_data': ''}), res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_replicate_active_replay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) def test_retype_active_replay(self, @@ -2939,7 +2938,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) def test_retype_same(self, @@ -2953,10 +2952,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): None) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmanage') def test_unmanage(self, mock_unmanage, @@ -2969,10 +2968,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_find_volume.assert_called_once_with(fake.VOLUME_ID, '11111.1') mock_unmanage.assert_called_once_with(self.VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmanage') def test_unmanage_volume_not_found(self, mock_unmanage, @@ -2985,9 +2984,9 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): mock_find_volume.assert_called_once_with(fake.VOLUME_ID, '11111.1') self.assertFalse(mock_unmanage.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_storage_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) def test_retype(self, @@ -3025,7 +3024,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual(12345, destssn) self.driver.backends = backends - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') def test__parse_secondary_sc_down(self, mock_find_sc, @@ -3107,17 +3106,17 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): '101.100', 102) self.assertEqual(model_update, ret) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_failover_replication') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_parse_secondary') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'remove_mappings') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'failback_volumes') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs') def test_failover_host(self, mock_get_replication_specs, @@ -3225,17 +3224,17 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.failover_host, {}, volumes, '67890') self.driver.replication_enabled = False - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_failover_live_volume') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_parse_secondary') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'remove_mappings') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, 'failback_volumes') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs') def test_failover_host_live_volume(self, mock_get_replication_specs, @@ -3380,9 +3379,9 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): '11111.1', existing_ref) self.assertEqual({'instanceId': '11111.101'}, ret) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_unmanaged_replay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'manage_replay') def test_manage_existing_snapshot(self, mock_manage_replay, @@ -3407,7 +3406,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): snapshot, existing_ref) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_unmanaged_replay') def test_manage_existing_snapshot_get_size(self, mock_get_unmanaged_replay, @@ -3431,11 +3430,11 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): snapshot, existing_ref) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmanage_replay') def test_unmanage_snapshot(self, mock_unmanage_replay, @@ -3460,32 +3459,32 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.unmanage_snapshot(snapshot) mock_unmanage_replay.assert_called_once_with(screplay) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_qos', return_value='cinderqos') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_parse_extraspecs', return_value={'replay_profile_string': 'pro'}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_repl_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_replication') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'replicate_to_common') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'remove_mappings') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_wait_for_replication') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_reattach_remaining_replications') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_fixup_types') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_volume_updates', return_value=[]) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_update_backend') def test_failback_volumes(self, mock_update_backend, @@ -3563,18 +3562,18 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.failed_over = False self.driver.backends = backends - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_qos', return_value='cinderqos') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_update_backend') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_live_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'swap_roles_live_volume') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_replication_specs') def test_failback_volumes_live_vol(self, mock_get_replication_specs, @@ -3634,32 +3633,32 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.failed_over = False self.driver.backends = backends - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_qos', return_value='cinderqos') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_parse_extraspecs', return_value={'replay_profile_string': 'pro'}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_repl_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_replication') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'replicate_to_common') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'remove_mappings') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_wait_for_replication') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_reattach_remaining_replications') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_fixup_types') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_volume_updates', return_value=[]) - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_update_backend') def test_failback_volumes_with_some_not_replicated( self, @@ -3737,10 +3736,10 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.driver.failed_over = False self.driver.backends = backends - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_qos', return_value='cinderqos') - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_update_backend') def test_failback_volumes_with_none_replicated( self, @@ -3832,7 +3831,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'replication_driver_data': '12345'}}) self.assertEqual(expected, ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) def test_fixup_types(self, @@ -3882,7 +3881,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'status': 'available'}] self.assertEqual(expected, items) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) def test_fixup_types_with_error(self, @@ -3933,7 +3932,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): 'status': 'error'}] self.assertEqual(expected, items) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) def test_fixup_types_with_previous_error(self, @@ -4274,7 +4273,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.mock_sleep.assert_has_calls(calls) self.backends = backends - @mock.patch.object(dell_storagecenter_iscsi.DellStorageCenterISCSIDriver, + @mock.patch.object(storagecenter_iscsi.SCISCSIDriver, '_get_volume_extra_specs') def test_parse_extraspecs(self, mock_get_volume_extra_specs, diff --git a/cinder/tests/unit/volume/drivers/dell/test_dellscapi.py b/cinder/tests/unit/volume/drivers/dell_emc/sc/test_scapi.py similarity index 89% rename from cinder/tests/unit/volume/drivers/dell/test_dellscapi.py rename to cinder/tests/unit/volume/drivers/dell_emc/sc/test_scapi.py index 68f638cbdad..0142cf219bd 100644 --- a/cinder/tests/unit/volume/drivers/dell/test_dellscapi.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/sc/test_scapi.py @@ -23,18 +23,18 @@ from cinder import context from cinder import exception from cinder import test from cinder.tests.unit import fake_constants as fake -from cinder.volume.drivers.dell import dell_storagecenter_api +from cinder.volume.drivers.dell_emc.sc import storagecenter_api # We patch these here as they are used by every test to keep # from trying to contact a Dell Storage Center. @ddt.ddt -@mock.patch.object(dell_storagecenter_api.StorageCenterApi, +@mock.patch.object(storagecenter_api.SCApi, '__init__', return_value=None) -@mock.patch.object(dell_storagecenter_api.StorageCenterApi, +@mock.patch.object(storagecenter_api.SCApi, 'open_connection') -@mock.patch.object(dell_storagecenter_api.StorageCenterApi, +@mock.patch.object(storagecenter_api.SCApi, 'close_connection') class DellSCSanAPITestCase(test.TestCase): @@ -1684,8 +1684,8 @@ class DellSCSanAPITestCase(test.TestCase): self._context = context.get_admin_context() self.apiversion = '2.0' - # Set up the StorageCenterApi - self.scapi = dell_storagecenter_api.StorageCenterApi( + # Set up the SCApi + self.scapi = storagecenter_api.SCApi( self.configuration.san_ip, self.configuration.dell_sc_api_port, self.configuration.san_login, @@ -1712,10 +1712,10 @@ class DellSCSanAPITestCase(test.TestCase): expected = [u'folder1', u'folder2', u'folder3'] self.assertEqual(expected, res, 'Unexpected folder path') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_result', return_value=SC) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_sc(self, @@ -1729,10 +1729,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_result.called) self.assertEqual(u'64702', res, 'Unexpected SSN') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_result', return_value=None) def test_find_sc_failure(self, @@ -1744,10 +1744,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertRaises(exception.VolumeBackendAPIException, self.scapi.find_sc) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_folder(self, @@ -1764,10 +1764,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.FLDR, res, 'Unexpected Folder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_folder_with_parent(self, @@ -1784,7 +1784,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.FLDR, res, 'Unexpected Folder') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_create_folder_failure(self, @@ -1797,10 +1797,10 @@ class DellSCSanAPITestCase(test.TestCase): self.configuration.dell_sc_volume_folder) self.assertIsNone(res, 'Test Create folder - None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_path_to_array', return_value=['Cinder_Test_Folder']) def test_create_folder_path(self, @@ -1817,13 +1817,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_folder.called) self.assertEqual(self.FLDR, res, 'Unexpected ScFolder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_create_folder', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_path_to_array', return_value=['Cinder_Test_Folder']) def test_create_folder_path_create_fldr(self, @@ -1843,13 +1843,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_create_folder.called) self.assertEqual(self.FLDR, res, 'Unexpected ScFolder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_create_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_path_to_array', return_value=['Cinder_Test_Folder']) def test_create_folder_path_failure(self, @@ -1870,10 +1870,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_create_folder.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_result', return_value=u'devstackvol/fcvm/') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_folder(self, @@ -1889,10 +1889,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_result.called) self.assertEqual(u'devstackvol/fcvm/', res, 'Unexpected folder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_result', return_value=u'devstackvol/fcvm/') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_folder_multi_fldr(self, @@ -1909,7 +1909,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_result.called) self.assertEqual(u'devstackvol/fcvm/', res, 'Unexpected folder') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_find_folder_failure(self, @@ -1922,7 +1922,7 @@ class DellSCSanAPITestCase(test.TestCase): self.configuration.dell_sc_volume_folder) self.assertIsNone(res, 'Test find folder - None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=None) def test_find_volume_folder_fail(self, @@ -1938,7 +1938,7 @@ class DellSCSanAPITestCase(test.TestCase): self.configuration.dell_sc_volume_folder, -1) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=FLDR) def test_find_volume_folder(self, @@ -1953,10 +1953,10 @@ class DellSCSanAPITestCase(test.TestCase): self.configuration.dell_sc_volume_folder, -1) self.assertEqual(self.FLDR, res, 'Unexpected Folder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=STORAGE_PROFILE_LIST) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_storage_profile_fail(self, @@ -1969,10 +1969,10 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._find_storage_profile("Blah") self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=STORAGE_PROFILE_LIST) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_storage_profile_none(self, @@ -1985,10 +1985,10 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._find_storage_profile(None) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=STORAGE_PROFILE_LIST) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) @ddt.data('HighPriority', 'highpriority', 'High Priority') @@ -2004,10 +2004,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertEqual(self.STORAGE_PROFILE_LIST[1]['instanceId'], res.get('instanceId')) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_create_folder_path', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=None) def test_find_volume_folder_create_folder(self, @@ -2026,19 +2026,19 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_create_folder_path.called) self.assertEqual(self.FLDR, res, 'Unexpected Folder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SCSERVERS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_init_volume(self, @@ -2054,16 +2054,16 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_map_volume.called) self.assertTrue(mock_unmap_volume.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_init_volume_retry(self, @@ -2088,7 +2088,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertEqual(2, mock_map_volume.call_count) self.assertEqual(2, mock_unmap_volume.call_count) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_init_volume_failure(self, @@ -2100,16 +2100,16 @@ class DellSCSanAPITestCase(test.TestCase): self.scapi._init_volume(self.VOLUME) self.assertTrue(mock_post.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'unmap_volume', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'map_volume', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SCSERVERS_DOWN) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_init_volume_servers_down(self, @@ -2125,13 +2125,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_map_volume.called) self.assertFalse(mock_unmap_volume.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_volume(self, @@ -2149,19 +2149,19 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_volume_folder.assert_called_once_with(True) self.assertEqual(self.VOLUME, res, 'Unexpected ScVolume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_storage_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_replay_profiles') def test_create_volume_with_profiles(self, mock_find_replay_profiles, @@ -2201,13 +2201,13 @@ class DellSCSanAPITestCase(test.TestCase): expected_payload, True) self.assertEqual(self.VOLUME, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_storage_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_replay_profiles') def test_create_volume_profile_not_found(self, mock_find_replay_profiles, @@ -2227,10 +2227,10 @@ class DellSCSanAPITestCase(test.TestCase): 'storage_profile', 'replay_profile_string', 'volume_qos', 'group_qos', 'datareductionprofile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_storage_profile', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=FLDR) def test_create_volume_storage_profile_missing(self, @@ -2245,16 +2245,16 @@ class DellSCSanAPITestCase(test.TestCase): 1, 'Blah') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_storage_profile', return_value=STORAGE_PROFILE_LIST[0]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_volume_storage_profile(self, @@ -2273,16 +2273,16 @@ class DellSCSanAPITestCase(test.TestCase): expected = self.STORAGE_PROFILE_LIST[0]['instanceId'] self.assertEqual(expected, actual) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_search_for_volume', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_volume_retry_find(self, @@ -2304,13 +2304,13 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_volume_folder.assert_called_once_with(True) self.assertEqual(self.VOLUME, res, 'Unexpected ScVolume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_vol_folder_fail(self, @@ -2330,13 +2330,13 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_volume_folder.assert_called_once_with(True) self.assertEqual(self.VOLUME, res, 'Unexpected ScVolume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_create_volume_failure(self, @@ -2352,10 +2352,10 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_volume_folder.assert_called_once_with(True) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=VOLUME_LIST) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test__get_volume_list_enforce_vol_fldr(self, @@ -2370,10 +2370,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(self.VOLUME_LIST, res, 'Unexpected volume list') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=VOLUME_LIST) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test__get_volume_list_any_fldr(self, @@ -2396,7 +2396,7 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._get_volume_list(None, None, True) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test__get_volume_list_failure(self, @@ -2409,7 +2409,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_search_for_volume', return_value=VOLUME) def test_find_volume(self, @@ -2422,7 +2422,7 @@ class DellSCSanAPITestCase(test.TestCase): mock_search_for_volume.assert_called_once_with(self.volume_name) self.assertEqual(self.VOLUME, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_search_for_volume', return_value=None) def test_find_volume_not_found(self, @@ -2435,7 +2435,7 @@ class DellSCSanAPITestCase(test.TestCase): mock_search_for_volume.assert_called_once_with(self.volume_name) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=VOLUME) def test_find_volume_with_provider_id(self, @@ -2448,9 +2448,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_get_volume.assert_called_once_with(provider_id) self.assertEqual(self.VOLUME, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_search_for_volume', return_value=VOLUME) def test_find_volume_with_invalid_provider_id(self, @@ -2465,7 +2465,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_get_volume.called) self.assertEqual(self.VOLUME, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume', return_value=None) def test_find_volume_with_provider_id_not_found(self, @@ -2478,9 +2478,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_get_volume.assert_called_once_with(provider_id) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_import_one', return_value=VOLUME) def test_find_volume_with_provider_id_complete_replication( @@ -2501,9 +2501,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_get_volume.assert_called_once_with(provider_id) self.assertEqual(self.VOLUME, res, 'Unexpected volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_import_one', return_value=None) def test_find_volume_with_provider_id_import_fail(self, @@ -2524,7 +2524,7 @@ class DellSCSanAPITestCase(test.TestCase): self.volume_name) mock_get_volume.assert_called_once_with(provider_id) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=None) def test_search_for_volume_no_name(self, @@ -2536,7 +2536,7 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._search_for_volume(None) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list') def test_search_for_volume_not_found(self, mock_get_volume_list, @@ -2548,7 +2548,7 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._search_for_volume(self.volume_name) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=VOLUME_LIST_MULTI_VOLS) def test_search_for_volume_multi_vols_found(self, @@ -2560,10 +2560,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertRaises(exception.VolumeBackendAPIException, self.scapi._search_for_volume, self.volume_name) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=VOLUME) def test_get_volume(self, @@ -2578,7 +2578,7 @@ class DellSCSanAPITestCase(test.TestCase): 'StorageCenter/ScVolume/' + provider_id) self.assertEqual(self.VOLUME, res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_get_volume_error(self, @@ -2600,13 +2600,13 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.get_volume(provider_id) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=True) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) def test_delete_volume(self, @@ -2622,13 +2622,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=True) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) def test_delete_volume_with_provider_id(self, @@ -2645,10 +2645,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_400) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=VOLUME) def test_delete_volume_failure(self, @@ -2663,7 +2663,7 @@ class DellSCSanAPITestCase(test.TestCase): provider_id) mock_find_volume.assert_called_once_with(self.volume_name, provider_id) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=None) def test_delete_volume_no_vol_found(self, @@ -2676,7 +2676,7 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_volume.assert_called_once_with(self.volume_name, None) self.assertTrue(res, 'Expected True') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=SVR_FLDR) def test_find_server_folder(self, @@ -2690,10 +2690,10 @@ class DellSCSanAPITestCase(test.TestCase): self.configuration.dell_sc_server_folder, 12345) self.assertEqual(self.SVR_FLDR, res, 'Unexpected server folder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_create_folder_path', return_value=SVR_FLDR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=None) def test_find_server_folder_create_folder(self, @@ -2711,7 +2711,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_create_folder_path.called) self.assertEqual(self.SVR_FLDR, res, 'Unexpected server folder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_folder', return_value=None) def test_find_server_folder_fail(self, @@ -2727,7 +2727,7 @@ class DellSCSanAPITestCase(test.TestCase): self.configuration.dell_sc_volume_folder, 12345) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_add_hba(self, @@ -2740,7 +2740,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_add_hba_fc(self, @@ -2756,7 +2756,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(res) self.scapi.protocol = saveproto - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_add_hba_failure(self, @@ -2769,10 +2769,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SVR_OS_S) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_serveros(self, @@ -2786,10 +2786,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertEqual('64702.38', res, 'Wrong InstanceId') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SVR_OS_S) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_serveros_not_found(self, @@ -2804,7 +2804,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_find_serveros_failed(self, @@ -2815,13 +2815,13 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._find_serveros('Red Hat Linux 6.x') self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_server_folder', return_value=SVR_FLDR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_hba', return_value=FC_HBA) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_create_server', return_value=SCSERVER) def test_create_server_multiple_hbas(self, @@ -2836,19 +2836,19 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_add_hba.called) self.assertEqual(self.SCSERVER, res, 'Unexpected ScServer') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_hba', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_server_folder', return_value=SVR_FLDR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serveros', return_value='64702.38') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_server(self, @@ -2867,19 +2867,19 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_add_hba.called) self.assertEqual(self.SCSERVER, res, 'Unexpected ScServer') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_hba', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_server_folder', return_value=SVR_FLDR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serveros', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_server_os_not_found(self, @@ -2895,19 +2895,19 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_serveros.called) self.assertEqual(self.SCSERVER, res, 'Unexpected ScServer') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_hba', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_server_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serveros', return_value='64702.38') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_server_fldr_not_found(self, @@ -2923,19 +2923,19 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_server_folder.called) self.assertEqual(self.SCSERVER, res, 'Unexpected ScServer') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_hba', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_server_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serveros', return_value='64702.38') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_create_server_failure(self, @@ -2950,19 +2950,19 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.create_server(self.IQN, 'Red Hat Linux 6.x') self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_hba', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_server_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serveros', return_value='64702.38') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_server_not_found(self, @@ -2978,22 +2978,22 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.create_server(self.IQN, 'Red Hat Linux 6.x') self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_delete_server', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_hba', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_server_folder', return_value=SVR_FLDR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serveros', return_value='64702.38') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_server_addhba_fail(self, @@ -3011,13 +3011,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_delete_server.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=SCSERVER) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serverhba', return_value=ISCSI_HBA) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_server(self, @@ -3032,10 +3032,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertIsNotNone(res, 'Expected ScServer') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serverhba', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_server_no_hba(self, @@ -3050,10 +3050,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_serverhba.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_serverhba', return_value=ISCSI_HBA) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_find_server_failure(self, @@ -3068,10 +3068,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_serverhba.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=ISCSI_HBA) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_serverhba(self, @@ -3085,7 +3085,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertIsNotNone(res, 'Expected ScServerHba') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_find_serverhba_failure(self, @@ -3098,10 +3098,10 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.find_server(self.IQN) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=ISCSI_FLT_DOMAINS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_domains(self, @@ -3116,7 +3116,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertEqual( self.ISCSI_FLT_DOMAINS, res, 'Unexpected ScIscsiFaultDomain') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_204) def test_find_domains_error(self, @@ -3128,10 +3128,10 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._find_domains(u'64702.5764839588723736074.69') self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=FC_HBAS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_initiators(self, @@ -3145,7 +3145,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertIsNotNone(res, 'Expected WWN list') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_find_initiators_error(self, @@ -3157,10 +3157,10 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._find_initiators(self.SCSERVER) self.assertListEqual([], res, 'Expected empty list') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_get_volume_count(self, @@ -3174,7 +3174,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(len(self.MAPPINGS), res, 'Mapping count mismatch') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_get_volume_count_failure(self, @@ -3187,10 +3187,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertEqual(-1, res, 'Mapping count not -1') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_get_volume_count_no_volumes(self, @@ -3204,10 +3204,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(len([]), res, 'Mapping count mismatch') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_mappings(self, @@ -3221,7 +3221,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(self.MAPPINGS, res, 'Mapping mismatch') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_mappings_inactive_vol(self, @@ -3234,7 +3234,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_get.called) self.assertEqual([], res, 'No mappings expected') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_find_mappings_failure(self, @@ -3247,10 +3247,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertEqual([], res, 'Mapping count not empty') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_mappings_no_mappings(self, @@ -3265,10 +3265,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual([], res, 'Mapping count mismatch') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=MAP_PROFILES) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_mapping_profiles(self, @@ -3283,7 +3283,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(self.MAP_PROFILES, res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_find_mapping_profiles_error(self, @@ -3296,10 +3296,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertEqual([], res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_controller_port(self, @@ -3313,7 +3313,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.CTRLR_PORT, res, 'ScControllerPort mismatch') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_204) def test_find_controller_port_failure(self, @@ -3326,13 +3326,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=FC_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=FC_MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_initiators', return_value=WWNS) def test_find_wwns(self, @@ -3357,10 +3357,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertIsNotNone(wwns, 'WWNs is None') self.assertEqual(itmapCompare, itmap, 'WWN mapping incorrect') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=[]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_initiators', return_value=FC_HBAS) def test_find_wwns_no_mappings(self, @@ -3378,13 +3378,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertEqual([], wwns, 'WWNs is not empty') self.assertEqual({}, itmap, 'WWN mapping not empty') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=FC_MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_initiators', return_value=WWNS) def test_find_wwns_no_ctlr_port(self, @@ -3404,13 +3404,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertEqual([], wwns, 'WWNs is not empty') self.assertEqual({}, itmap, 'WWN mapping not empty') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=FC_CTRLR_PORT_WWN_ERROR) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=FC_MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_initiators', return_value=WWNS) def test_find_wwns_wwn_error(self, @@ -3432,13 +3432,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertEqual([], wwns, 'WWNs is not empty') self.assertEqual({}, itmap, 'WWN mapping not empty') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=FC_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=FC_MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_initiators', return_value=WWNS_NO_MATCH) # Test case where HBA name is not found in list of initiators @@ -3459,13 +3459,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertEqual([], wwns, 'WWNs is not empty') self.assertEqual({}, itmap, 'WWN mapping not empty') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=FC_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=FC_MAPPINGS_LUN_MISMATCH) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_initiators', return_value=WWNS) # Test case where FC mappings contain a LUN mismatch @@ -3490,10 +3490,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertIsNotNone(wwns, 'WWNs is None') self.assertEqual(itmapCompare, itmap, 'WWN mapping incorrect') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=VOLUME_CONFIG) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_active_controller(self, @@ -3507,7 +3507,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual('64702.64703', res, 'Unexpected Active Controller') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_find_active_controller_failure(self, @@ -3520,19 +3520,19 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.5764839588723736131.91') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=ISCSI_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_domains', return_value=ISCSI_FLT_DOMAINS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=True) def test_find_iscsi_properties_mappings(self, @@ -3561,7 +3561,7 @@ class DellSCSanAPITestCase(test.TestCase): 'target_portals': [u'192.168.0.21:3260']} self.assertEqual(expected, res, 'Wrong Target Info') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=[]) def test_find_iscsi_properties_no_mapping(self, @@ -3575,19 +3575,19 @@ class DellSCSanAPITestCase(test.TestCase): self.VOLUME) self.assertTrue(mock_find_mappings.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.64702') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=ISCSI_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_domains', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=True) def test_find_iscsi_properties_no_domain(self, @@ -3609,16 +3609,16 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_controller.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.64702') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=True) def test_find_iscsi_properties_no_ctrl_port(self, @@ -3638,19 +3638,19 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_ctrl_port.called) self.assertTrue(mock_find_active_controller.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.64702') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=ISCSI_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_domains', return_value=ISCSI_FLT_DOMAINS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS_READ_ONLY) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=True) def test_find_iscsi_properties_ro(self, @@ -3680,18 +3680,18 @@ class DellSCSanAPITestCase(test.TestCase): 'target_portals': [u'192.168.0.21:3260']} self.assertEqual(expected, res, 'Wrong Target Info') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.64702') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_domains', return_value=ISCSI_FLT_DOMAINS_MULTI_PORTALS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS_MULTI_PORTAL) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=True) def test_find_iscsi_properties_multi_portals(self, @@ -3730,18 +3730,18 @@ class DellSCSanAPITestCase(test.TestCase): u'192.168.0.21:3260']} self.assertEqual(expected, res, 'Wrong Target Info') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.64702') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_domains', return_value=ISCSI_FLT_DOMAINS_MULTI_PORTALS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS_MULTI_PORTAL) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=True) def test_find_iscsi_properties_multi_portals_duplicates( @@ -3776,19 +3776,19 @@ class DellSCSanAPITestCase(test.TestCase): u'192.168.0.21:3260']} self.assertEqual(expected, res, 'Wrong Target Info') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.5764839588723736131.91') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=ISCSI_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port_iscsi_config', return_value=ISCSI_CONFIG) def test_find_iscsi_properties_mappings_legacy( @@ -3818,19 +3818,19 @@ class DellSCSanAPITestCase(test.TestCase): 'target_portals': [u'192.168.0.21:3260']} self.assertEqual(expected, res, 'Wrong Target Info') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.5764839588723736131.91') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=ISCSI_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port_iscsi_config', return_value=None) def test_find_iscsi_properties_mappings_legacy_no_iscsi_config( @@ -3852,19 +3852,19 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_controller_port_iscsi_config.called) self.assertTrue(mock_find_active_controller.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.64702') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port', return_value=ISCSI_CTRLR_PORT) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS_READ_ONLY) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port_iscsi_config', return_value=ISCSI_CONFIG) def test_find_iscsi_properties_ro_legacy(self, @@ -3894,18 +3894,18 @@ class DellSCSanAPITestCase(test.TestCase): 'target_portals': [u'192.168.0.21:3260']} self.assertEqual(expected, res, 'Wrong Target Info') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_active_controller', return_value='64702.64702') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=MAPPINGS_MULTI_PORTAL) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_is_virtualport_mode', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_controller_port_iscsi_config', return_value=ISCSI_CONFIG) def test_find_iscsi_properties_multi_portals_legacy( @@ -3943,13 +3943,13 @@ class DellSCSanAPITestCase(test.TestCase): u'192.168.0.21:3260']} self.assertEqual(expected, res, 'Wrong Target Info') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=MAP_PROFILE) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=[]) def test_map_volume(self, @@ -3966,13 +3966,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.MAP_PROFILE, res, 'Incorrect ScMappingProfile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=MAP_PROFILE) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=MAP_PROFILES) def test_map_volume_existing_mapping(self, @@ -3989,13 +3989,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_first_result.called) self.assertEqual(self.MAP_PROFILE, res, 'Incorrect ScMappingProfile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=MAP_PROFILE) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=[]) def test_map_volume_existing_mapping_not_us(self, @@ -4013,11 +4013,11 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.MAP_PROFILE, res, 'Incorrect ScMappingProfile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test_map_volume_no_vol_id(self, mock_post, @@ -4034,11 +4034,11 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_first_result.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test_map_volume_no_server_id(self, mock_post, @@ -4055,10 +4055,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_first_result.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=[]) def test_map_volume_failure(self, @@ -4074,13 +4074,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=MAP_PROFILES) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value={'result': True}) def test_unmap_volume(self, @@ -4096,10 +4096,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_delete.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=MAP_PROFILES) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_204) def test_unmap_volume_failure(self, @@ -4114,7 +4114,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_delete.called) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=[]) def test_unmap_volume_no_map_profile(self, @@ -4127,10 +4127,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_mapping_profiles.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_204) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=MAP_PROFILES) def test_unmap_volume_del_fail(self, @@ -4145,12 +4145,12 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_delete.called) self.assertFalse(res, False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=MAP_PROFILES) def test_unmap_volume_no_vol_id(self, @@ -4168,12 +4168,12 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_delete.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mapping_profiles', return_value=MAP_PROFILES) def test_unmap_volume_no_server_id(self, @@ -4191,10 +4191,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_delete.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[{'a': 1}, {'a': 2}]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_controller_port_iscsi_config(self, @@ -4210,7 +4210,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual({'a': 1}, res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_find_controller_port_iscsi_config_err(self, @@ -4222,10 +4222,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=STRG_USAGE) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_get_storage_usage(self, @@ -4239,7 +4239,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(self.STRG_USAGE, res, 'Unexpected ScStorageUsage') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_204) def test_get_storage_usage_no_ssn(self, @@ -4254,7 +4254,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_get.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_204) # Test case where get of Storage Usage fails @@ -4267,10 +4267,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertIsNone(res, 'None expected') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=RPLAY) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_create_replay(self, @@ -4286,14 +4286,14 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.RPLAY, res, 'Unexpected ScReplay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=RPLAY) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_init_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_create_replay_inact_vol(self, @@ -4314,9 +4314,9 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.RPLAY, res, 'Unexpected ScReplay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_init_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_volume') def test_create_replay_inact_vol_init_fail( self, mock_get_volume, mock_init_volume, mock_close_connection, @@ -4328,10 +4328,10 @@ class DellSCSanAPITestCase(test.TestCase): self.INACTIVE_VOLUME, 'Test Replay', 60) mock_init_volume.assert_called_once_with(self.INACTIVE_VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=RPLAY) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_create_replay_no_expire(self, @@ -4347,7 +4347,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.RPLAY, res, 'Unexpected ScReplay') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_create_replay_no_volume(self, @@ -4361,7 +4361,7 @@ class DellSCSanAPITestCase(test.TestCase): 60) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_create_replay_failure(self, @@ -4376,10 +4376,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=RPLAYS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_replay(self, @@ -4394,10 +4394,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(self.TST_RPLAY, res, 'Unexpected ScReplay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_replay_no_replays(self, @@ -4413,10 +4413,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_204) def test_find_replay_failure(self, @@ -4432,10 +4432,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value=RPLAYS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_delete_replay(self, @@ -4451,10 +4451,10 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_replay.assert_called_once_with(self.VOLUME, replayId) self.assertTrue(res, 'Expected True') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_delete_replay_no_replay(self, @@ -4471,10 +4471,10 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_replay.assert_called_once_with(self.VOLUME, replayId) self.assertTrue(res, 'Expected True') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay', return_value=TST_RPLAY) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_delete_replay_failure(self, @@ -4491,13 +4491,13 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_replay.assert_called_once_with(self.VOLUME, replayId) self.assertFalse(res, 'Expected False') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_create_view_volume(self, @@ -4515,13 +4515,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.VOLUME, res, 'Unexpected ScVolume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_create_view_volume_create_fldr(self, @@ -4540,13 +4540,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.VOLUME, res, 'Unexpected ScVolume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_create_view_volume_no_vol_fldr(self, @@ -4565,10 +4565,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.VOLUME, res, 'Unexpected ScVolume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder', return_value=FLDR) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_create_view_volume_failure(self, @@ -4585,17 +4585,17 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_volume_folder.assert_called_once_with(True) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_replay_profiles') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_datareduction_profile') def test_create_view_volume_with_profiles( self, mock_update_datareduction_profile, mock_find_replay_profiles, @@ -4626,17 +4626,17 @@ class DellSCSanAPITestCase(test.TestCase): {'name': 'name'}, 'datareductionprofile') self.assertEqual({'name': 'name'}, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_replay_profiles') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'update_datareduction_profile') def test_create_view_volume_with_profiles_no_dr( self, mock_update_datareduction_profile, mock_find_replay_profiles, @@ -4668,13 +4668,13 @@ class DellSCSanAPITestCase(test.TestCase): mock_update_datareduction_profile.assert_not_called() self.assertEqual({'name': 'name'}, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') def test_create_view_volume_with_profiles_no_replayprofiles( self, mock_find_qos_profile, mock_post, mock_find_volume_folder, @@ -4702,11 +4702,11 @@ class DellSCSanAPITestCase(test.TestCase): True) self.assertEqual({'name': 'name'}, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_replay_profiles') def test_create_view_volume_with_profiles_not_found( self, mock_find_replay_profiles, mock_find_qos_profile, @@ -4722,11 +4722,11 @@ class DellSCSanAPITestCase(test.TestCase): 'name', screplay, 'replay_profile_string', 'volume_qos', 'group_qos', 'datareductionprofile') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') def test__expire_all_replays(self, mock_get_json, @@ -4747,9 +4747,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_post.assert_called_once_with( 'StorageCenter/ScReplay/12345.100/Expire', {}, True) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') def test__expire_all_replays_error(self, mock_get, @@ -4764,11 +4764,11 @@ class DellSCSanAPITestCase(test.TestCase): 'StorageCenter/ScVolume/12345.1/ReplayList') self.assertFalse(mock_post.called) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') def test__expire_all_replays_no_replays(self, mock_get_json, @@ -4785,9 +4785,9 @@ class DellSCSanAPITestCase(test.TestCase): 'StorageCenter/ScVolume/12345.1/ReplayList') self.assertFalse(mock_post.called) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') def test__wait_for_cmm( self, @@ -4812,9 +4812,9 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._wait_for_cmm(cmm, scvolume, replayid) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay') def test__wait_for_cmm_404( self, @@ -4832,9 +4832,9 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._wait_for_cmm(cmm, scvolume, replayid) self.assertTrue(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay') @mock.patch.object(eventlet, 'sleep') def test__wait_for_cmm_timeout( @@ -4855,18 +4855,18 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(ret) self.assertEqual(21, mock_sleep.call_count) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay') @mock.patch.object(uuid, 'uuid4') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_wait_for_cmm') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_expire_all_replays') def test_create_cloned_volume( self, @@ -4926,7 +4926,7 @@ class DellSCSanAPITestCase(test.TestCase): mock_expire_all_replays.assert_called_once_with(newvol) self.assertEqual(newvol, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume') def test_create_cloned_volume_create_vol_fail( self, @@ -4960,12 +4960,12 @@ class DellSCSanAPITestCase(test.TestCase): volume_qos, group_qos, dr_profile) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay') @mock.patch.object(uuid, 'uuid4') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_cloned_volume_replay_fail( self, @@ -5009,14 +5009,14 @@ class DellSCSanAPITestCase(test.TestCase): scvolume, str(replayuuid), 60) mock_delete_volume.assert_called_once_with(vol_name, '12345.2') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay') @mock.patch.object(uuid, 'uuid4') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_cloned_volume_copy_fail( self, @@ -5070,16 +5070,16 @@ class DellSCSanAPITestCase(test.TestCase): 'StorageCenter/ScCopyMirrorMigrate/Copy', expected_payload, True) mock_delete_volume.assert_called_once_with(vol_name, '12345.2') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay') @mock.patch.object(uuid, 'uuid4') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_cloned_volume_cmm_erred( self, @@ -5136,16 +5136,16 @@ class DellSCSanAPITestCase(test.TestCase): 'StorageCenter/ScCopyMirrorMigrate/Copy', expected_payload, True) mock_delete_volume.assert_called_once_with(vol_name, '12345.2') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay') @mock.patch.object(uuid, 'uuid4') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_cloned_volume_cmm_paused( self, @@ -5202,18 +5202,18 @@ class DellSCSanAPITestCase(test.TestCase): 'StorageCenter/ScCopyMirrorMigrate/Copy', expected_payload, True) mock_delete_volume.assert_called_once_with(vol_name, '12345.2') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay') @mock.patch.object(uuid, 'uuid4') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_wait_for_cmm') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_volume') def test_create_cloned_volume_cmm_wait_for_cmm_fail( self, @@ -5273,10 +5273,10 @@ class DellSCSanAPITestCase(test.TestCase): mock_wait_for_cmm.assert_called_once_with(cmm, newvol, str(replayuuid)) mock_delete_volume.assert_called_once_with(vol_name, '12345.2') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=VOLUME) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_expand_volume(self, @@ -5290,7 +5290,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(self.VOLUME, res, 'Unexpected ScVolume') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_expand_volume_failure(self, @@ -5302,7 +5302,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_200) def test_rename_volume(self, @@ -5314,7 +5314,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_put.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_400) def test_rename_volume_failure(self, @@ -5326,7 +5326,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_put.called) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) def test_delete_server(self, @@ -5338,7 +5338,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_delete.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) def test_delete_server_del_not_allowed(self, @@ -5351,10 +5351,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_delete.called) self.assertIsNone(res, 'Expected None') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value={'test': 'test'}) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_get_user_preferences(self, @@ -5368,7 +5368,7 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._get_user_preferences() self.assertEqual({'test': 'test'}, res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_get_user_preferences_failure(self, @@ -5379,7 +5379,7 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi._get_user_preferences() self.assertEqual({}, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences', return_value=None) def test_update_storage_profile_noprefs(self, @@ -5390,7 +5390,7 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_storage_profile(None, None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences', return_value={'allowStorageProfileSelection': False}) def test_update_storage_profile_not_allowed(self, @@ -5398,15 +5398,15 @@ class DellSCSanAPITestCase(test.TestCase): mock_close_connection, mock_open_connection, mock_init): - LOG = self.mock_object(dell_storagecenter_api, "LOG") + LOG = self.mock_object(storagecenter_api, "LOG") res = self.scapi.update_storage_profile(None, None) self.assertFalse(res) self.assertEqual(1, LOG.error.call_count) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_storage_profile', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences', return_value={'allowStorageProfileSelection': True}) def test_update_storage_profile_prefs_not_found(self, @@ -5415,12 +5415,12 @@ class DellSCSanAPITestCase(test.TestCase): mock_close_connection, mock_open_connection, mock_init): - LOG = self.mock_object(dell_storagecenter_api, "LOG") + LOG = self.mock_object(storagecenter_api, "LOG") res = self.scapi.update_storage_profile(None, 'Fake') self.assertFalse(res) self.assertEqual(1, LOG.error.call_count) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences', return_value={'allowStorageProfileSelection': True, 'storageProfile': None}) @@ -5429,18 +5429,18 @@ class DellSCSanAPITestCase(test.TestCase): mock_close_connection, mock_open_connection, mock_init): - LOG = self.mock_object(dell_storagecenter_api, "LOG") + LOG = self.mock_object(storagecenter_api, "LOG") res = self.scapi.update_storage_profile(None, None) self.assertFalse(res) self.assertEqual(1, LOG.error.call_count) @mock.patch.object( - dell_storagecenter_api.StorageCenterApi, + storagecenter_api.SCApi, '_get_user_preferences', return_value={'allowStorageProfileSelection': True, 'storageProfile': {'name': 'Fake', 'instanceId': 'fakeId'}}) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_200) def test_update_storage_profile(self, @@ -5449,17 +5449,17 @@ class DellSCSanAPITestCase(test.TestCase): mock_close_connection, mock_open_connection, mock_init): - LOG = self.mock_object(dell_storagecenter_api, "LOG") + LOG = self.mock_object(storagecenter_api, "LOG") fake_scvolume = {'name': 'name', 'instanceId': 'id'} res = self.scapi.update_storage_profile(fake_scvolume, None) self.assertTrue(res) self.assertIn('fakeId', repr(mock_put.call_args_list[0])) self.assertEqual(1, LOG.info.call_count) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[RPLAY_PROFILE]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_replay_profile(self, @@ -5473,10 +5473,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertEqual(self.RPLAY_PROFILE, res, 'Unexpected Profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[RPLAY_PROFILE, RPLAY_PROFILE]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_replay_profile_more_than_one(self, @@ -5491,10 +5491,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertTrue(mock_get_json.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_find_replay_profile_empty_list(self, @@ -5508,7 +5508,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertIsNone(res, 'Unexpected return') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_find_replay_profile_error(self, @@ -5520,13 +5520,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertIsNone(res, 'Unexpected return') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=None) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=RPLAY_PROFILE) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_201) def test_create_replay_profile(self, @@ -5542,7 +5542,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_first_result.called) self.assertEqual(self.RPLAY_PROFILE, res, 'Unexpected Profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=RPLAY_PROFILE) def test_create_replay_profile_exists(self, @@ -5554,10 +5554,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_replay_profile.called) self.assertEqual(self.RPLAY_PROFILE, res, 'Unexpected Profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_replay_profile', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_create_replay_profile_fail(self, @@ -5571,10 +5571,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_post.called) self.assertIsNone(res, 'Unexpected return') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') def test_delete_replay_profile(self, mock_get_id, @@ -5587,10 +5587,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_id.called) self.assertTrue(mock_delete.called) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_400) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') def test_delete_replay_profile_fail(self, mock_get_id, @@ -5605,13 +5605,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_id.called) self.assertTrue(mock_delete.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_first_result', return_value=VOLUME_CONFIG) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') def test_get_volume_configuration(self, mock_get_id, @@ -5625,10 +5625,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertEqual(self.VOLUME_CONFIG, res, 'Unexpected config') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') def test_get_volume_configuration_bad_response(self, mock_get_id, @@ -5641,13 +5641,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get.called) self.assertIsNone(res, 'Unexpected result') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_configuration', return_value=VOLUME_CONFIG) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') def test_update_volume_profiles(self, mock_get_id, @@ -5686,14 +5686,14 @@ class DellSCSanAPITestCase(test.TestCase): mock_put.assert_called_with(expected_url, expected_payload, True) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_configuration', return_value=VOLUME_CONFIG) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_400) # We set this to 1 so we can check our payload - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id') def test_update_volume_profiles_bad_response(self, mock_get_id, @@ -5732,7 +5732,7 @@ class DellSCSanAPITestCase(test.TestCase): mock_put.assert_called_with(expected_url, expected_payload, True) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_configuration', return_value=None) def test_update_volume_profiles_no_config(self, @@ -5745,10 +5745,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_volume_configuration.called) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=999) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_update_volume_profiles', return_value=True) def test_add_cg_volumes(self, @@ -5766,10 +5766,10 @@ class DellSCSanAPITestCase(test.TestCase): removeid=None) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=999) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_update_volume_profiles', return_value=False) def test_add_cg_volumes_fail(self, @@ -5787,10 +5787,10 @@ class DellSCSanAPITestCase(test.TestCase): removeid=None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=999) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_update_volume_profiles', return_value=True) def test_remove_cg_volumes(self, @@ -5808,10 +5808,10 @@ class DellSCSanAPITestCase(test.TestCase): removeid=profileid) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume', return_value=999) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_update_volume_profiles', return_value=False) def test_remove_cg_volumes_false(self, @@ -5829,13 +5829,13 @@ class DellSCSanAPITestCase(test.TestCase): removeid=profileid) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_remove_cg_volumes', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_cg_volumes', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') def test_update_cg_volumes(self, @@ -5857,13 +5857,13 @@ class DellSCSanAPITestCase(test.TestCase): remove_volumes) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_remove_cg_volumes', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_cg_volumes', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') def test_update_cg_volumes_no_remove(self, @@ -5884,13 +5884,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_remove_cg_volumes.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_remove_cg_volumes', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_cg_volumes', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') def test_update_cg_volumes_no_add(self, @@ -5911,12 +5911,12 @@ class DellSCSanAPITestCase(test.TestCase): self.assertFalse(mock_add_cg_volumes.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_remove_cg_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_cg_volumes', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') def test_update_cg_volumes_add_fail(self, @@ -5937,13 +5937,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(not mock_remove_cg_volumes.called) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_remove_cg_volumes', return_value=False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_add_cg_volumes', return_value=True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') def test_update_cg_volumes_remove_fail(self, @@ -5965,13 +5965,13 @@ class DellSCSanAPITestCase(test.TestCase): remove_volumes) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[INACTIVE_VOLUME]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_init_volume') def test_init_cg_volumes_inactive(self, mock_init_volume, @@ -5986,13 +5986,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) mock_init_volume.assert_called_once_with(self.INACTIVE_VOLUME) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[VOLUME]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_init_volume') def test_init_cg_volumes_active(self, mock_init_volume, @@ -6007,13 +6007,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertFalse(mock_init_volume.called) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_init_cg_volumes') def test_snap_cg_replay(self, mock_init_cg_volumes, @@ -6034,13 +6034,13 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_init_cg_volumes.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_init_cg_volumes') def test_snap_cg_replay_bad_return(self, mock_init_cg_volumes, @@ -6061,10 +6061,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_init_cg_volumes.called) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=CGS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_sc_cg(self, @@ -6078,10 +6078,10 @@ class DellSCSanAPITestCase(test.TestCase): 'GUID1-0869559e-6881-454e-ba18-15c6726d33c1') self.assertEqual(self.CGS[0], res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=CGS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_find_sc_cg_not_found(self, @@ -6095,7 +6095,7 @@ class DellSCSanAPITestCase(test.TestCase): 'GUID3-0869559e-6881-454e-ba18-15c6726d33c1') self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_find_sc_cg_fail(self, @@ -6108,13 +6108,13 @@ class DellSCSanAPITestCase(test.TestCase): 'GUID1-0869559e-6881-454e-ba18-15c6726d33c1') self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_sc_cg', return_value={'instanceId': 101}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=RPLAYS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') def test_find_cg_replays(self, mock_get, @@ -6133,7 +6133,7 @@ class DellSCSanAPITestCase(test.TestCase): # We should fine RPLAYS self.assertEqual(self.RPLAYS, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_sc_cg', return_value=None) def test_find_cg_replays_no_cg(self, @@ -6148,13 +6148,13 @@ class DellSCSanAPITestCase(test.TestCase): # We should return an empty list. self.assertEqual([], res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_sc_cg', return_value={'instanceId': 101}) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=None) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') def test_find_cg_replays_bad_json(self, mock_get, @@ -6172,10 +6172,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_json.called) self.assertIsNone(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_cg_replays', return_value=RPLAYS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_delete_cg_replay(self, @@ -6196,10 +6196,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_cg_replays.called) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_cg_replays', return_value=RPLAYS) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_delete_cg_replay_error(self, @@ -6216,7 +6216,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_cg_replays.called) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_cg_replays', return_value=[]) def test_delete_cg_replay_cant_find(self, @@ -6242,12 +6242,12 @@ class DellSCSanAPITestCase(test.TestCase): self.assertEqual(1, gb) self.assertEqual(100, rem) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_volume_folder') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=VOLUME) def test_import_one(self, @@ -6269,17 +6269,17 @@ class DellSCSanAPITestCase(test.TestCase): expected_payload = {'Name': newname} self.scapi._import_one({'instanceId': '100'}, newname) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[{'configuredSize': '1.073741824E9 Bytes'}]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'size_to_gb', return_value=(1, 0)) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=[]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_import_one', return_value=VOLUME) def test_manage_existing(self, @@ -6298,7 +6298,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_mappings.called) self.assertTrue(mock_size_to_gb.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[]) def test_manage_existing_vol_not_found(self, @@ -6319,7 +6319,7 @@ class DellSCSanAPITestCase(test.TestCase): existing.get('source-id'), False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[{}, {}, {}]) def test_manage_existing_vol_multiple_found(self, @@ -6340,11 +6340,11 @@ class DellSCSanAPITestCase(test.TestCase): existing.get('source-id'), False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[{'configuredSize': '1.073741924E9 Bytes'}]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'size_to_gb', return_value=(1, 100)) def test_manage_existing_bad_size(self, @@ -6367,14 +6367,14 @@ class DellSCSanAPITestCase(test.TestCase): False) self.assertTrue(mock_size_to_gb.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[{'configuredSize': '1.073741824E9 Bytes'}]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'size_to_gb', return_value=(1, 0)) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=[{}, {}]) def test_manage_existing_already_mapped(self, @@ -6398,17 +6398,17 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_mappings.called) self.assertTrue(mock_size_to_gb.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[{'configuredSize': '1.073741824E9 Bytes'}]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'size_to_gb', return_value=(1, 0)) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_mappings', return_value=[]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_import_one', return_value=None) def test_manage_existing_import_fail(self, @@ -6433,11 +6433,11 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_find_mappings.called) self.assertTrue(mock_size_to_gb.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[{'configuredSize': '1.073741824E9 Bytes'}]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'size_to_gb', return_value=(1, 0)) def test_get_unmanaged_volume_size(self, @@ -6455,7 +6455,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_size_to_gb.called) self.assertEqual(1, res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[]) def test_get_unmanaged_volume_size_not_found(self, @@ -6472,7 +6472,7 @@ class DellSCSanAPITestCase(test.TestCase): existing.get('source-id'), False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[{}, {}, {}]) def test_get_unmanaged_volume_size_many_found(self, @@ -6489,11 +6489,11 @@ class DellSCSanAPITestCase(test.TestCase): existing.get('source-id'), False) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_volume_list', return_value=[{'configuredSize': '1.073741924E9 Bytes'}]) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'size_to_gb', return_value=(1, 100)) def test_get_unmanaged_volume_size_bad_size(self, @@ -6512,10 +6512,10 @@ class DellSCSanAPITestCase(test.TestCase): existing.get('source-id'), False) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') def test_unmanage(self, @@ -6533,10 +6533,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_id.called) mock_put.assert_called_once_with(expected_url, expected_payload, True) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_400) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_id', return_value='100') def test_unmanage_fail(self, @@ -6556,10 +6556,10 @@ class DellSCSanAPITestCase(test.TestCase): self.assertTrue(mock_get_id.called) mock_put.assert_called_once_with(expected_url, expected_payload, True) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[SCQOS]) # def _find_qos(self, qosnode): @@ -6572,10 +6572,10 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_qos('Cinder QoS') self.assertDictEqual(self.SCQOS, ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') # def _find_qos(self, qosnode): def test__find_qos_not_found(self, @@ -6590,7 +6590,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_qos('Cinder QoS') self.assertDictEqual(self.SCQOS, ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) # def _find_qos(self, qosnode): @@ -6603,9 +6603,9 @@ class DellSCSanAPITestCase(test.TestCase): self.scapi._find_qos, 'Cinder QoS') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) # def _find_qos(self, qosnode): @@ -6620,13 +6620,13 @@ class DellSCSanAPITestCase(test.TestCase): self.scapi._find_qos, 'Cinder QoS') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_400) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SCREPL) def test_update_replicate_active_replay_fail(self, @@ -6640,10 +6640,10 @@ class DellSCSanAPITestCase(test.TestCase): True) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SCREPL) def test_update_replicate_active_replay_nothing_to_do( @@ -6653,10 +6653,10 @@ class DellSCSanAPITestCase(test.TestCase): False) self.assertTrue(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) def test_update_replicate_active_replay_not_found(self, @@ -6669,10 +6669,10 @@ class DellSCSanAPITestCase(test.TestCase): True) self.assertTrue(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) def test_update_replicate_active_replay_not_found2(self, @@ -6685,10 +6685,10 @@ class DellSCSanAPITestCase(test.TestCase): True) self.assertTrue(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[{'instanceId': '12345.1'}]) def test_get_disk_folder(self, @@ -6707,7 +6707,7 @@ class DellSCSanAPITestCase(test.TestCase): expected_payload) self.assertEqual({'instanceId': '12345.1'}, ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_get_disk_folder_fail(self, @@ -6725,10 +6725,10 @@ class DellSCSanAPITestCase(test.TestCase): expected_payload) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') def test_get_disk_folder_fail_bad_json(self, mock_get_json, @@ -6747,10 +6747,10 @@ class DellSCSanAPITestCase(test.TestCase): expected_payload) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SCREPL) def test_get_screplication(self, @@ -6762,10 +6762,10 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.get_screplication({'instanceId': '1'}, 65495) self.assertDictEqual(self.SCREPL[0], ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) def test_get_screplication_not_found(self, @@ -6777,7 +6777,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.get_screplication({'instanceId': '1'}, 65496) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_get_screplication_error(self, @@ -6788,10 +6788,10 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.get_screplication({'instanceId': '1'}, 65495) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_screplication', return_value=SCREPL[0]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_200) def test_delete_replication(self, @@ -6811,7 +6811,7 @@ class DellSCSanAPITestCase(test.TestCase): async=True) self.assertTrue(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_screplication', return_value=None) def test_delete_replication_not_found(self, @@ -6825,10 +6825,10 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.delete_replication(self.VOLUME, destssn) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_screplication', return_value=SCREPL[0]) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete', return_value=RESPONSE_400) def test_delete_replication_error(self, @@ -6848,15 +6848,15 @@ class DellSCSanAPITestCase(test.TestCase): async=True) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos', return_value=SCQOS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SCREPL[0]) def test_create_replication(self, @@ -6915,14 +6915,14 @@ class DellSCSanAPITestCase(test.TestCase): mock_post.assert_any_call('StorageCenter/ScReplication', payload, True) self.assertDictEqual(self.SCREPL[0], ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos', return_value=SCQOS) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SCREPL[0]) def test_create_replication_error(self, @@ -6974,10 +6974,10 @@ class DellSCSanAPITestCase(test.TestCase): mock_post.assert_any_call('StorageCenter/ScReplication', payload, True) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=SCREPL) def test_find_repl_volume(self, @@ -6989,10 +6989,10 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.find_repl_volume('guid', 65495) self.assertDictEqual(self.SCREPL[0], ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[]) def test_find_repl_volume_empty_list(self, @@ -7004,10 +7004,10 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.find_repl_volume('guid', 65495) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=[{'instanceId': '1'}, {'instanceId': '2'}]) def test_find_repl_volume_multiple_results(self, @@ -7019,7 +7019,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.find_repl_volume('guid', 65495) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_find_repl_volume_error(self, @@ -7030,13 +7030,13 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.find_repl_volume('guid', 65495) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'get_screplication') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_repl_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_volume') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'remove_mappings') def test_break_replication(self, mock_remove_mappings, @@ -7080,7 +7080,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.break_replication('name', None, 65495) self.assertEqual(self.VOLUME, ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') def test__find_user_replay_profiles(self, mock_get_user_preferences, @@ -7100,9 +7100,9 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_user_replay_profiles() self.assertEqual(['a', 'b'], ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') def test__find_daily_replay_profile(self, mock_get_json, @@ -7124,9 +7124,9 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_daily_replay_profile() self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') def test__find_replay_profiles(self, mock_get_json, @@ -7165,13 +7165,13 @@ class DellSCSanAPITestCase(test.TestCase): self.scapi._find_replay_profiles, rps) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_replay_profiles') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_user_replay_profiles') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_daily_replay_profile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_update_volume_profiles') def test_update_replay_profiles(self, mock_update_volume_profiles, @@ -7226,9 +7226,9 @@ class DellSCSanAPITestCase(test.TestCase): scvol, 'a,b') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_sc_live_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_live_volumes') def test_get_live_volume(self, mock_get_live_volumes, @@ -7249,9 +7249,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_sc_live_volumes.assert_called_once_with('12345') self.assertFalse(mock_get_live_volumes.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_sc_live_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_live_volumes') def test_get_live_volume_on_secondary(self, mock_get_live_volumes, @@ -7273,9 +7273,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_sc_live_volumes.assert_called_once_with('12345') mock_get_live_volumes.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_sc_live_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_live_volumes') def test_get_live_volume_not_found(self, mock_get_live_volumes, @@ -7294,9 +7294,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_sc_live_volumes.assert_called_once_with('12345') mock_get_live_volumes.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_sc_live_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_live_volumes') def test_get_live_volume_swapped(self, mock_get_live_volumes, @@ -7315,9 +7315,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_sc_live_volumes.assert_called_once_with('12345') mock_get_live_volumes.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_sc_live_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_live_volumes') def test_get_live_volume_error(self, mock_get_live_volumes, @@ -7330,9 +7330,9 @@ class DellSCSanAPITestCase(test.TestCase): retlv = self.scapi.get_live_volume('12345.2') self.assertIsNone(retlv) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_sc_live_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_live_volumes') def test_get_live_volume_by_name(self, mock_get_live_volumes, @@ -7355,9 +7355,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_sc_live_volumes.assert_called_once_with('12345') mock_get_live_volumes.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_sc_live_volumes') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_live_volumes') def test_get_live_volume_by_name_unknown(self, mock_get_live_volumes, @@ -7379,9 +7379,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_sc_live_volumes.assert_called_once_with('12345') mock_get_live_volumes.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') def test_map_secondary_volume(self, mock_get_json, @@ -7404,7 +7404,7 @@ class DellSCSanAPITestCase(test.TestCase): ) self.assertEqual({'instanceId': '102.101.1'}, ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test_map_secondary_volume_err(self, mock_post, @@ -7425,13 +7425,13 @@ class DellSCSanAPITestCase(test.TestCase): ) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') def test_create_live_volume(self, mock_find_sc, @@ -7464,13 +7464,13 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_qos.assert_any_call(secondaryqos, 102) self.assertEqual(sclivevol, ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') def test_create_live_volume_autofailover(self, mock_find_sc, @@ -7522,11 +7522,11 @@ class DellSCSanAPITestCase(test.TestCase): mock_post.assert_called_once_with('StorageCenter/ScLiveVolume', expected, True) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') def test_create_live_volume_error(self, mock_find_sc, @@ -7553,9 +7553,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_qos.assert_any_call(secondaryqos, 102) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') def test_create_live_volume_no_dest(self, mock_find_sc, @@ -7579,9 +7579,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_qos.assert_any_call(secondaryqos, 102) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') def test_create_live_volume_no_qos(self, mock_find_sc, @@ -7605,9 +7605,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_qos.assert_any_call(secondaryqos, 102) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_sc') def test_create_live_volume_no_secondary_qos(self, mock_find_sc, @@ -7632,7 +7632,7 @@ class DellSCSanAPITestCase(test.TestCase): mock_find_qos.assert_any_call(secondaryqos, 102) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put') def test_manage_replay(self, mock_put, @@ -7652,7 +7652,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.manage_replay(screplay, 'guid') self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put') def test_unmanage_replay(self, mock_put, @@ -7671,7 +7671,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.unmanage_replay(screplay) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_replay_list') def test_find_common_replay(self, mock_get_replay_list, @@ -7700,11 +7700,11 @@ class DellSCSanAPITestCase(test.TestCase): {'instanceId': '11111.1'}) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test_start_replication(self, mock_post, @@ -7749,15 +7749,15 @@ class DellSCSanAPITestCase(test.TestCase): 'cinderqos', False) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'find_common_replay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'create_replay') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'start_replication') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test_replicate_to_common(self, mock_post, @@ -7811,11 +7811,11 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.replicate_to_common(svolume, dvolume, 'cinderqos') self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'delete_replication') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'start_replication') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'rename_volume') def test_flip_replication(self, mock_rename_volume, @@ -7866,9 +7866,9 @@ class DellSCSanAPITestCase(test.TestCase): activereplay) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') def test_replication_progress(self, mock_get, @@ -7893,7 +7893,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertIsNone(retbool) self.assertIsNone(retnum) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'delete') def test_delete_live_volume(self, mock_delete, @@ -7909,7 +7909,7 @@ class DellSCSanAPITestCase(test.TestCase): True) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test_swap_roles_live_volume(self, mock_post, @@ -7921,7 +7921,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.swap_roles_live_volume(lv) self.assertTrue(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test_swap_roles_live_volume_fail(self, mock_post, @@ -7933,9 +7933,9 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi.swap_roles_live_volume(lv) self.assertFalse(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test__find_qos_profile(self, mock_post, @@ -7964,7 +7964,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_qos_profile('', False) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test__find_qos_error(self, mock_post, @@ -7975,9 +7975,9 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_qos_profile('Default', False) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test__find_qos_profile_empty_list(self, mock_post, @@ -7990,9 +7990,9 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_qos_profile('Default', False) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test__find_qos_profile_group(self, mock_post, @@ -8014,9 +8014,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_post.assert_called_once_with('StorageCenter/ScQosProfile/GetList', expected_payload) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test__find_datareduction_profile(self, mock_post, @@ -8043,7 +8043,7 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_data_reduction_profile('') self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test__find_datareduction_profile_error(self, mock_post, @@ -8054,9 +8054,9 @@ class DellSCSanAPITestCase(test.TestCase): ret = self.scapi._find_data_reduction_profile('Compression') self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post') def test__find_datareduction_profile_empty_list(self, mock_post, @@ -8100,11 +8100,11 @@ class DellSCSanAPITestCase(test.TestCase): payload, profile, 'Profile1', 'VolumeQosProfile') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') def test_update_datareduction_profile( self, mock_find_datareduction_profile, mock_put, mock_prefs, @@ -8123,11 +8123,11 @@ class DellSCSanAPITestCase(test.TestCase): mock_put.assert_called_once_with( 'StorageCenter/ScVolumeConfiguration/12345.101', expected, True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') def test_update_datareduction_profile_error( self, mock_find_datareduction_profile, mock_put, mock_prefs, @@ -8146,9 +8146,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_put.assert_called_once_with( 'StorageCenter/ScVolumeConfiguration/12345.101', expected, True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') def test_update_datareduction_profile_not_found( self, mock_find_datareduction_profile, mock_prefs, @@ -8160,9 +8160,9 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_datareduction_profile(scvolume, 'Profile') self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') def test_update_datareduction_profile_not_allowed( self, mock_find_datareduction_profile, mock_prefs, @@ -8174,9 +8174,9 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_datareduction_profile(scvolume, None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') def test_update_datareduction_profile_prefs_not_found( self, mock_find_datareduction_profile, mock_prefs, @@ -8188,9 +8188,9 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_datareduction_profile(scvolume, None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') def test_update_datareduction_profile_default_not_found( self, mock_find_datareduction_profile, mock_prefs, @@ -8202,12 +8202,12 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_datareduction_profile(scvolume, None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') def test_update_datareduction_profile_default( self, mock_find_datareduction_profile, mock_put, mock_prefs, @@ -8222,11 +8222,11 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_datareduction_profile(scvolume, None) self.assertTrue(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') def test_update_qos_profile( self, mock_find_qos_profile, mock_put, mock_prefs, @@ -8245,11 +8245,11 @@ class DellSCSanAPITestCase(test.TestCase): mock_put.assert_called_once_with( 'StorageCenter/ScVolumeConfiguration/12345.101', expected, True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_data_reduction_profile') def test_update_qos_profile_error( self, mock_find_qos_profile, mock_put, mock_prefs, @@ -8268,9 +8268,9 @@ class DellSCSanAPITestCase(test.TestCase): mock_put.assert_called_once_with( 'StorageCenter/ScVolumeConfiguration/12345.101', expected, True) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') def test_update_qos_profile_not_found( self, mock_find_qos_profile, mock_prefs, @@ -8282,9 +8282,9 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_qos_profile(scvolume, 'Profile') self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') def test_update_qos_profile_not_allowed( self, mock_find_qos_profile, mock_prefs, @@ -8296,9 +8296,9 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_qos_profile(scvolume, None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') def test_update_qos_profile_prefs_not_found( self, mock_find_qos_profile, mock_prefs, @@ -8310,9 +8310,9 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_qos_profile(scvolume, None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') def test_update_qos_profile_default_not_found( self, mock_find_qos_profile, mock_prefs, @@ -8324,11 +8324,11 @@ class DellSCSanAPITestCase(test.TestCase): res = self.scapi.update_qos_profile(scvolume, None) self.assertFalse(res) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_user_preferences') - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'put') - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_find_qos_profile') def test_update_qos_profile_default( self, mock_find_qos_profile, mock_put, mock_prefs, @@ -8426,8 +8426,8 @@ class DellSCSanAPIConnectionTestCase(test.TestCase): self._context = context.get_admin_context() self.apiversion = '2.0' - # Set up the StorageCenterApi - self.scapi = dell_storagecenter_api.StorageCenterApi( + # Set up the SCApi + self.scapi = storagecenter_api.SCApi( self.configuration.san_ip, self.configuration.dell_sc_api_port, self.configuration.san_login, @@ -8440,10 +8440,10 @@ class DellSCSanAPIConnectionTestCase(test.TestCase): self.scapi.sfname = self.configuration.dell_sc_server_folder self.scapi.vfname = self.configuration.dell_sc_volume_folder - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=APIDICT) def test_open_connection(self, @@ -8452,10 +8452,10 @@ class DellSCSanAPIConnectionTestCase(test.TestCase): self.scapi.open_connection() self.assertTrue(mock_post.called) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_check_version_fail', return_value=RESPONSE_400) def test_open_connection_failure(self, @@ -8466,13 +8466,13 @@ class DellSCSanAPIConnectionTestCase(test.TestCase): self.scapi.open_connection) self.assertTrue(mock_check_version_fail.called) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_check_version_fail', return_value=RESPONSE_200) - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, '_get_json', return_value=APIDICT) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_400) def test_open_connection_sc(self, @@ -8482,7 +8482,7 @@ class DellSCSanAPIConnectionTestCase(test.TestCase): self.scapi.open_connection() self.assertTrue(mock_check_version_fail.called) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_204) def test_close_connection(self, @@ -8490,7 +8490,7 @@ class DellSCSanAPIConnectionTestCase(test.TestCase): self.scapi.close_connection() self.assertTrue(mock_post.called) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'post', return_value=RESPONSE_200) def test_close_connection_failure(self, @@ -8562,7 +8562,7 @@ class DellHttpClientTestCase(test.TestCase): self.password = 'password' self.verify = False self.apiversion = '3.1' - self.httpclient = dell_storagecenter_api.HttpClient( + self.httpclient = storagecenter_api.HttpClient( self.host, self.port, self.user, self.password, self.verify, self.apiversion) @@ -8620,7 +8620,7 @@ class DellHttpClientTestCase(test.TestCase): response = self.httpclient._rest_ret(rest_response, False) self.assertEqual(self.RESPONSE_200, response) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, '_wait_for_async_complete', return_value=RESPONSE_200) def test_rest_ret_async(self, @@ -8637,7 +8637,7 @@ class DellHttpClientTestCase(test.TestCase): self.assertRaises(exception.VolumeBackendAPIException, self.httpclient._rest_ret, mock_rest_response, True) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_wait_for_async_complete(self, @@ -8645,7 +8645,7 @@ class DellHttpClientTestCase(test.TestCase): ret = self.httpclient._wait_for_async_complete(self.ASYNCTASK) self.assertEqual(self.RESPONSE_200, ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, '_get_async_url', return_value=None) def test_wait_for_async_complete_bad_url(self, @@ -8653,7 +8653,7 @@ class DellHttpClientTestCase(test.TestCase): ret = self.httpclient._wait_for_async_complete(self.ASYNCTASK) self.assertIsNone(ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_400) def test_wait_for_async_complete_bad_result(self, @@ -8661,7 +8661,7 @@ class DellHttpClientTestCase(test.TestCase): ret = self.httpclient._wait_for_async_complete(self.ASYNCTASK) self.assertEqual(self.RESPONSE_400, ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get', return_value=RESPONSE_200) def test_wait_for_async_complete_loop(self, @@ -8674,7 +8674,7 @@ class DellHttpClientTestCase(test.TestCase): ret = self.httpclient._wait_for_async_complete(self.ASYNCTASK) self.assertEqual(self.RESPONSE_200, ret) - @mock.patch.object(dell_storagecenter_api.HttpClient, + @mock.patch.object(storagecenter_api.HttpClient, 'get') def test_wait_for_async_complete_get_raises(self, mock_get): @@ -8703,7 +8703,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): Class to test the Storage Center API helper using Mock. """ - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'open_connection') def test_setup_connection(self, mock_open_connection): @@ -8716,15 +8716,14 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): config.dell_sc_server_folder = 'a' config.dell_sc_verify_cert = False config.san_port = 3033 - helper = dell_storagecenter_api.StorageCenterApiHelper(config, None, - 'FC') + helper = storagecenter_api.SCApiHelper(config, None, 'FC') ret = helper._setup_connection() self.assertEqual(12345, ret.primaryssn) self.assertEqual(12345, ret.ssn) self.assertEqual('FibreChannel', ret.protocol) mock_open_connection.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'open_connection') def test_setup_connection_iscsi(self, mock_open_connection): @@ -8737,15 +8736,14 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): config.dell_sc_server_folder = 'a' config.dell_sc_verify_cert = False config.san_port = 3033 - helper = dell_storagecenter_api.StorageCenterApiHelper(config, None, - 'iSCSI') + helper = storagecenter_api.SCApiHelper(config, None, 'iSCSI') ret = helper._setup_connection() self.assertEqual(12345, ret.primaryssn) self.assertEqual(12345, ret.ssn) self.assertEqual('Iscsi', ret.protocol) mock_open_connection.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.StorageCenterApi, + @mock.patch.object(storagecenter_api.SCApi, 'open_connection') def test_setup_connection_failover(self, mock_open_connection): @@ -8758,15 +8756,14 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): config.dell_sc_server_folder = 'a' config.dell_sc_verify_cert = False config.san_port = 3033 - helper = dell_storagecenter_api.StorageCenterApiHelper(config, '67890', - 'iSCSI') + helper = storagecenter_api.SCApiHelper(config, '67890', 'iSCSI') ret = helper._setup_connection() self.assertEqual(12345, ret.primaryssn) self.assertEqual(67890, ret.ssn) self.assertEqual('Iscsi', ret.protocol) mock_open_connection.assert_called_once_with() - @mock.patch.object(dell_storagecenter_api.StorageCenterApiHelper, + @mock.patch.object(storagecenter_api.SCApiHelper, '_setup_connection') def test_open_connection(self, mock_setup_connection): @@ -8776,8 +8773,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): config.san_login = 'username' config.san_password = 'password' config.san_port = 3033 - helper = dell_storagecenter_api.StorageCenterApiHelper(config, None, - 'FC') + helper = storagecenter_api.SCApiHelper(config, None, 'FC') mock_connection = mock.MagicMock() mock_connection.apiversion = '3.1' mock_setup_connection.return_value = mock_connection @@ -8787,7 +8783,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): self.assertEqual('username', helper.san_login) self.assertEqual('password', helper.san_password) - @mock.patch.object(dell_storagecenter_api.StorageCenterApiHelper, + @mock.patch.object(storagecenter_api.SCApiHelper, '_setup_connection') def test_open_connection_fail_no_secondary(self, mock_setup_connection): @@ -8799,8 +8795,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): config.san_password = 'password' config.san_port = 3033 config.secondary_san_ip = '' - helper = dell_storagecenter_api.StorageCenterApiHelper(config, None, - 'FC') + helper = storagecenter_api.SCApiHelper(config, None, 'FC') mock_setup_connection.side_effect = ( exception.VolumeBackendAPIException('abc')) self.assertRaises(exception.VolumeBackendAPIException, @@ -8810,7 +8805,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): self.assertEqual('username', helper.san_login) self.assertEqual('password', helper.san_password) - @mock.patch.object(dell_storagecenter_api.StorageCenterApiHelper, + @mock.patch.object(storagecenter_api.SCApiHelper, '_setup_connection') def test_open_connection_secondary(self, mock_setup_connection): @@ -8824,8 +8819,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): config.secondary_san_ip = '192.168.0.102' config.secondary_san_login = 'username2' config.secondary_san_password = 'password2' - helper = dell_storagecenter_api.StorageCenterApiHelper(config, None, - 'FC') + helper = storagecenter_api.SCApiHelper(config, None, 'FC') mock_connection = mock.MagicMock() mock_connection.apiversion = '3.1' mock_setup_connection.side_effect = [ @@ -8837,7 +8831,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): self.assertEqual('username2', helper.san_login) self.assertEqual('password2', helper.san_password) - @mock.patch.object(dell_storagecenter_api.StorageCenterApiHelper, + @mock.patch.object(storagecenter_api.SCApiHelper, '_setup_connection') def test_open_connection_fail_partial_secondary_config( self, mock_setup_connection): @@ -8851,8 +8845,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): config.secondary_san_ip = '192.168.0.102' config.secondary_san_login = 'username2' config.secondary_san_password = '' - helper = dell_storagecenter_api.StorageCenterApiHelper(config, None, - 'FC') + helper = storagecenter_api.SCApiHelper(config, None, 'FC') mock_setup_connection.side_effect = ( exception.VolumeBackendAPIException('abc')) self.assertRaises(exception.VolumeBackendAPIException, @@ -8862,7 +8855,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): self.assertEqual('username', helper.san_login) self.assertEqual('password', helper.san_password) - @mock.patch.object(dell_storagecenter_api.StorageCenterApiHelper, + @mock.patch.object(storagecenter_api.SCApiHelper, '_setup_connection') def test_open_connection_to_secondary_and_back(self, mock_setup_connection): @@ -8876,8 +8869,7 @@ class DellStorageCenterApiHelperTestCase(test.TestCase): config.secondary_san_ip = '192.168.0.102' config.secondary_san_login = 'username2' config.secondary_san_password = 'password2' - helper = dell_storagecenter_api.StorageCenterApiHelper(config, None, - 'FC') + helper = storagecenter_api.SCApiHelper(config, None, 'FC') mock_connection = mock.MagicMock() mock_connection.apiversion = '3.1' mock_setup_connection.side_effect = [ diff --git a/cinder/volume/drivers/dell/__init__.py b/cinder/volume/drivers/dell_emc/sc/__init__.py similarity index 100% rename from cinder/volume/drivers/dell/__init__.py rename to cinder/volume/drivers/dell_emc/sc/__init__.py diff --git a/cinder/volume/drivers/dell/dell_storagecenter_api.py b/cinder/volume/drivers/dell_emc/sc/storagecenter_api.py similarity index 99% rename from cinder/volume/drivers/dell/dell_storagecenter_api.py rename to cinder/volume/drivers/dell_emc/sc/storagecenter_api.py index 83ad7c94db4..bc8c7418121 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_api.py +++ b/cinder/volume/drivers/dell_emc/sc/storagecenter_api.py @@ -1,4 +1,4 @@ -# Copyright 2016 Dell Inc. +# Copyright (c) 2015-2017 Dell Inc, or its subsidiaries. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -176,7 +176,7 @@ class HttpClient(object): # r.content blanks. # Object returned switches to one without objectType or with # a different objectType. - if not StorageCenterApi._check_result(r): + if not SCApi._check_result(r): LOG.debug('Async error:\n' '\tstatus_code: %(code)s\n' '\ttext: %(text)s\n', @@ -273,8 +273,8 @@ class HttpClient(object): self.session.delete(self.__formatUrl(url), **named), async) -class StorageCenterApiHelper(object): - """StorageCenterApiHelper +class SCApiHelper(object): + """SCApiHelper Helper class for API access. Handles opening and closing the connection to the Dell REST API. @@ -328,12 +328,12 @@ class StorageCenterApiHelper(object): def _setup_connection(self): """Attempts to open a connection to the storage center.""" - connection = StorageCenterApi(self.san_ip, - self.san_port, - self.san_login, - self.san_password, - self.config.dell_sc_verify_cert, - self.apiversion) + connection = SCApi(self.san_ip, + self.san_port, + self.san_login, + self.san_password, + self.config.dell_sc_verify_cert, + self.apiversion) # This instance is for a single backend. That backend has a # few items of information we should save rather than passing them # about. @@ -357,9 +357,9 @@ class StorageCenterApiHelper(object): return connection def open_connection(self): - """Creates the StorageCenterApi object. + """Creates the SCApi object. - :return: StorageCenterApi object. + :return: SCApi object. :raises VolumeBackendAPIException: """ connection = None @@ -390,8 +390,8 @@ class StorageCenterApiHelper(object): return connection -class StorageCenterApi(object): - """StorageCenterApi +class SCApi(object): + """SCApi Handles calls to Dell SC and EM via the REST API interface. @@ -416,10 +416,11 @@ class StorageCenterApi(object): 3.5.0 - Support for AFO. 3.6.0 - Server type support. 3.7.0 - Support for Data Reduction, Group QOS and Volume QOS. + 4.0.0 - Driver moved to dell_emc. """ - APIDRIVERVERSION = '3.7.0' + APIDRIVERVERSION = '4.0.0' def __init__(self, host, port, user, password, verify, apiversion): """This creates a connection to Dell SC or EM. diff --git a/cinder/volume/drivers/dell/dell_storagecenter_common.py b/cinder/volume/drivers/dell_emc/sc/storagecenter_common.py similarity index 99% rename from cinder/volume/drivers/dell/dell_storagecenter_common.py rename to cinder/volume/drivers/dell_emc/sc/storagecenter_common.py index cf001ee43fa..840a553ea5c 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_common.py +++ b/cinder/volume/drivers/dell_emc/sc/storagecenter_common.py @@ -1,4 +1,4 @@ -# Copyright 2016 Dell Inc. +# Copyright (c) 2015-2017 Dell Inc, or its subsidiaries. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -23,12 +23,11 @@ from cinder import exception from cinder.i18n import _ from cinder.objects import fields from cinder.volume import driver -from cinder.volume.drivers.dell import dell_storagecenter_api +from cinder.volume.drivers.dell_emc.sc import storagecenter_api from cinder.volume.drivers.san.san import san_opts from cinder.volume import utils as volume_utils from cinder.volume import volume_types - common_opts = [ cfg.IntOpt('dell_sc_ssn', default=64702, @@ -74,12 +73,12 @@ CONF = cfg.CONF CONF.register_opts(common_opts) -class DellCommonDriver(driver.ManageableVD, - driver.ManageableSnapshotsVD, - driver.BaseVD): +class SCCommonDriver(driver.ManageableVD, + driver.ManageableSnapshotsVD, + driver.BaseVD): def __init__(self, *args, **kwargs): - super(DellCommonDriver, self).__init__(*args, **kwargs) + super(SCCommonDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(common_opts) self.configuration.append_config_values(san_opts) self.backend_name =\ @@ -120,7 +119,7 @@ class DellCommonDriver(driver.ManageableVD, Sets up clients, check licenses, sets up protocol specific helpers. """ - self._client = dell_storagecenter_api.StorageCenterApiHelper( + self._client = storagecenter_api.SCApiHelper( self.configuration, self.active_backend_id, self.storage_protocol) def check_for_setup_error(self): @@ -358,7 +357,7 @@ class DellCommonDriver(driver.ManageableVD, def _delete_live_volume(self, api, volume): """Delete live volume associated with volume. - :param api:Dell REST API object. + :param api: Dell REST API object. :param volume: Cinder Volume object :return: True if we actually deleted something. False for everything else. @@ -704,7 +703,7 @@ class DellCommonDriver(driver.ManageableVD, # Static stats. data = {} data['volume_backend_name'] = self.backend_name - data['vendor_name'] = 'Dell' + data['vendor_name'] = 'Dell EMC' data['driver_version'] = self.VERSION data['storage_protocol'] = self.storage_protocol data['reserved_percentage'] = 0 @@ -1391,7 +1390,7 @@ class DellCommonDriver(driver.ManageableVD, def _parse_secondary(self, api, secondary): """Find the replication destination associated with secondary. - :param api: Dell StorageCenterApi + :param api: Dell SCApi :param secondary: String indicating the secondary to failover to. :return: Destination SSN for the given secondary. """ @@ -1950,7 +1949,7 @@ class DellCommonDriver(driver.ManageableVD, with self._client.open_connection() as api: screplay = self._get_unmanaged_replay(api, volume_name, provider_id, existing_ref) - sz, rem = dell_storagecenter_api.StorageCenterApi.size_to_gb( + sz, rem = storagecenter_api.SCApi.size_to_gb( screplay['size']) if rem > 0: raise exception.VolumeBackendAPIException( diff --git a/cinder/volume/drivers/dell/dell_storagecenter_fc.py b/cinder/volume/drivers/dell_emc/sc/storagecenter_fc.py similarity index 96% rename from cinder/volume/drivers/dell/dell_storagecenter_fc.py rename to cinder/volume/drivers/dell_emc/sc/storagecenter_fc.py index 4574159b155..1105ac1c9c7 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_fc.py +++ b/cinder/volume/drivers/dell_emc/sc/storagecenter_fc.py @@ -1,4 +1,4 @@ -# Copyright 2015 Dell Inc. +# Copyright (c) 2015-2017 Dell Inc, or its subsidiaries. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -21,21 +21,21 @@ from cinder import exception from cinder.i18n import _ from cinder import interface from cinder.volume import driver -from cinder.volume.drivers.dell import dell_storagecenter_common +from cinder.volume.drivers.dell_emc.sc import storagecenter_common from cinder.zonemanager import utils as fczm_utils LOG = logging.getLogger(__name__) @interface.volumedriver -class DellStorageCenterFCDriver(dell_storagecenter_common.DellCommonDriver, - driver.FibreChannelDriver): +class SCFCDriver(storagecenter_common.SCCommonDriver, + driver.FibreChannelDriver): """Implements commands for Dell Storage Center FC management. To enable the driver add the following line to the cinder configuration: - volume_driver=cinder.volume.drivers.dell.dell_storagecenter_fc.\ - DellStorageCenterFCDriver + volume_driver=cinder.volume.drivers.dell_emc.sc.dell_storagecenter_fc.\ + SCFCDriver Version history: @@ -61,15 +61,16 @@ class DellStorageCenterFCDriver(dell_storagecenter_common.DellCommonDriver, 3.5.0 - Support for AFO. 3.6.0 - Server type support. 3.7.0 - Support for Data Reduction, Group QOS and Volume QOS. + 4.0.0 - Driver moved to dell_emc. """ - VERSION = '3.7.0' + VERSION = '4.0.0' CI_WIKI_NAME = "Dell_Storage_CI" def __init__(self, *args, **kwargs): - super(DellStorageCenterFCDriver, self).__init__(*args, **kwargs) + super(SCFCDriver, self).__init__(*args, **kwargs) self.backend_name =\ self.configuration.safe_get('volume_backend_name') or 'Dell-FC' self.storage_protocol = 'FC' diff --git a/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py b/cinder/volume/drivers/dell_emc/sc/storagecenter_iscsi.py similarity index 96% rename from cinder/volume/drivers/dell/dell_storagecenter_iscsi.py rename to cinder/volume/drivers/dell_emc/sc/storagecenter_iscsi.py index 3fdbb4a006d..5d99bba1ab0 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py +++ b/cinder/volume/drivers/dell_emc/sc/storagecenter_iscsi.py @@ -1,4 +1,4 @@ -# Copyright 2015 Dell Inc. +# Copyright (c) 2015-2017 Dell Inc, or its subsidiaries. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -21,19 +21,20 @@ from cinder import exception from cinder.i18n import _ from cinder import interface from cinder.volume import driver -from cinder.volume.drivers.dell import dell_storagecenter_common +from cinder.volume.drivers.dell_emc.sc import storagecenter_common + LOG = logging.getLogger(__name__) @interface.volumedriver -class DellStorageCenterISCSIDriver(dell_storagecenter_common.DellCommonDriver, - driver.ISCSIDriver): +class SCISCSIDriver(storagecenter_common.SCCommonDriver, + driver.ISCSIDriver): """Implements commands for Dell Storage Center ISCSI management. To enable the driver add the following line to the cinder configuration: - volume_driver=cinder.volume.drivers.dell.dell_storagecenter_iscsi.\ - DellStorageCenterISCSIDriver + volume_driver=cinder.volume.drivers.dell_emc.sc.\ + dell_storagecenter_iscsi.SCISCSIDriver Version history: @@ -60,14 +61,15 @@ class DellStorageCenterISCSIDriver(dell_storagecenter_common.DellCommonDriver, 3.5.0 - Support for AFO. 3.6.0 - Server type support. 3.7.0 - Support for Data Reduction, Group QOS and Volume QOS. + 4.0.0 - Driver moved to dell_emc. """ - VERSION = '3.7.0' + VERSION = '4.0.0' CI_WIKI_NAME = "Dell_Storage_CI" def __init__(self, *args, **kwargs): - super(DellStorageCenterISCSIDriver, self).__init__(*args, **kwargs) + super(SCISCSIDriver, self).__init__(*args, **kwargs) self.backend_name = ( self.configuration.safe_get('volume_backend_name') or 'Dell-iSCSI') diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 7a6426112db..ebe73e32819 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -167,6 +167,14 @@ MAPPING = { 'cinder.volume.drivers.dell_emc.vmax.fc.VMAXFCDriver', 'cinder.volume.drivers.eqlx.DellEQLSanISCSIDriver': 'cinder.volume.drivers.dell_emc.ps.PSSeriesISCSIDriver', + 'cinder.volume.drivers.dell.dell_storagecenter_iscsi.' + 'DellStorageCenterISCSIDriver': + 'cinder.volume.drivers.dell_emc.sc.storagecenter_iscsi.' + 'SCISCSIDriver', + 'cinder.volume.drivers.dell.dell_storagecenter_fc.' + 'DellStorageCenterFCDriver': + 'cinder.volume.drivers.dell_emc.sc.storagecenter_fc.' + 'SCFCDriver', } diff --git a/releasenotes/notes/Dell-SC-Driver-to-dell_emc-folder-e5d6fb1f1cf84149.yaml b/releasenotes/notes/Dell-SC-Driver-to-dell_emc-folder-e5d6fb1f1cf84149.yaml new file mode 100644 index 00000000000..70ad85e87c1 --- /dev/null +++ b/releasenotes/notes/Dell-SC-Driver-to-dell_emc-folder-e5d6fb1f1cf84149.yaml @@ -0,0 +1,9 @@ +--- +upgrades: + - The Dell Storage Center driver is moved to the dell_emc directory + and has been rebranded to its current Dell EMC SC name. The + volume_driver entry in cinder.conf needs to be changed to + ``cinder.volume.drivers.dell_emc.sc.storagecenter_fc.SCFCDriver`` + for FC or + ``cinder.volume.drivers.dell_emc.sc.storagecenter_iscsi.SCISCSIDriver`` + for ISCSI.