Merge "Update unity tests to use our test base"

This commit is contained in:
Zuul 2017-12-11 21:13:08 +00:00 committed by Gerrit Code Review
commit 5d4d70d69b
2 changed files with 14 additions and 5 deletions

View File

@ -15,12 +15,12 @@
import contextlib
import functools
import unittest
import mock
from oslo_utils import units
from cinder import exception
from cinder import test
from cinder.tests.unit.volume.drivers.dell_emc.unity \
import fake_exception as ex
from cinder.tests.unit.volume.drivers.dell_emc.unity import test_client
@ -329,8 +329,9 @@ class IdMatcher(object):
########################
@mock.patch.object(adapter, 'storops_ex', new=ex)
class CommonAdapterTest(unittest.TestCase):
class CommonAdapterTest(test.TestCase):
def setUp(self):
super(CommonAdapterTest, self).setUp()
self.adapter = mock_adapter(adapter.CommonAdapter)
def test_get_managed_pools(self):
@ -686,8 +687,9 @@ class CommonAdapterTest(unittest.TestCase):
self.adapter.normalize_config(config)
class FCAdapterTest(unittest.TestCase):
class FCAdapterTest(test.TestCase):
def setUp(self):
super(FCAdapterTest, self).setUp()
self.adapter = mock_adapter(adapter.FCAdapter)
def test_setup(self):
@ -799,8 +801,9 @@ class FCAdapterTest(unittest.TestCase):
self.adapter.validate_ports(['spa_iom*', 'spc_invalid'])
class ISCSIAdapterTest(unittest.TestCase):
class ISCSIAdapterTest(test.TestCase):
def setUp(self):
super(ISCSIAdapterTest, self).setUp()
self.adapter = mock_adapter(adapter.ISCSIAdapter)
def test_iscsi_protocol(self):

View File

@ -264,10 +264,16 @@ class CommonAdapter(object):
:param volume: volume information
"""
params = VolumeParams(self, volume)
log_params = {
'name': params.name,
'size': params.size,
'description': params.description,
'pool': params.pool,
'io_limit_policy': params.io_limit_policy}
LOG.info('Create Volume: %(name)s, size: %(size)s, description: '
'%(description)s, pool: %(pool)s, io limit policy: '
'%(io_limit_policy)s.', params)
'%(io_limit_policy)s.', log_params)
return self.makeup_model(
self.client.create_lun(name=params.name,