2012-06-26 09:44:54 -05:00
#!/bin/sh
# Copyright (C) 2012 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 11:49:46 +01:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2012-06-26 09:44:54 -05:00
2016-02-22 16:13:42 -06:00
SKIP_WITH_LVMLOCKD = 1
2015-10-27 15:10:06 +01:00
SKIP_WITH_LVMPOLLD = 1
2012-06-26 09:44:54 -05:00
2015-10-27 15:10:06 +01:00
. lib/inittest
2015-05-09 00:59:18 +01:00
2014-05-23 22:35:05 +02:00
aux have_raid 1 3 0 || skip
2012-07-17 10:50:21 -05:00
2014-03-18 10:26:42 +01:00
aux prepare_pvs 6 80
vgcreate -s 256K $vg $( cat DEVICES)
2012-06-26 09:44:54 -05:00
for deactivate in true false; do
2013-06-15 11:21:03 +02:00
# Extend and reduce a 2-way RAID1
2012-06-26 09:44:54 -05:00
lvcreate --type raid1 -m 1 -l 2 -n $lv1 $vg
2015-09-11 20:54:43 +02:00
test $deactivate && {
aux wait_for_sync $vg $lv1
lvchange -an $vg /$lv1
}
2012-06-26 09:44:54 -05:00
lvresize -l +2 $vg /$lv1
2012-08-24 16:20:53 -05:00
should lvresize -y -l -2 $vg /$lv1
2012-06-26 09:44:54 -05:00
#check raid_images_contiguous $vg $lv1
2013-06-15 11:21:03 +02:00
# Extend and reduce 3-striped RAID 4/5/6
for i in 4 5 6 ; do
lvcreate --type raid$i -i 3 -l 3 -n $lv2 $vg
2012-06-26 09:44:54 -05:00
2015-09-11 20:54:43 +02:00
test $deactivate && {
aux wait_for_sync $vg $lv2
lvchange -an $vg /$lv2
}
2012-06-26 09:44:54 -05:00
2013-06-15 11:21:03 +02:00
lvresize -l +3 $vg /$lv2
2012-06-26 09:44:54 -05:00
#check raid_images_contiguous $vg $lv1
2013-06-15 11:21:03 +02:00
should lvresize -y -l -3 $vg /$lv2
2012-06-26 09:44:54 -05:00
#check raid_images_contiguous $vg $lv1
lvremove -ff $vg
done
done
2013-09-24 21:32:53 -05:00
# Bug 1005434
# Ensure extend is contiguous
2014-03-19 23:32:25 +01:00
lvcreate --type raid4 -l 2 -i 2 -n $lv1 $vg " $dev4 " " $dev5 " " $dev6 "
2013-09-24 21:32:53 -05:00
lvextend -l +2 --alloc contiguous $vg /$lv1
2014-03-18 10:26:42 +01:00
check lv_tree_on $vg $lv1 " $dev4 " " $dev5 " " $dev6 "
2013-09-24 21:32:53 -05:00
2014-03-18 10:26:42 +01:00
vgremove -f $vg