~ubuntu-branches/ubuntu/vivid/lvm2/vivid

« back to all changes in this revision

Viewing changes to test/t-vgmerge-usage.sh

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2012-05-01 20:27:50 UTC
  • mto: (3.1.23 sid)
  • mto: This revision was merged to the branch mainline in revision 72.
  • Revision ID: package-import@ubuntu.com-20120501202750-gljjjtblowwq9mw8
Tags: upstream-2.02.95
ImportĀ upstreamĀ versionĀ 2.02.95

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 vgmerge command options for validity'
13
 
 
14
 
. lib/test
15
 
 
16
 
aux prepare_pvs 4
17
 
 
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 -c n $vg2 $dev1 $dev2
25
 
vgcreate -c n $vg1 $dev3 $dev4
26
 
vgmerge $vg2 $vg1
27
 
vgremove $vg2
28
 
 
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 $vg1 $vg2
35
 
 
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 
41
 
vgremove $vg1 $vg2
42
 
 
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 
48
 
vgremove $vg1 $vg2
49
 
 
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 
56
 
vgremove -f $vg1 $vg2
57
 
 
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 
67
 
vgremove -f $vg1 $vg2