2017-07-02 22:38:32 +03:00
#!/usr/bin/env bash
2016-02-25 23:58:43 +03:00
# Copyright (C) 2007-2016 Red Hat, Inc. All rights reserved.
2008-04-02 16:17:30 +04:00
#
# 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
2008-04-02 16:17:30 +04:00
2016-02-23 01:13:42 +03:00
SKIP_WITH_LVMLOCKD = 1
2015-10-27 17:10:06 +03:00
SKIP_WITH_LVMPOLLD = 1
2008-04-02 16:17:30 +04:00
2015-10-27 17:10:06 +03:00
. lib/inittest
2015-05-09 02:59:18 +03:00
2014-02-26 06:14:18 +04:00
aux prepare_vg 2 80
2008-04-02 16:17:30 +04:00
2008-09-29 20:02:50 +04:00
lvcreate -L 10M -n lv -i2 $vg
lvresize -l +4 $vg /lv
2016-02-25 23:58:43 +03:00
not lvextend -L+0 $vg /lv
not lvextend -l+0 $vg /lv
2008-09-29 20:02:50 +04:00
lvremove -ff $vg
2008-04-02 16:17:30 +04:00
2008-09-29 20:02:50 +04:00
lvcreate -L 64M -n $lv -i2 $vg
not lvresize -v -l +4 xxx/$lv
2014-02-26 06:14:18 +04:00
# Check stripe size is reduced to extent size when it's bigger
ESIZE = $( get vg_field $vg vg_extent_size --units b)
lvextend -L+64m -i 2 -I$(( ${ ESIZE %%B } * 2 )) B $vg /$lv 2>& 1 | tee err
grep "Reducing stripe size" err
2014-04-22 14:47:14 +04:00
lvremove -ff $vg
2014-10-07 11:54:47 +04:00
lvcreate -L 10M -n lv $vg " $dev1 "
lvextend -L +10M $vg /lv " $dev2 "
2017-02-20 00:59:21 +03:00
lvextend --type striped -m0 -L +10M $vg /lv " $dev2 "
2014-04-22 14:47:14 +04:00
# Attempt to reduce with lvextend and vice versa:
not lvextend -L 16M $vg /lv
not lvreduce -L 32M $vg /lv
lvremove -ff $vg
2017-02-20 00:59:21 +03:00
2017-02-21 01:50:27 +03:00
lvcreate --type mirror -aey -L 4 -n $lv1 $vg
2017-02-20 00:59:21 +03:00
# Incorrent name for resized LV
not lvextend --type mirror -L 10 -n $lv1 $vg
# Same size
not lvextend --type mirror -L 4 $vg /$lv1
# Cannot use any '-' or '+' sign for --mirror arg
not lvextend --type mirror -L+2 -m-1 $vg /$lv1
not lvextend --type mirror -L+2 -m+1 $vg /$lv1
lvextend --type mirror -L+4 -m1 $vg /$lv1
lvs -a $vg
check lv_field $vg /$lv1 size "8.00m"
lvremove -ff $vg