2012-03-16 13:00:05 +00:00
#!/bin/sh
2014-03-28 00:37:39 +01:00
# Copyright (C) 2008-2014 Red Hat, Inc. All rights reserved.
2008-08-13 13:49:07 +00: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 11:49:46 +01:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2008-08-13 13:49:07 +00:00
#
2014-03-28 00:37:39 +01:00
# tests functionality we don't have in other special test files yet
# to improve code coverage
2008-08-13 13:49:07 +00: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
2008-08-13 13:49:07 +00:00
2015-10-27 15:10:06 +01:00
. lib/inittest
2015-05-09 00:59:18 +01:00
2014-03-28 00:37:39 +01:00
aux prepare_pvs 5
2014-06-05 13:01:43 +02:00
get_devs
2008-09-29 16:02:50 +00:00
2012-03-16 13:00:05 +00:00
pvcreate --metadatacopies 0 " $dev2 "
pvcreate --metadatacopies 0 " $dev3 "
2014-03-28 00:37:39 +01:00
# FIXME takes very long time
#pvck "$dev1"
2014-06-05 13:01:43 +02:00
vgcreate $vg " ${ DEVICES [@] } "
2008-08-13 13:49:07 +00:00
2014-03-28 00:37:39 +01:00
lvcreate -l 5 -i5 -I256 -n $lv $vg
2014-03-26 00:22:23 +01:00
lvcreate -aey -l 5 -n $lv1 $vg
2014-03-25 23:55:45 +01:00
lvcreate -s -l 5 -n $lv2 $vg /$lv1
2014-03-28 00:37:39 +01:00
pvck " $dev1 "
2014-03-25 23:55:45 +01:00
2008-08-13 13:49:07 +00:00
# "-persistent y --major 254 --minor 20"
2008-08-20 13:34:33 +00:00
# "-persistent n"
2014-03-31 11:44:55 +02:00
for i in pr "p rw" "-monitor y" "-monitor n" -refresh; do
2012-10-15 13:18:32 +02:00
lvchange -$i $vg /$lv
done
2008-08-13 13:49:07 +00:00
2012-03-16 13:00:05 +00:00
lvrename $vg $lv $lv -rename
2014-03-31 11:44:55 +02: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 00:37:39 +01:00
2012-03-16 13:00:05 +00:00
vgremove -f $vg
2014-03-24 10:00:39 +01:00
2014-03-28 00:37:39 +01:00
2014-03-24 10:00:39 +01:00
# test pvresize functionality
2014-03-25 23:55:45 +01:00
# missing params
2014-03-24 10:00:39 +01:00
not pvresize
2014-03-25 23:55:45 +01:00
# negative size
2014-03-24 10:00:39 +01:00
not pvresize --setphysicalvolumesize -10M " $dev1 "
2014-03-25 23:55:45 +01:00
# not existing device
not pvresize --setphysicalvolumesize 10M " $dev7 "
2008-09-29 16:02:50 +00:00
pvresize --setphysicalvolumesize 10M " $dev1 "
2014-03-24 10:00:39 +01:00
pvresize " $dev1 "
2008-08-13 13:49:07 +00:00
2013-12-03 14:41:25 +01:00
2014-03-28 00:37:39 +01: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