2012-12-12 15:51:28 +04: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,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2014-06-06 19:40:04 +04:00
. lib/inittest
2012-12-12 15:51:28 +04:00
test -e LOCAL_LVMETAD || skip
2015-05-09 02:59:18 +03:00
test -e LOCAL_LVMPOLLD && skip
2014-06-30 23:00:08 +04:00
kill $( < LOCAL_LVMETAD)
2012-12-12 15:51:28 +04:00
rm LOCAL_LVMETAD
aux prepare_devs 2
2014-03-20 02:32:25 +04:00
pvcreate --metadatacopies 0 " $dev1 "
pvcreate --metadatacopies 1 " $dev2 "
vgcreate $vg1 " $dev1 " " $dev2 "
2012-12-12 15:51:28 +04:00
lvcreate -n foo -l 1 -an --zero n $vg1
# start lvmetad but make sure it doesn't know about $dev1 or $dev2
2015-04-30 22:51:43 +03:00
aux disable_dev " $dev1 " " $dev2 "
2012-12-12 15:51:28 +04:00
aux prepare_lvmetad
lvs
mv LOCAL_LVMETAD XXX
2015-04-30 22:51:43 +03:00
aux enable_dev " $dev2 " " $dev1 "
2012-12-12 15:51:28 +04:00
mv XXX LOCAL_LVMETAD
aux lvmconf 'global/use_lvmetad = 0'
check inactive $vg1 foo
aux lvmconf 'global/use_lvmetad = 1'
2014-03-20 02:32:25 +04:00
pvscan --cache " $dev2 " -aay
2012-12-12 15:51:28 +04:00
aux lvmconf 'global/use_lvmetad = 0'
check inactive $vg1 foo
aux lvmconf 'global/use_lvmetad = 1'
2014-03-20 02:32:25 +04:00
pvscan --cache " $dev1 " -aay
2012-12-12 15:51:28 +04:00
aux lvmconf 'global/use_lvmetad = 0'
check active $vg1 foo
aux lvmconf 'global/use_lvmetad = 1'
2014-02-27 02:25:30 +04:00
vgremove -ff $vg1