Tizen 2.1 base
[external/device-mapper.git] / test / t-vgchange-usage.sh
1 #!/bin/sh
2 # Copyright (C) 2008 Red Hat, Inc. All rights reserved.
3 #
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.
7 #
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
11
12 test_description='Exercise some vgchange diagnostics'
13
14 . ./test-utils.sh
15
16 aux prepare_pvs 3
17 pvcreate --metadatacopies 0 $dev1
18 vgcreate $vg $devs
19
20 vgdisplay $vg
21
22 # vgchange -p MaxPhysicalVolumes (bz202232)
23 aux check_vg_field_ $vg max_pv 0
24 vgchange -p 128 $vg
25 aux check_vg_field_ $vg max_pv 128
26
27 pv_count=$(get_vg_field $vg pv_count)
28 not vgchange -p 2 $vg 2>err
29 grep "MaxPhysicalVolumes is less than the current number $pv_count of PVs for" err
30 aux check_vg_field_ $vg max_pv 128
31
32 # vgchange -l MaxLogicalVolumes
33 aux check_vg_field_ $vg max_lv 0
34 vgchange -l 128 $vg
35 aux check_vg_field_ $vg max_lv 128
36
37 lvcreate -l4 -n$lv1 $vg
38 lvcreate -l4 -n$lv2 $vg
39
40 lv_count=$(get_vg_field $vg lv_count)
41 not vgchange -l 1 $vg 2>err
42 grep "MaxLogicalVolume is less than the current number $lv_count of LVs for"  err
43 aux check_vg_field_ $vg max_lv 128
44