'create replicated volume when multiple pprc paths are available.'

@mock.patch.object(helper.DS8KCommonHelper, 'get_pprc_paths')
@mock.patch.object(eventlet, 'sleep')
def test_create_fb_replicated_vol_when_paths_available(self, mock_sleep, get_pprc_paths):

    self.configuration.replication_device = [TEST_REPLICATION_DEVICE]
    self.driver = FakeDS8KProxy(self.storage_info, self.logger, self.exception, self)
    self.driver.setup(self.ctxt)
    extra_spec = {'replication_enabled': '<is>    True'}
    vol_type = volume_types.create(self.ctxt, 'VOL_TYPE', extra_spec)
    volume = self._create_volume(volume_type_id=vol_type.id)
    get_pprc_paths.return_value = [{'source_lss_id': TEST_LSS_ID_1, 'target_lss_id': TEST_LSS_ID_1, 'port_pairs': [{'source_port_id': TEST_SOURCE_IOPORT, 'target_port_id': TEST_TARGET_IOPORT, 'state': 'success'}], 'target_system_wwnn': TEST_TARGET_WWNN}, {'source_lss_id': TEST_LSS_ID_3, 'target_lss_id': TEST_LSS_ID_3, 'port_pairs': [{'source_port_id': TEST_SOURCE_IOPORT, 'target_port_id': TEST_TARGET_IOPORT, 'state': 'success'}], 'target_system_wwnn': TEST_TARGET_WWNN}]
    vol = self.driver.create_volume(volume)
    self.assertEqual(TEST_LSS_ID_1, ast.literal_eval(vol['provider_location'])['vol_hex_id'][:2])
    repl = eval(vol['metadata']['replication'])
    self.assertEqual(TEST_LSS_ID_1, repl[TEST_TARGET_DS8K_IP]['vol_hex_id'][:2])
