Merge "VFC Migration mapping string vios reversal"

This commit is contained in:
Jenkins 2015-11-03 13:35:09 +00:00 committed by Gerrit Code Review
commit 09eb2a565d
2 changed files with 7 additions and 0 deletions

View File

@ -469,6 +469,7 @@ class TestNPIVAdapter(test_vol.TestVolumeAdapter):
dest_mig_data = {}
mock_build_mig_map.side_effect = [['a'], ['b']]
self.vol_drv.stg_ftsk = mock.MagicMock()
# Execute the test
self.vol_drv.pre_live_migration_on_destination(
@ -481,6 +482,9 @@ class TestNPIVAdapter(test_vol.TestVolumeAdapter):
self.assertEqual({'b', 'a'},
set(dest_mig_data.get('vfc_lpm_mappings')))
# Verify that on migration, the WWPNs are reversed.
self.assertEqual(2, self.vol_drv.stg_ftsk.feed.reverse.call_count)
def test_set_fabric_meta(self):
port_map = [('1', 'aa AA'), ('2', 'bb BB'),
('3', 'cc CC'), ('4', 'dd DD'),

View File

@ -145,6 +145,9 @@ class NPIVVolumeAdapter(v_driver.FibreChannelVolumeAdapter):
fabric_mapping = pvm_vfcm.build_migration_mappings_for_fabric(
vios_wraps, self._fabric_ports(fabric), slots)
dest_mig_data['npiv_fabric_mapping_%s' % fabric] = fabric_mapping
# Reverse the vios wrapper so that the other fabric will get the
# on the second vios.
vios_wraps.reverse()
# Collate all of the individual fabric mappings into a single element.
full_map = []