Browse Source

Merge "iSCSI driver initialization should fail for Primera backend"

changes/34/695034/1
Zuul 2 weeks ago
parent
commit
6b0624f4d3
2 changed files with 20 additions and 2 deletions
  1. +11
    -1
      cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py
  2. +9
    -1
      cinder/volume/drivers/hpe/hpe_3par_iscsi.py

+ 11
- 1
cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py View File

@@ -733,7 +733,8 @@ class HPE3PARBaseDriver(test.TestCase):
'hpe3parclient.client.HPE3ParClient',
spec=True,
)
def setup_mock_client(self, _m_client, driver, conf=None, m_conf=None):
def setup_mock_client(self, _m_client, driver, conf=None, m_conf=None,
is_primera=False):

_m_client = _m_client.return_value

@@ -742,6 +743,8 @@ class HPE3PARBaseDriver(test.TestCase):

_m_client.getWsApiVersion.return_value = self.wsapi_version_latest

_m_client.is_primera_array.return_value = is_primera

# If m_conf, drop those over the top of the base_conf.
if m_conf is not None:
_m_client.configure_mock(**m_conf)
@@ -8667,10 +8670,12 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):
mock.call.getCPG(HPE3PAR_CPG),
mock.call.getCPG(HPE3PAR_CPG2)]
expected_get_ports = [mock.call.getPorts()]
expected_primera_check = [mock.call.is_primera_array()]
mock_client.assert_has_calls(
self.standard_login +
expected_get_cpgs +
self.standard_logout +
expected_primera_check +
self.standard_login +
expected_get_ports +
self.standard_logout)
@@ -8678,6 +8683,11 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):

return mock_client

def test_iscsi_primera(self):
self.assertRaises(NotImplementedError, self.setup_mock_client,
driver=hpedriver.HPE3PARISCSIDriver,
is_primera=True)

def test_initialize_connection(self):
# setup_mock_client drive with default configuration
# and return the mock HTTP 3PAR client

+ 9
- 1
cinder/volume/drivers/hpe/hpe_3par_iscsi.py View File

@@ -127,10 +127,11 @@ class HPE3PARISCSIDriver(hpebasedriver.HPE3PARDriverBase):
4.0.3 - Set proper backend on subsequent operation, after group
failover. bug #1773069
4.0.4 - Added Peer Persistence feature
4.0.5 - Added Primera array check. bug #1849525

"""

VERSION = "4.0.4"
VERSION = "4.0.5"

# The name of the CI wiki page.
CI_WIKI_NAME = "HPE_Storage_CI"
@@ -140,6 +141,13 @@ class HPE3PARISCSIDriver(hpebasedriver.HPE3PARDriverBase):
self.protocol = 'iSCSI'

def _do_setup(self, common):
client_obj = common.client
is_primera = client_obj.is_primera_array()
if is_primera:
LOG.error("For Primera, only FC is supported. "
"iSCSI cannot be used")
raise NotImplementedError()

self.iscsi_ips = {}
common.client_login()
try:

Loading…
Cancel
Save