diff --git a/cinder/tests/unit/volume/drivers/ibm/test_ds8k_proxy.py b/cinder/tests/unit/volume/drivers/ibm/test_ds8k_proxy.py index 0ff06758abc..f89221d74a3 100644 --- a/cinder/tests/unit/volume/drivers/ibm/test_ds8k_proxy.py +++ b/cinder/tests/unit/volume/drivers/ibm/test_ds8k_proxy.py @@ -60,7 +60,7 @@ TEST_SOURCE_DS8K_IP = '1.1.1.1' TEST_TARGET_DS8K_IP = '2.2.2.2' TEST_SOURCE_WWNN = '5000000000FFC111' TEST_TARGET_WWNN = '5000000000FFD222' -TEST_SOURCE_WWPN_1 = '10000090FA3418BC' +TEST_SOURCE_WWPN_1 = '10000090fa3418bc' TEST_SOURCE_WWPN_2 = '10000090FA3418BD' TEST_SOURCE_IOPORT = 'I0001' TEST_TARGET_IOPORT = 'I0002' @@ -2707,6 +2707,12 @@ class DS8KProxyTest(test.TestCase): map_data = self.driver.initialize_connection(volume, TEST_CONNECTOR) self.assertEqual(int(TEST_LUN_ID), map_data['data']['target_lun']) + self.assertTrue( + list(map_data['data']['initiator_target_map'].keys())[0] in + [TEST_SOURCE_WWPN_1, TEST_SOURCE_WWPN_2]) + self.assertTrue( + list(map_data['data']['initiator_target_map'].keys())[1] in + [TEST_SOURCE_WWPN_1, TEST_SOURCE_WWPN_2]) def test_initialize_connection_of_eckd_volume(self): """attach a ECKD volume to host.""" diff --git a/cinder/volume/drivers/ibm/ibm_storage/ds8k_helper.py b/cinder/volume/drivers/ibm/ibm_storage/ds8k_helper.py index 50200f2f3ae..d1d5ddc5859 100644 --- a/cinder/volume/drivers/ibm/ibm_storage/ds8k_helper.py +++ b/cinder/volume/drivers/ibm/ibm_storage/ds8k_helper.py @@ -662,7 +662,7 @@ class DS8KCommonHelper(object): 'target_lun': int(lun_id, 16), 'target_wwn': target_ports, 'initiator_target_map': {initiator: target_ports for - initiator in host_wwpn_set} + initiator in connector['wwpns']} } }