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
$vg2 $dev1 $dev2
25 vgcreate
$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
37 # 'vgmerge rejects vgs with incompatible extent_size'
38 vgcreate
--physicalextentsize 4M
$vg1 $dev1 $dev2
39 vgcreate
--physicalextentsize 8M
$vg2 $dev3 $dev4
40 not vgmerge
$vg1 $vg2 2>err
41 grep "^ Extent sizes differ" err
45 # 'vgmerge rejects vgmerge because max_pv is exceeded'
46 vgcreate
--maxphysicalvolumes 2 $vg1 $dev1 $dev2
47 vgcreate
--maxphysicalvolumes 2 $vg2 $dev3 $dev4
48 not vgmerge
$vg1 $vg2 2>err
49 grep "^ Maximum number of physical volumes (2) exceeded" err
53 # 'vgmerge rejects vg with active lv'
54 vgcreate
$vg1 $dev1 $dev2
55 vgcreate
$vg2 $dev3 $dev4
56 lvcreate
-l 4 -n lv1
$vg2
57 not vgmerge
$vg1 $vg2 2>err
58 grep "^ Logical volumes in \"$vg2\" must be inactive\$" err
62 # 'vgmerge rejects vgmerge because max_lv is exceeded'
63 vgcreate
--maxlogicalvolumes 2 $vg1 $dev1 $dev2
64 vgcreate
--maxlogicalvolumes 2 $vg2 $dev3 $dev4
65 lvcreate
-l 4 -n lv1
$vg1
66 lvcreate
-l 4 -n lv2
$vg1
67 lvcreate
-l 4 -n lv3
$vg2
70 not vgmerge
$vg1 $vg2 2>err
71 grep "^ Maximum number of logical volumes (2) exceeded" err