'Test volume migration done by driver.'

def test_migrate_volume_driver(self):

    self.mock_object(self.volume.driver, 'migrate_volume', (lambda x, y, z, new_type_id=None: (True, {'user_id': fake.USER_ID})))
    volume = tests_utils.create_volume(self.context, size=0, host=CONF.host, migration_status='migrating')
    host_obj = {'host': 'newhost', 'capabilities': {}}
    self.volume.migrate_volume(self.context, volume, host_obj, False)
    volume = objects.Volume.get_by_id(context.get_admin_context(), volume.id)
    self.assertEqual('newhost', volume.host)
    self.assertEqual('success', volume.migration_status)
