'Tests managing a mapped volume with no override.
This test case attempts to manage an existing volume by UID, but
the volume is mapped to a host, so we expect to see an exception
raised.'

def test_manage_existing_mapped(self):

    (volume, uid) = self._create_volume_and_return_uid('manage_test')
    conn = {'initiator': u'unicode:initiator3', 'ip': '10.10.10.12', 'host': u'unicode.foo}.bar}.baz'}
    self.driver.initialize_connection(volume, conn)
    volume = self._generate_vol_info()
    ref = {'source-id': uid}
    self.assertRaises(exception.ManageExistingInvalidReference, self.driver.manage_existing_get_size, volume, ref)
    ref = {'source-name': volume['name']}
    self.assertRaises(exception.ManageExistingInvalidReference, self.driver.manage_existing_get_size, volume, ref)
