Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / test / t-vgmerge-usage.sh
blob48da99016338e25300298ae53e2bb2a408847e30
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 vgmerge command options for validity'
14 . ./test-utils.sh
16 aux prepare_pvs 4
18 # 'vgmerge normal operation'
19 # ensure ordering does not matter
20 vgcreate $vg1 $dev1 $dev2
21 vgcreate $vg2 $dev3 $dev4
22 vgmerge $vg1 $vg2
23 vgremove $vg1
24 vgcreate $vg2 $dev1 $dev2
25 vgcreate $vg1 $dev3 $dev4
26 vgmerge $vg2 $vg1
27 vgremove $vg2
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
34 vgremove $vg2
35 vgremove $vg1
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
42 vgremove $vg2
43 vgremove $vg1
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
50 vgremove $vg2
51 vgremove $vg1
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
59 vgremove -f $vg2
60 vgremove -f $vg1
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
68 vgchange -an $vg1
69 vgchange -an $vg2
70 not vgmerge $vg1 $vg2 2>err
71 grep "^ Maximum number of logical volumes (2) exceeded" err
72 vgremove -f $vg2
73 vgremove -f $vg1