2017-07-02 22:38:32 +03:00
#!/usr/bin/env bash
2015-12-11 22:11:11 +03:00
# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2016-01-21 13:49:46 +03:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2015-12-11 22:11:11 +03:00
# Check rename of stacked thin over cached LV
2018-05-24 17:49:48 +03:00
2015-12-11 22:11:11 +03:00
SKIP_WITH_LVMPOLLD = 1
. lib/inittest
aux have_cache 1 3 0 || skip
aux have_thin 1 0 0 || skip
aux prepare_vg 1 80
lvcreate -L10 -n cpool $vg
lvcreate -L10 -n tpool $vg
lvcreate -L10 -n $lv1 $vg
2018-08-17 23:45:52 +03:00
lvconvert --yes --type cache-pool $vg /cpool
2015-12-11 22:11:11 +03:00
lvconvert --yes --cache --cachepool cpool $vg /tpool
# currently the only allowed stacking is cache thin data volume
lvconvert --yes --type thin-pool $vg /tpool
lvcreate -V10 $vg /tpool
# check cache pool remains same after thin-pool rename
lvrename $vg /tpool $vg /newpool
2019-10-21 16:11:51 +03:00
check lv_exists $vg newpool cpool_cpool
2015-12-11 22:11:11 +03:00
check lv_not_exists $vg tpool
# allowing rename of internal cache pool
2019-10-21 16:11:51 +03:00
lvrename $vg /cpool_cpool $vg /cachepool
2015-12-11 22:11:11 +03:00
check lv_exists $vg cachepool
2019-10-21 16:11:51 +03:00
check lv_not_exists $vg cpool_cpool
2015-12-11 22:11:11 +03:00
lvs -a $vg
vgremove -f $vg