'Test that retype returns successfully.'

def test_retype(self):

    self.driver.do_setup(None)
    ctxt = context.get_admin_context()
    host = {'host': 'foo', 'capabilities': {'location_info': 'ibm_storage_fake_1', 'extent_size': '1024'}}
    key_specs_old = {'easytier': False, 'warning': 2, 'autoexpand': True}
    key_specs_new = {'easytier': True, 'warning': 5, 'autoexpand': False}
    old_type_ref = volume_types.create(ctxt, 'old', key_specs_old)
    new_type_ref = volume_types.create(ctxt, 'new', key_specs_new)
    (diff, equal) = volume_types.volume_types_diff(ctxt, old_type_ref['id'], new_type_ref['id'])
    volume = copy.deepcopy(VOLUME)
    old_type = volume_types.get_volume_type(ctxt, old_type_ref['id'])
    volume['volume_type'] = old_type
    volume['host'] = host
    new_type = volume_types.get_volume_type(ctxt, new_type_ref['id'])
    self.driver.create_volume(volume)
    ret = self.driver.retype(ctxt, volume, new_type, diff, host)
    self.assertTrue(ret)
    self.assertEqual('1', volume['easytier'])
