2012-03-16 17:00:05 +04:00
#!/bin/sh
2014-03-28 03:37:39 +04:00
# Copyright (C) 2008-2014 Red Hat, Inc. All rights reserved.
2008-08-13 17:49:07 +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,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
2014-03-28 03:37:39 +04:00
# tests functionality we don't have in other special test files yet
# to improve code coverage
2008-08-13 17:49:07 +04:00
#
2014-06-06 19:40:04 +04:00
. lib/inittest
2008-08-13 17:49:07 +04:00
2015-05-09 02:59:18 +03:00
test -e LOCAL_LVMPOLLD && skip
2014-03-28 03:37:39 +04:00
aux prepare_pvs 5
2014-06-05 15:01:43 +04:00
get_devs
2008-09-29 20:02:50 +04:00
2012-03-16 17:00:05 +04:00
pvcreate --metadatacopies 0 " $dev2 "
pvcreate --metadatacopies 0 " $dev3 "
2014-03-28 03:37:39 +04:00
# FIXME takes very long time
#pvck "$dev1"
2014-06-05 15:01:43 +04:00
vgcreate $vg " ${ DEVICES [@] } "
2008-08-13 17:49:07 +04:00
2014-03-28 03:37:39 +04:00
lvcreate -l 5 -i5 -I256 -n $lv $vg
2014-03-26 03:22:23 +04:00
lvcreate -aey -l 5 -n $lv1 $vg
2014-03-26 02:55:45 +04:00
lvcreate -s -l 5 -n $lv2 $vg /$lv1
2014-03-28 03:37:39 +04:00
pvck " $dev1 "
2014-03-26 02:55:45 +04:00
2008-08-13 17:49:07 +04:00
# "-persistent y --major 254 --minor 20"
2008-08-20 17:34:33 +04:00
# "-persistent n"
2014-03-31 13:44:55 +04:00
for i in pr "p rw" "-monitor y" "-monitor n" -refresh; do
2012-10-15 15:18:32 +04:00
lvchange -$i $vg /$lv
done
2008-08-13 17:49:07 +04:00
2012-03-16 17:00:05 +04:00
lvrename $vg $lv $lv -rename
2014-03-31 13:44:55 +04:00
invalid lvrename $vg
invalid lvrename $vg $vg /$lv -rename $vg1 /$lv
invalid lvrename $vg /$lv -rename $vg1 /$lv $vg
invalid lvrename $vg /$lv -rename $vg /012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
invalid lvrename $vg /$lv -rename $vg /""
invalid lvrename $vg /$lv -rename " $vg /!@# $% "
invalid lvrename $vg /$lv -rename $vg /$lv -rename
fail lvrename $vg1 /$lv -rename $vg1 /$lv
2014-03-28 03:37:39 +04:00
2012-03-16 17:00:05 +04:00
vgremove -f $vg
2014-03-24 13:00:39 +04:00
2014-03-28 03:37:39 +04:00
2014-03-24 13:00:39 +04:00
# test pvresize functionality
2014-03-26 02:55:45 +04:00
# missing params
2014-03-24 13:00:39 +04:00
not pvresize
2014-03-26 02:55:45 +04:00
# negative size
2014-03-24 13:00:39 +04:00
not pvresize --setphysicalvolumesize -10M " $dev1 "
2014-03-26 02:55:45 +04:00
# not existing device
not pvresize --setphysicalvolumesize 10M " $dev7 "
2008-09-29 20:02:50 +04:00
pvresize --setphysicalvolumesize 10M " $dev1 "
2014-03-24 13:00:39 +04:00
pvresize " $dev1 "
2008-08-13 17:49:07 +04:00
2013-12-03 17:41:25 +04:00
2014-03-28 03:37:39 +04:00
# test various lvm utils
lvm dumpconfig
lvm devtypes
lvm formats
lvm segtypes
lvm tags
# test obsoleted tools
not lvm lvmchange
not lvm lvmsadc
not lvm lvmsar
not lvm pvdata