Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / test / t-vgchange-usage.sh
blobebabf90fd86fc4b3acf89daef225a29a614ddc3e
1 #!/bin/sh
2 # Copyright (C) 2008 Red Hat, Inc. All rights reserved.
4 # This copyrighted material is made available to anyone wishing to use,
5 # modify, copy, or redistribute it subject to the terms and conditions
6 # of the GNU General Public License v.2.
8 # You should have received a copy of the GNU General Public License
9 # along with this program; if not, write to the Free Software Foundation,
10 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
12 test_description='Exercise some vgchange diagnostics'
14 . ./test-utils.sh
16 aux prepare_pvs 3
17 pvcreate --metadatacopies 0 $dev1
18 vgcreate $vg $devs
20 get_vg_field() {
21 local vg=$1
22 local field=$2
23 local value
24 vgs --noheading -o $field $vg | sed 's/^ *//'
27 vgdisplay $vg
29 # vgchange -p MaxPhysicalVolumes (bz202232)
30 aux check_vg_field_ $vg max_pv 0
31 vgchange -p 128 $vg
32 aux check_vg_field_ $vg max_pv 128
34 pv_count=$(get_vg_field $vg pv_count)
35 not vgchange -p 2 $vg 2>err
36 grep "MaxPhysicalVolumes is less than the current number $pv_count of PVs for" err
37 aux check_vg_field_ $vg max_pv 128
39 # vgchange -l MaxLogicalVolumes
40 aux check_vg_field_ $vg max_lv 0
41 vgchange -l 128 $vg
42 aux check_vg_field_ $vg max_lv 128
44 lvcreate -l4 -n$lv1 $vg
45 lvcreate -l4 -n$lv2 $vg
47 lv_count=$(get_vg_field $vg lv_count)
48 not vgchange -l 1 $vg 2>err
49 grep "MaxLogicalVolume is less than the current number $lv_count of LVs for" err
50 aux check_vg_field_ $vg max_lv 128