Rebase rename pypowervm.tasks.wwpn to vfc_mapper
pypowervm.tasks.wwpn was recently renamed to vfc_mapper. Accomodate the change. Change-Id: Ic988d67a8402d558e262831a8cfc1fe41b4b794e
This commit is contained in:
@@ -73,8 +73,8 @@ class TestNPIVAdapter(test.TestCase):
|
||||
self.mock_fabric_names_p.stop()
|
||||
self.mock_fabric_ports_p.stop()
|
||||
|
||||
@mock.patch('pypowervm.tasks.wwpn.add_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.wwpn.remove_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.add_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.remove_npiv_port_mappings')
|
||||
def test_connect_volume(self, mock_remove_p_maps, mock_add_p_maps):
|
||||
# Invoke
|
||||
inst = mock.MagicMock()
|
||||
@@ -93,8 +93,8 @@ class TestNPIVAdapter(test.TestCase):
|
||||
fc_state = self.vol_drv._get_fabric_state(inst, 'A')
|
||||
self.assertEqual(npiv.FS_INST_MAPPED, fc_state)
|
||||
|
||||
@mock.patch('pypowervm.tasks.wwpn.add_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.wwpn.remove_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.add_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.remove_npiv_port_mappings')
|
||||
def test_connect_volume_inst_mapped(self, mock_remove_p_maps,
|
||||
mock_add_p_maps):
|
||||
# Invoke
|
||||
@@ -115,8 +115,8 @@ class TestNPIVAdapter(test.TestCase):
|
||||
fc_state = self.vol_drv._get_fabric_state(inst, 'A')
|
||||
self.assertEqual(npiv.FS_INST_MAPPED, fc_state)
|
||||
|
||||
@mock.patch('pypowervm.tasks.wwpn.add_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.wwpn.remove_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.add_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.remove_npiv_port_mappings')
|
||||
def test_connect_volume_fc_unmap(self, mock_remove_p_maps,
|
||||
mock_add_p_maps):
|
||||
# Invoke
|
||||
@@ -136,7 +136,7 @@ class TestNPIVAdapter(test.TestCase):
|
||||
fc_state = self.vol_drv._get_fabric_state(inst, 'A')
|
||||
self.assertEqual(npiv.FS_INST_MAPPED, fc_state)
|
||||
|
||||
@mock.patch('pypowervm.tasks.wwpn.remove_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.remove_npiv_port_mappings')
|
||||
def test_disconnect_volume(self, mock_remove_p_maps):
|
||||
# Mock Data
|
||||
inst = mock.MagicMock()
|
||||
@@ -149,7 +149,7 @@ class TestNPIVAdapter(test.TestCase):
|
||||
# Verify
|
||||
self.assertEqual(1, mock_remove_p_maps.call_count)
|
||||
|
||||
@mock.patch('pypowervm.tasks.wwpn.remove_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.remove_npiv_port_mappings')
|
||||
def test_disconnect_volume_no_op(self, mock_remove_p_maps):
|
||||
"""Tests that when the task state is not set, connections are left."""
|
||||
# Mock Data
|
||||
@@ -193,9 +193,9 @@ class TestNPIVAdapter(test.TestCase):
|
||||
# Verify
|
||||
self.assertEqual(0, self.adpt.update.call_count)
|
||||
|
||||
@mock.patch('pypowervm.tasks.wwpn.build_wwpn_pair')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.build_wwpn_pair')
|
||||
@mock.patch('nova_powervm.virt.powervm.mgmt.get_mgmt_partition')
|
||||
@mock.patch('pypowervm.tasks.wwpn.add_npiv_port_mappings')
|
||||
@mock.patch('pypowervm.tasks.vfc_mapper.add_npiv_port_mappings')
|
||||
def test_wwpns(self, mock_add_port, mock_mgmt_part, mock_build_wwpns):
|
||||
"""Tests that new WWPNs get generated properly."""
|
||||
# Mock Data
|
||||
|
||||
@@ -19,7 +19,7 @@ from oslo_log import log as logging
|
||||
|
||||
from nova.compute import task_states
|
||||
from nova.i18n import _LI
|
||||
from pypowervm.tasks import wwpn as pvm_wwpn
|
||||
from pypowervm.tasks import vfc_mapper as pvm_vfcm
|
||||
from pypowervm.wrappers import virtual_io_server as pvm_vios
|
||||
|
||||
from nova_powervm.virt import powervm
|
||||
@@ -87,7 +87,7 @@ class NPIVVolumeAdapter(v_driver.FibreChannelVolumeAdapter):
|
||||
# the instance...so it won't duplicate the settings every time an
|
||||
# attach volume is called.
|
||||
LOG.info(_LI("Adding NPIV mapping for instance %s"), instance.name)
|
||||
pvm_wwpn.add_npiv_port_mappings(adapter, host_uuid, vm_uuid,
|
||||
pvm_vfcm.add_npiv_port_mappings(adapter, host_uuid, vm_uuid,
|
||||
npiv_port_mappings)
|
||||
|
||||
self._set_fabric_state(instance, fabric, FS_INST_MAPPED)
|
||||
@@ -138,7 +138,7 @@ class NPIVVolumeAdapter(v_driver.FibreChannelVolumeAdapter):
|
||||
# into one list, we can call down into pypowervm to remove them in one
|
||||
# action.
|
||||
LOG.info(_LI("Removing NPIV mapping for instance %s"), instance.name)
|
||||
pvm_wwpn.remove_npiv_port_mappings(adapter, host_uuid,
|
||||
pvm_vfcm.remove_npiv_port_mappings(adapter, host_uuid,
|
||||
npiv_port_mappings)
|
||||
|
||||
def wwpns(self, adapter, host_uuid, instance):
|
||||
@@ -184,7 +184,7 @@ class NPIVVolumeAdapter(v_driver.FibreChannelVolumeAdapter):
|
||||
resp_wwpns.extend(v_port_wwpns)
|
||||
|
||||
# Derive the virtual to physical port mapping
|
||||
port_map = pvm_wwpn.derive_npiv_map(vios_wraps,
|
||||
port_map = pvm_vfcm.derive_npiv_map(vios_wraps,
|
||||
self._fabric_ports(fabric),
|
||||
v_port_wwpns)
|
||||
|
||||
@@ -233,7 +233,7 @@ class NPIVVolumeAdapter(v_driver.FibreChannelVolumeAdapter):
|
||||
mg_wrap = mgmt.get_mgmt_partition(adapter)
|
||||
LOG.info(_LI("Adding NPIV Mapping with mgmt partition for "
|
||||
"instance=%s") % instance.name)
|
||||
pvm_wwpn.add_npiv_port_mappings(adapter, host_uuid,
|
||||
pvm_vfcm.add_npiv_port_mappings(adapter, host_uuid,
|
||||
mg_wrap.uuid, npiv_port_map)
|
||||
self._set_fabric_state(instance, fabric, FS_MGMT_MAPPED)
|
||||
return
|
||||
@@ -260,7 +260,7 @@ class NPIVVolumeAdapter(v_driver.FibreChannelVolumeAdapter):
|
||||
if self._get_fabric_state(instance, fabric) == FS_MGMT_MAPPED:
|
||||
LOG.info(_LI("Removing NPIV mapping for mgmt partition "
|
||||
"for instance=%s") % instance.name)
|
||||
pvm_wwpn.remove_npiv_port_mappings(adapter, host_uuid,
|
||||
pvm_vfcm.remove_npiv_port_mappings(adapter, host_uuid,
|
||||
npiv_port_map)
|
||||
self._set_fabric_state(instance, fabric, FS_UNMAPPED)
|
||||
return
|
||||
@@ -368,7 +368,7 @@ class NPIVVolumeAdapter(v_driver.FibreChannelVolumeAdapter):
|
||||
wwpns = []
|
||||
i = 0
|
||||
while i < self._ports_per_fabric():
|
||||
wwpns.extend(pvm_wwpn.build_wwpn_pair(adapter, host_uuid))
|
||||
wwpns.extend(pvm_vfcm.build_wwpn_pair(adapter, host_uuid))
|
||||
i += 1
|
||||
return wwpns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user