2008-11-11 18:29:24 +03:00
#!/bin/sh
# Copyright (C) 2008 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
test_description = 'Exercise some vgchange diagnostics'
2011-01-05 03:16:18 +03:00
. lib/test
2008-11-11 18:29:24 +03:00
aux prepare_pvs 3
2012-03-16 17:00:05 +04:00
pvcreate --metadatacopies 0 " $dev1 "
2011-01-05 03:16:18 +03:00
vgcreate $vg $( cat DEVICES)
2008-11-11 18:29:24 +03:00
vgdisplay $vg
# vgchange -p MaxPhysicalVolumes (bz202232)
2011-01-05 03:16:18 +03:00
aux check vg_field $vg max_pv 0
2008-11-11 18:29:24 +03:00
vgchange -p 128 $vg
2011-01-05 03:16:18 +03:00
aux check vg_field $vg max_pv 128
2008-11-11 18:29:24 +03:00
2011-01-05 03:16:18 +03:00
pv_count = $( get vg_field $vg pv_count)
2008-11-11 18:29:24 +03:00
not vgchange -p 2 $vg 2>err
grep " MaxPhysicalVolumes is less than the current number $pv_count of PVs for " err
2011-01-05 03:16:18 +03:00
aux check vg_field $vg max_pv 128
2008-11-11 18:29:24 +03:00
# vgchange -l MaxLogicalVolumes
2011-01-05 03:16:18 +03:00
aux check vg_field $vg max_lv 0
2008-11-11 18:29:24 +03:00
vgchange -l 128 $vg
2011-01-05 03:16:18 +03:00
aux check vg_field $vg max_lv 128
2008-11-11 18:29:24 +03:00
2012-03-16 17:00:05 +04:00
lvcreate -l4 -n $lv1 $vg
lvcreate -l4 -n $lv2 $vg
2008-11-11 18:29:24 +03:00
2011-01-05 03:16:18 +03:00
lv_count = $( get vg_field $vg lv_count)
2008-11-11 18:29:24 +03:00
not vgchange -l 1 $vg 2>err
grep " MaxLogicalVolume is less than the current number $lv_count of LVs for " err
2011-01-05 03:16:18 +03:00
aux check vg_field $vg max_lv 128
2008-11-11 18:29:24 +03:00