'Tests managing a mapped volume with override.
This test case attempts to manage an existing volume by UID, when it
already mapped to a host, but the ref specifies that this is OK.
We verify that the backend volume was renamed to have the name of the
Cinder volume that we asked for it to be associated with.'

def test_manage_existing_good_uid_mapped_with_override(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)
    new_volume = self._generate_vol_info()
    ref = {'source-id': uid, 'manage_if_in_use': True}
    size = self.driver.manage_existing_get_size(new_volume, ref)
    self.assertEqual(10, size)
    self.driver.manage_existing(new_volume, ref)
    uid_of_new_volume = self._get_vdisk_uid(new_volume['name'])
    self.assertEqual(uid, uid_of_new_volume)
