Merge "Move drivers unit tests to unit.volume.drivers directory"
This commit is contained in:
commit
af7bfedc51
@ -21,7 +21,8 @@ import mock
|
||||
|
||||
from cinder import exception
|
||||
from cinder import test
|
||||
from cinder.tests.unit import fake_vmem_client as vmemclient
|
||||
from cinder.tests.unit.volume.drivers.violin import \
|
||||
fake_vmem_client as vmemclient
|
||||
from cinder.volume import configuration as conf
|
||||
from cinder.volume.drivers.violin import v7000_common
|
||||
from cinder.volume.drivers.violin import v7000_iscsi
|
||||
|
0
cinder/tests/unit/volume/drivers/dell/__init__.py
Normal file
0
cinder/tests/unit/volume/drivers/dell/__init__.py
Normal file
@ -13,15 +13,15 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import ddt
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
from xml.dom import minidom
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from oslo_service import loopingcall
|
||||
from oslo_utils import units
|
||||
import six
|
||||
|
||||
@ -29,6 +29,7 @@ from cinder import exception
|
||||
from cinder.i18n import _
|
||||
from cinder.objects import fields
|
||||
from cinder import test
|
||||
from cinder.tests.unit import utils
|
||||
|
||||
from cinder.volume import configuration as conf
|
||||
from cinder.volume.drivers.emc import emc_vmax_common
|
||||
@ -1721,7 +1722,6 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
self.fake_sleep)
|
||||
self.stubs.Set(emc_vmax_utils.EMCVMAXUtils, 'isArrayV3',
|
||||
self.fake_is_v3)
|
||||
|
||||
driver = emc_vmax_iscsi.EMCVMAXISCSIDriver(configuration=configuration)
|
||||
driver.db = FakeDB()
|
||||
self.driver = driver
|
||||
@ -2310,7 +2310,8 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
vol['name'], extraSpecs)
|
||||
self.assertTrue(return_to_default)
|
||||
|
||||
def test_wait_for_job_complete(self):
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def _test_wait_for_job_complete(self):
|
||||
myjob = SE_ConcreteJob()
|
||||
myjob.classname = 'SE_ConcreteJob'
|
||||
myjob['InstanceID'] = '9999'
|
||||
@ -2330,18 +2331,12 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
self.assertTrue(self.driver.utils._is_job_finished.return_value)
|
||||
self.driver.utils._is_job_finished.reset_mock()
|
||||
|
||||
# Save the original state and restore it after this test
|
||||
loopingcall_orig = loopingcall.FixedIntervalLoopingCall
|
||||
loopingcall.FixedIntervalLoopingCall = mock.Mock()
|
||||
rc, errordesc = self.driver.utils.wait_for_job_complete(conn, myjob)
|
||||
self.assertEqual(0, rc)
|
||||
self.assertIsNone(errordesc)
|
||||
loopingcall.FixedIntervalLoopingCall.assert_called_once_with(
|
||||
mock.ANY)
|
||||
loopingcall.FixedIntervalLoopingCall.reset_mock()
|
||||
loopingcall.FixedIntervalLoopingCall = loopingcall_orig
|
||||
|
||||
def test_wait_for_job_complete_bad_job_state(self):
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def _test_wait_for_job_complete_bad_job_state(self):
|
||||
myjob = SE_ConcreteJob()
|
||||
myjob.classname = 'SE_ConcreteJob'
|
||||
myjob['InstanceID'] = '9999'
|
||||
@ -2358,12 +2353,14 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
self.assertEqual(-1, rc)
|
||||
self.assertEqual('Job finished with an error', errordesc)
|
||||
|
||||
def test_wait_for_sync(self):
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def _test_wait_for_sync(self):
|
||||
mysync = 'fakesync'
|
||||
conn = self.fake_ecom_connection()
|
||||
|
||||
self.driver.utils._is_sync_complete = mock.Mock(
|
||||
return_value=True)
|
||||
self.driver.utils._get_interval_in_secs = mock.Mock(return_value=0)
|
||||
rc = self.driver.utils.wait_for_sync(conn, mysync)
|
||||
self.assertIsNotNone(rc)
|
||||
self.driver.utils._is_sync_complete.assert_called_once_with(
|
||||
@ -2371,16 +2368,10 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
self.assertTrue(self.driver.utils._is_sync_complete.return_value)
|
||||
self.driver.utils._is_sync_complete.reset_mock()
|
||||
|
||||
# Save the original state and restore it after this test
|
||||
loopingcall_orig = loopingcall.FixedIntervalLoopingCall
|
||||
loopingcall.FixedIntervalLoopingCall = mock.Mock()
|
||||
rc = self.driver.utils.wait_for_sync(conn, mysync)
|
||||
self.assertIsNotNone(rc)
|
||||
loopingcall.FixedIntervalLoopingCall.assert_called_once_with(
|
||||
mock.ANY)
|
||||
loopingcall.FixedIntervalLoopingCall.reset_mock()
|
||||
loopingcall.FixedIntervalLoopingCall = loopingcall_orig
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_wait_for_sync_extra_specs(self):
|
||||
mysync = 'fakesync'
|
||||
conn = self.fake_ecom_connection()
|
||||
@ -2396,6 +2387,7 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
|
||||
self.driver.utils._is_sync_complete = mock.Mock(
|
||||
return_value=True)
|
||||
self.driver.utils._get_interval_in_secs = mock.Mock(return_value=0)
|
||||
rc = self.driver.utils.wait_for_sync(conn, mysync, extraSpecs)
|
||||
self.assertIsNotNone(rc)
|
||||
self.driver.utils._is_sync_complete.assert_called_once_with(
|
||||
@ -2407,15 +2399,8 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
self.driver.utils._get_interval_in_secs(extraSpecs))
|
||||
self.driver.utils._is_sync_complete.reset_mock()
|
||||
|
||||
# Save the original state and restore it after this test
|
||||
loopingcall_orig = loopingcall.FixedIntervalLoopingCall
|
||||
loopingcall.FixedIntervalLoopingCall = mock.Mock()
|
||||
rc = self.driver.utils.wait_for_sync(conn, mysync)
|
||||
self.assertIsNotNone(rc)
|
||||
loopingcall.FixedIntervalLoopingCall.assert_called_once_with(
|
||||
mock.ANY)
|
||||
loopingcall.FixedIntervalLoopingCall.reset_mock()
|
||||
loopingcall.FixedIntervalLoopingCall = loopingcall_orig
|
||||
bExists = os.path.exists(file_name)
|
||||
if bExists:
|
||||
os.remove(file_name)
|
||||
@ -3326,6 +3311,7 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
self.driver.create_snapshot,
|
||||
self.data.test_volume)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(
|
||||
emc_vmax_utils.EMCVMAXUtils,
|
||||
'get_meta_members_capacity_in_byte',
|
||||
@ -3594,6 +3580,7 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
add_volumes, remove_volumes)
|
||||
|
||||
# Bug https://bugs.launchpad.net/cinder/+bug/1442376
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(
|
||||
emc_vmax_common.EMCVMAXCommon,
|
||||
'_get_pool_and_storage_system',
|
||||
@ -3614,7 +3601,7 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
|
||||
volume_types,
|
||||
'get_volume_type_extra_specs',
|
||||
return_value={'volume_backend_name': 'ISCSINoFAST'})
|
||||
def test_create_clone_with_different_meta_sizes(
|
||||
def _test_create_clone_with_different_meta_sizes(
|
||||
self, mock_volume_type, mock_volume,
|
||||
mock_meta, mock_size, mock_pool):
|
||||
self.data.test_volume['volume_name'] = "vmax-1234567"
|
||||
@ -3868,6 +3855,10 @@ class EMCVMAXISCSIDriverFastTestCase(test.TestCase):
|
||||
driver = emc_vmax_iscsi.EMCVMAXISCSIDriver(configuration=configuration)
|
||||
driver.db = FakeDB()
|
||||
self.driver = driver
|
||||
self.patcher = mock.patch(
|
||||
'oslo_service.loopingcall.FixedIntervalLoopingCall',
|
||||
new=utils.ZeroIntervalLoopingCall)
|
||||
self.patcher.start()
|
||||
|
||||
def create_fake_config_file_fast(self):
|
||||
|
||||
@ -4231,6 +4222,11 @@ class EMCVMAXISCSIDriverFastTestCase(test.TestCase):
|
||||
self.driver.create_snapshot,
|
||||
self.data.test_volume)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(
|
||||
emc_vmax_utils.EMCVMAXUtils,
|
||||
'wait_for_job_complete',
|
||||
return_value=(0, 'success'))
|
||||
@mock.patch.object(
|
||||
emc_vmax_utils.EMCVMAXUtils,
|
||||
'get_meta_members_capacity_in_byte',
|
||||
@ -4248,7 +4244,8 @@ class EMCVMAXISCSIDriverFastTestCase(test.TestCase):
|
||||
'get_volume_type_extra_specs',
|
||||
return_value={'volume_backend_name': 'ISCSIFAST'})
|
||||
def test_create_volume_from_same_size_meta_snapshot(
|
||||
self, mock_volume_type, mock_sync_sv, mock_meta, mock_size):
|
||||
self, mock_volume_type, mock_sync_sv, mock_meta, mock_size,
|
||||
mock_wait):
|
||||
self.data.test_volume['volume_name'] = "vmax-1234567"
|
||||
common = self.driver.common
|
||||
common.fast.is_volume_in_default_SG = mock.Mock(return_value=True)
|
||||
@ -5054,6 +5051,7 @@ class EMCVMAXFCDriverFastTestCase(test.TestCase):
|
||||
self.create_fake_config_file_fast()
|
||||
self.addCleanup(self._cleanup)
|
||||
|
||||
self.flags(rpc_backend='oslo_messaging._drivers.impl_fake')
|
||||
configuration = mock.Mock()
|
||||
configuration.cinder_emc_config_file = self.config_file_path
|
||||
configuration.safe_get.return_value = 'FCFAST'
|
||||
@ -5068,7 +5066,6 @@ class EMCVMAXFCDriverFastTestCase(test.TestCase):
|
||||
self.fake_sleep)
|
||||
self.stubs.Set(emc_vmax_utils.EMCVMAXUtils, 'isArrayV3',
|
||||
self.fake_is_v3)
|
||||
|
||||
driver = emc_vmax_fc.EMCVMAXFCDriver(configuration=configuration)
|
||||
driver.db = FakeDB()
|
||||
driver.common.conn = FakeEcomConnection()
|
||||
@ -5450,6 +5447,7 @@ class EMCVMAXFCDriverFastTestCase(test.TestCase):
|
||||
self.driver.create_snapshot,
|
||||
self.data.test_volume)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(
|
||||
emc_vmax_utils.EMCVMAXUtils,
|
||||
'get_meta_members_capacity_in_byte',
|
||||
@ -5710,6 +5708,7 @@ class EMCV3DriverTestCase(test.TestCase):
|
||||
self.data = EMCVMAXCommonData()
|
||||
|
||||
self.data.storage_system = 'SYMMETRIX-+-000197200056'
|
||||
self.flags(rpc_backend='oslo_messaging._drivers.impl_fake')
|
||||
|
||||
self.tempdir = tempfile.mkdtemp()
|
||||
super(EMCV3DriverTestCase, self).setUp()
|
||||
@ -5733,6 +5732,10 @@ class EMCV3DriverTestCase(test.TestCase):
|
||||
self.fake_sleep)
|
||||
self.stubs.Set(emc_vmax_utils.EMCVMAXUtils, 'isArrayV3',
|
||||
self.fake_is_v3)
|
||||
self.patcher = mock.patch(
|
||||
'oslo_service.loopingcall.FixedIntervalLoopingCall',
|
||||
new=utils.ZeroIntervalLoopingCall)
|
||||
self.patcher.start()
|
||||
|
||||
driver = emc_vmax_fc.EMCVMAXFCDriver(configuration=configuration)
|
||||
driver.db = FakeDB()
|
||||
@ -6009,6 +6012,7 @@ class EMCV3DriverTestCase(test.TestCase):
|
||||
return_value=self.default_extraspec())
|
||||
self.driver.delete_volume(self.data.test_volume_v3)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(
|
||||
emc_vmax_common.EMCVMAXCommon,
|
||||
'_get_pool_and_storage_system',
|
||||
@ -6045,6 +6049,7 @@ class EMCV3DriverTestCase(test.TestCase):
|
||||
return_value=self.default_extraspec())
|
||||
self.driver.delete_snapshot(self.data.test_volume_v3)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(
|
||||
emc_vmax_common.EMCVMAXCommon,
|
||||
'_get_pool_and_storage_system',
|
@ -13,6 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import unittest
|
||||
|
||||
from cinder import exception
|
||||
from cinder import test
|
||||
from cinder.tests.unit.volume.drivers.emc.vnx import fake_exception \
|
||||
@ -237,9 +239,10 @@ class TestClient(test.TestCase):
|
||||
def test_expand_lun_already_expanded(self, client, _ignore):
|
||||
client.expand_lun('lun', 10)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@utils.patch_no_sleep
|
||||
@res_mock.patch_client
|
||||
def test_expand_lun_not_ops_ready(self, client, _ignore):
|
||||
def _test_expand_lun_not_ops_ready(self, client, _ignore):
|
||||
self.assertRaises(storops_ex.VNXLunPreparingError,
|
||||
client.expand_lun, 'lun', 10)
|
||||
lun = client.vnx.get_lun()
|
||||
@ -290,18 +293,21 @@ class TestClient(test.TestCase):
|
||||
def test_modify_snapshot(self, client, mocked):
|
||||
client.modify_snapshot('snap_name', True, True)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@utils.patch_no_sleep
|
||||
@res_mock.patch_client
|
||||
def test_create_cg_snapshot(self, client, mocked):
|
||||
snap = client.create_cg_snapshot('cg_snap_name', 'cg_name')
|
||||
self.assertIsNotNone(snap)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@utils.patch_no_sleep
|
||||
@res_mock.patch_client
|
||||
def test_create_cg_snapshot_already_existed(self, client, mocked):
|
||||
snap = client.create_cg_snapshot('cg_snap_name', 'cg_name')
|
||||
self.assertIsNotNone(snap)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@utils.patch_no_sleep
|
||||
@res_mock.patch_client
|
||||
def test_delete_cg_snapshot(self, client, mocked):
|
||||
|
0
cinder/tests/unit/volume/drivers/hpe/__init__.py
Normal file
0
cinder/tests/unit/volume/drivers/hpe/__init__.py
Normal file
@ -19,7 +19,8 @@ import sys
|
||||
|
||||
import mock
|
||||
|
||||
from cinder.tests.unit import fake_hpe_client_exceptions as hpeexceptions
|
||||
from cinder.tests.unit.volume.drivers.hpe \
|
||||
import fake_hpe_client_exceptions as hpeexceptions
|
||||
|
||||
hpe3par = mock.Mock()
|
||||
hpe3par.version = "4.2.0"
|
@ -19,7 +19,8 @@ import sys
|
||||
|
||||
import mock
|
||||
|
||||
from cinder.tests.unit import fake_hpe_client_exceptions as hpeexceptions
|
||||
from cinder.tests.unit.volume.drivers.hpe \
|
||||
import fake_hpe_client_exceptions as hpeexceptions
|
||||
|
||||
hpelefthand = mock.Mock()
|
||||
hpelefthand.version = "2.1.0"
|
@ -25,7 +25,8 @@ from cinder import context
|
||||
from cinder import exception
|
||||
from cinder.objects import fields
|
||||
from cinder import test
|
||||
from cinder.tests.unit import fake_hpe_3par_client as hpe3parclient
|
||||
from cinder.tests.unit.volume.drivers.hpe \
|
||||
import fake_hpe_3par_client as hpe3parclient
|
||||
from cinder.volume.drivers.hpe import hpe_3par_common as hpecommon
|
||||
from cinder.volume.drivers.hpe import hpe_3par_fc as hpefcdriver
|
||||
from cinder.volume.drivers.hpe import hpe_3par_iscsi as hpedriver
|
@ -24,7 +24,8 @@ from cinder import context
|
||||
from cinder import exception
|
||||
from cinder.objects import fields
|
||||
from cinder import test
|
||||
from cinder.tests.unit import fake_hpe_lefthand_client as hpelefthandclient
|
||||
from cinder.tests.unit.volume.drivers.hpe \
|
||||
import fake_hpe_lefthand_client as hpelefthandclient
|
||||
from cinder.volume.drivers.hpe import hpe_lefthand_iscsi
|
||||
from cinder.volume import volume_types
|
||||
|
0
cinder/tests/unit/volume/drivers/huawei/__init__.py
Normal file
0
cinder/tests/unit/volume/drivers/huawei/__init__.py
Normal file
@ -21,6 +21,7 @@ import mock
|
||||
import re
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
from xml.dom import minidom
|
||||
|
||||
from cinder import context
|
||||
@ -2182,6 +2183,11 @@ class HuaweiTestBase(test.TestCase):
|
||||
self.cg = fake_consistencygroup.fake_consistencyobject_obj(
|
||||
admin_contex, id=ID, status='available')
|
||||
|
||||
self.patcher = mock.patch(
|
||||
'oslo_service.loopingcall.FixedIntervalLoopingCall',
|
||||
new=utils.ZeroIntervalLoopingCall)
|
||||
self.patcher.start()
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class HuaweiISCSIDriverTestCase(HuaweiTestBase):
|
||||
@ -2190,6 +2196,7 @@ class HuaweiISCSIDriverTestCase(HuaweiTestBase):
|
||||
super(HuaweiISCSIDriverTestCase, self).setUp()
|
||||
self.configuration = mock.Mock(spec=conf.Configuration)
|
||||
self.configuration.hypermetro_devices = hypermetro_devices
|
||||
self.flags(rpc_backend='oslo_messaging._drivers.impl_fake')
|
||||
self.stubs.Set(time, 'sleep', Fake_sleep)
|
||||
self.driver = FakeISCSIStorage(configuration=self.configuration)
|
||||
self.driver.do_setup()
|
||||
@ -2262,6 +2269,7 @@ class HuaweiISCSIDriverTestCase(HuaweiTestBase):
|
||||
def test_delete_snapshot_success(self):
|
||||
self.driver.delete_snapshot(self.snapshot)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_create_volume_from_snapsuccess(self):
|
||||
self.mock_object(
|
||||
huawei_driver.HuaweiBaseDriver,
|
||||
@ -3224,6 +3232,7 @@ class HuaweiISCSIDriverTestCase(HuaweiTestBase):
|
||||
mock.Mock(return_value=False))
|
||||
self.driver.delete_volume(self.replica_volume)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_wait_volume_online(self):
|
||||
replica = FakeReplicaPairManager(self.driver.client,
|
||||
self.driver.replica_client,
|
||||
@ -3242,6 +3251,7 @@ class HuaweiISCSIDriverTestCase(HuaweiTestBase):
|
||||
self.driver.client,
|
||||
lun_info)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_wait_second_access(self):
|
||||
pair_id = '1'
|
||||
access_ro = constants.REPLICA_SECOND_RO
|
||||
@ -3258,8 +3268,7 @@ class HuaweiISCSIDriverTestCase(HuaweiTestBase):
|
||||
self.assertRaises(exception.VolumeBackendAPIException,
|
||||
common_driver.wait_second_access, pair_id, access_rw)
|
||||
|
||||
@mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
|
||||
new=utils.ZeroIntervalLoopingCall)
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_wait_replica_ready(self):
|
||||
normal_status = {
|
||||
'RUNNINGSTATUS': constants.REPLICA_RUNNING_STATUS_NORMAL,
|
||||
@ -3484,6 +3493,8 @@ class HuaweiISCSIDriverTestCase(HuaweiTestBase):
|
||||
self.assertEqual(self.replica_volume.id, v_id)
|
||||
self.assertEqual('error', v_update['replication_status'])
|
||||
|
||||
@mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
|
||||
new=utils.ZeroIntervalLoopingCall)
|
||||
@mock.patch.object(replication.PairOp, 'is_primary',
|
||||
side_effect=[False, True])
|
||||
@mock.patch.object(replication.ReplicaCommonDriver, 'split')
|
||||
@ -3537,6 +3548,7 @@ class HuaweiISCSIDriverTestCase(HuaweiTestBase):
|
||||
common_driver.protect_second(replica_id)
|
||||
common_driver.unprotect_second(replica_id)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_replication_driver_sync(self):
|
||||
replica_id = TEST_PAIR_ID
|
||||
op = replication.PairOp(self.driver.client)
|
||||
@ -3697,6 +3709,7 @@ class HuaweiFCDriverTestCase(HuaweiTestBase):
|
||||
def setUp(self):
|
||||
super(HuaweiFCDriverTestCase, self).setUp()
|
||||
self.configuration = mock.Mock(spec=conf.Configuration)
|
||||
self.flags(rpc_backend='oslo_messaging._drivers.impl_fake')
|
||||
self.huawei_conf = FakeHuaweiConf(self.configuration, 'FC')
|
||||
self.configuration.hypermetro_devices = hypermetro_devices
|
||||
self.stubs.Set(time, 'sleep', Fake_sleep)
|
||||
@ -3716,7 +3729,8 @@ class HuaweiFCDriverTestCase(HuaweiTestBase):
|
||||
def test_delete_volume_success(self):
|
||||
self.driver.delete_volume(self.volume)
|
||||
|
||||
def test_create_snapshot_success(self):
|
||||
@mock.patch.object(rest_client, 'RestClient')
|
||||
def test_create_snapshot_success(self, mock_client):
|
||||
lun_info = self.driver.create_snapshot(self.snapshot)
|
||||
self.assertEqual(11, lun_info['provider_location'])
|
||||
|
||||
@ -3728,6 +3742,7 @@ class HuaweiFCDriverTestCase(HuaweiTestBase):
|
||||
def test_delete_snapshot_success(self):
|
||||
self.driver.delete_snapshot(self.snapshot)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_create_volume_from_snapsuccess(self):
|
||||
lun_info = self.driver.create_volume_from_snapshot(self.volume,
|
||||
self.volume)
|
||||
@ -3938,7 +3953,8 @@ class HuaweiFCDriverTestCase(HuaweiTestBase):
|
||||
'12')
|
||||
self.assertFalse(result)
|
||||
|
||||
@mock.patch.object(rest_client.RestClient, 'add_lun_to_partition')
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(rest_client, 'RestClient')
|
||||
def test_migrate_volume_success(self, mock_add_lun_to_partition):
|
||||
# Migrate volume without new type.
|
||||
empty_dict = {}
|
||||
@ -4070,7 +4086,8 @@ class HuaweiFCDriverTestCase(HuaweiTestBase):
|
||||
test_new_type, None, test_host)
|
||||
self.assertTrue(retype)
|
||||
|
||||
@mock.patch.object(rest_client.RestClient, 'add_lun_to_partition')
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(rest_client, 'RestClient')
|
||||
@mock.patch.object(
|
||||
huawei_driver.HuaweiBaseDriver,
|
||||
'_get_volume_type',
|
||||
@ -4327,6 +4344,7 @@ class HuaweiFCDriverTestCase(HuaweiTestBase):
|
||||
self.volume,
|
||||
FakeConnector)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_wait_volume_ready_success(self):
|
||||
flag = self.driver.metro._wait_volume_ready("11")
|
||||
self.assertIsNone(flag)
|
0
cinder/tests/unit/volume/drivers/ibm/__init__.py
Normal file
0
cinder/tests/unit/volume/drivers/ibm/__init__.py
Normal file
@ -26,7 +26,8 @@ import random
|
||||
from cinder import context
|
||||
from cinder import exception
|
||||
from cinder import test
|
||||
from cinder.tests.unit import test_ibm_flashsystem as fscommon
|
||||
from cinder.tests.unit.volume.drivers.ibm \
|
||||
import test_ibm_flashsystem as fscommon
|
||||
from cinder import utils
|
||||
from cinder.volume import configuration as conf
|
||||
from cinder.volume.drivers.ibm import flashsystem_iscsi
|
@ -293,8 +293,9 @@ class XIVDS8KVolumeDriverTest(test.TestCase):
|
||||
|
||||
configuration = mock.Mock(conf.Configuration)
|
||||
configuration.san_is_local = False
|
||||
configuration.xiv_ds8k_proxy = \
|
||||
'cinder.tests.unit.test_ibm_xiv_ds8k.XIVDS8KFakeProxyDriver'
|
||||
configuration.xiv_ds8k_proxy = (
|
||||
'cinder.tests.unit.volume.drivers.ibm.' +
|
||||
'test_ibm_xiv_ds8k.XIVDS8KFakeProxyDriver')
|
||||
configuration.xiv_ds8k_connection_type = 'iscsi'
|
||||
configuration.xiv_chap = 'disabled'
|
||||
configuration.san_ip = FAKE
|
@ -19,8 +19,8 @@ import mock
|
||||
|
||||
from cinder import exception
|
||||
from cinder import test
|
||||
from cinder.tests.unit import test_infortrend_cli
|
||||
from cinder.tests.unit import utils
|
||||
from cinder.tests.unit.volume.drivers.infortrend import test_infortrend_cli
|
||||
from cinder.volume import configuration
|
||||
from cinder.volume.drivers.infortrend.eonstor_ds_cli import common_cli
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import time
|
||||
import unittest
|
||||
|
||||
from eventlet import greenthread
|
||||
import mock
|
||||
@ -528,6 +529,7 @@ class DellEQLSanISCSIDriverTestCase(test.TestCase):
|
||||
self.assertEqual(num_attempts + 1,
|
||||
self.driver._ssh_execute.call_count)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@mock.patch.object(greenthread, 'sleep')
|
||||
def test_ensure_retries_on_channel_timeout(self, _gt_sleep):
|
||||
num_attempts = 3
|
||||
@ -557,6 +559,7 @@ class DellEQLSanISCSIDriverTestCase(test.TestCase):
|
||||
|
||||
self.assertEqual(num_attempts + 1, self.driver._get_output.call_count)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
def test_with_timeout(self):
|
||||
@eqlx.with_timeout
|
||||
def no_timeout(cmd, *args, **kwargs):
|
@ -19,6 +19,7 @@ import ddt
|
||||
import math
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
from oslo_utils import imageutils
|
||||
@ -184,6 +185,7 @@ class RBDTestCase(test.TestCase):
|
||||
self.assertRaises(exception.InvalidConfigurationValue,
|
||||
self.driver.check_for_setup_error)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_create_volume(self):
|
||||
client = self.mock_client.return_value
|
||||
@ -202,6 +204,7 @@ class RBDTestCase(test.TestCase):
|
||||
client.__enter__.assert_called_once_with()
|
||||
client.__exit__.assert_called_once_with(None, None, None)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_manage_existing_get_size(self):
|
||||
with mock.patch.object(self.driver.rbd.Image(), 'size') as \
|
||||
@ -217,6 +220,7 @@ class RBDTestCase(test.TestCase):
|
||||
mock_rbd_image_size.assert_called_once_with()
|
||||
mock_rbd_image_close.assert_called_once_with()
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_manage_existing_get_non_integer_size(self):
|
||||
rbd_image = self.driver.rbd.Image.return_value
|
||||
@ -244,6 +248,7 @@ class RBDTestCase(test.TestCase):
|
||||
mock_rbd_image_size.assert_called_once_with()
|
||||
mock_rbd_image_close.assert_called_once_with()
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_manage_existing(self):
|
||||
client = self.mock_client.return_value
|
||||
@ -260,6 +265,7 @@ class RBDTestCase(test.TestCase):
|
||||
exist_volume,
|
||||
self.volume_a.name)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_manage_existing_with_exist_rbd_image(self):
|
||||
client = self.mock_client.return_value
|
||||
@ -290,6 +296,7 @@ class RBDTestCase(test.TestCase):
|
||||
self.assertTrue(
|
||||
self.driver.rbd.Image.return_value.remove_snap.called)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_delete_volume(self):
|
||||
client = self.mock_client.return_value
|
||||
@ -327,6 +334,7 @@ class RBDTestCase(test.TestCase):
|
||||
# Make sure the exception was raised
|
||||
self.assertEqual(RAISED_EXCEPTIONS, [self.mock_rbd.ImageNotFound])
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_delete_busy_volume(self):
|
||||
self.mock_rbd.Image.return_value.list_snaps.return_value = []
|
||||
@ -361,6 +369,7 @@ class RBDTestCase(test.TestCase):
|
||||
# Make sure the exception was raised
|
||||
self.assertIn(self.mock_rbd.ImageBusy, RAISED_EXCEPTIONS)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_delete_volume_not_found(self):
|
||||
self.mock_rbd.Image.return_value.list_snaps.return_value = []
|
||||
@ -570,6 +579,7 @@ class RBDTestCase(test.TestCase):
|
||||
self.assertFalse(volume.set_snap.called)
|
||||
volume.parent_info.assert_called_once_with()
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_create_cloned_volume_same_size(self):
|
||||
self.cfg.rbd_max_clone_depth = 2
|
||||
@ -596,6 +606,7 @@ class RBDTestCase(test.TestCase):
|
||||
self.assertEqual(
|
||||
0, mock_resize.call_count)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_create_cloned_volume_different_size(self):
|
||||
self.cfg.rbd_max_clone_depth = 2
|
||||
@ -623,6 +634,7 @@ class RBDTestCase(test.TestCase):
|
||||
self.assertEqual(
|
||||
1, mock_resize.call_count)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_create_cloned_volume_w_flatten(self):
|
||||
self.cfg.rbd_max_clone_depth = 1
|
||||
@ -659,6 +671,7 @@ class RBDTestCase(test.TestCase):
|
||||
2, self.mock_rbd.Image.return_value.close.call_count)
|
||||
self.assertTrue(mock_get_clone_depth.called)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_create_cloned_volume_w_clone_exception(self):
|
||||
self.cfg.rbd_max_clone_depth = 2
|
||||
@ -711,6 +724,7 @@ class RBDTestCase(test.TestCase):
|
||||
self.assertFalse(
|
||||
self.driver._is_cloneable(loc, {'disk_format': 'raw'}))
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_cloneable(self):
|
||||
with mock.patch.object(self.driver, '_get_fsid') as mock_get_fsid:
|
||||
@ -872,6 +886,7 @@ class RBDTestCase(test.TestCase):
|
||||
self.assertDictMatch(expected, actual)
|
||||
self.assertTrue(mock_get_mon_addrs.called)
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@ddt.data({'rbd_chunk_size': 1, 'order': 20},
|
||||
{'rbd_chunk_size': 8, 'order': 23},
|
||||
{'rbd_chunk_size': 32, 'order': 25})
|
||||
@ -946,6 +961,7 @@ class RBDTestCase(test.TestCase):
|
||||
self.assertTrue(self.driver.retype(context, volume,
|
||||
fake_type, diff, host))
|
||||
|
||||
@unittest.skip("Skip until bug #1578986 is fixed")
|
||||
@common_mocks
|
||||
def test_update_migrated_volume(self):
|
||||
client = self.mock_client.return_value
|
0
cinder/tests/unit/volume/drivers/violin/__init__.py
Normal file
0
cinder/tests/unit/volume/drivers/violin/__init__.py
Normal file
@ -27,7 +27,8 @@ from cinder import context
|
||||
from cinder import exception
|
||||
from cinder import test
|
||||
from cinder.tests.unit import fake_constants as fake
|
||||
from cinder.tests.unit import fake_vmem_client as vmemclient
|
||||
from cinder.tests.unit.volume.drivers.violin \
|
||||
import fake_vmem_client as vmemclient
|
||||
from cinder.volume import configuration as conf
|
||||
from cinder.volume.drivers.violin import v7000_common
|
||||
from cinder.volume import volume_types
|
@ -21,7 +21,8 @@ import mock
|
||||
|
||||
from cinder import exception
|
||||
from cinder import test
|
||||
from cinder.tests.unit import fake_vmem_client as vmemclient
|
||||
from cinder.tests.unit.volume.drivers.violin \
|
||||
import fake_vmem_client as vmemclient
|
||||
from cinder.volume import configuration as conf
|
||||
from cinder.volume.drivers.violin import v7000_common
|
||||
from cinder.volume.drivers.violin import v7000_fcp
|
0
cinder/tests/unit/volume/drivers/vmware/__init__.py
Normal file
0
cinder/tests/unit/volume/drivers/vmware/__init__.py
Normal file
Loading…
x
Reference in New Issue
Block a user