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 vgmerge command options for validity'
18
# 'vgmerge normal operation'
19
# ensure ordering does not matter
20
vgcreate $vg1 $dev1 $dev2
21
vgcreate $vg2 $dev3 $dev4
24
vgcreate -c n $vg2 $dev1 $dev2
25
vgcreate -c n $vg1 $dev3 $dev4
29
# 'vgmerge rejects duplicate vg name'
30
vgcreate $vg1 $dev1 $dev2
31
vgcreate $vg2 $dev3 $dev4
32
not vgmerge $vg1 $vg1 2>err
33
grep "^ Duplicate volume group name \"$vg1\"\$" err
36
# 'vgmerge rejects vgs with incompatible extent_size'
37
vgcreate --physicalextentsize 4M $vg1 $dev1 $dev2
38
vgcreate --physicalextentsize 8M $vg2 $dev3 $dev4
39
not vgmerge $vg1 $vg2 2>err
40
grep "^ Extent sizes differ" err
43
# 'vgmerge rejects vgmerge because max_pv is exceeded'
44
vgcreate --maxphysicalvolumes 2 $vg1 $dev1 $dev2
45
vgcreate --maxphysicalvolumes 2 $vg2 $dev3 $dev4
46
not vgmerge $vg1 $vg2 2>err
47
grep "^ Maximum number of physical volumes (2) exceeded" err
50
# 'vgmerge rejects vg with active lv'
51
vgcreate $vg1 $dev1 $dev2
52
vgcreate $vg2 $dev3 $dev4
53
lvcreate -l 4 -n lv1 $vg2
54
not vgmerge $vg1 $vg2 2>err
55
grep "^ Logical volumes in \"$vg2\" must be inactive\$" err
58
# 'vgmerge rejects vgmerge because max_lv is exceeded'
59
vgcreate --maxlogicalvolumes 2 $vg1 $dev1 $dev2
60
vgcreate --maxlogicalvolumes 2 $vg2 $dev3 $dev4
61
lvcreate -l 4 -n lv1 $vg1
62
lvcreate -l 4 -n lv2 $vg1
63
lvcreate -l 4 -n lv3 $vg2
64
vgchange -an $vg1 $vg2
65
not vgmerge $vg1 $vg2 2>err
66
grep "^ Maximum number of logical volumes (2) exceeded" err