'Test a target when the host is in a foreign host group.
Should raise an error stating the volume is mapped to an
unsupported host group.'

def test_map_volume_to_multiple_hosts_volume_mapped_to_foreign_host_group(self):

    fake_eseries_volume = copy.deepcopy(eseries_fakes.VOLUME)
    fake_volume_mapping = copy.deepcopy(eseries_fakes.VOLUME_MAPPING)
    fake_ref = '8500000060080E500023C7340036035F515B78FD'
    fake_volume_mapping['mapRef'] = fake_ref
    self.mock_object(self.client, 'list_volumes', return_value=[fake_eseries_volume])
    fake_host = copy.deepcopy(eseries_fakes.HOST)
    fake_host['clusterRef'] = utils.NULL_REF
    self.mock_object(self.client, 'get_host_group', return_value=eseries_fakes.FOREIGN_HOST_GROUP)
    err = self.assertRaises(exception.NetAppDriverException, host_mapper.map_volume_to_multiple_hosts, self.client, get_fake_volume(), eseries_fakes.VOLUME, fake_host, fake_volume_mapping)
    self.assertIn('unsupported    host    group', six.text_type(err))
