~ubuntu-branches/debian/sid/lvm2/sid

« back to all changes in this revision

Viewing changes to test/shell/vgmerge-operation.sh

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2013-03-03 12:33:47 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20130303123347-smfwei6dodkdth55
Tags: 2.02.98-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
 
# Copyright (C) 2007-2008 Red Hat, Inc. All rights reserved.
 
2
# Copyright (C) 2007-2012 Red Hat, Inc. All rights reserved.
3
3
#
4
4
# This copyrighted material is made available to anyone wishing to use,
5
5
# modify, copy, or redistribute it subject to the terms and conditions
16
16
aux prepare_pvs 4 64
17
17
 
18
18
# 'vgmerge succeeds with single linear LV in source VG'
19
 
vgcreate -c n $vg1 $dev1 $dev2 
20
 
vgcreate -c n $vg2 $dev3 $dev4 
21
 
lvcreate -l 4 -n $lv1 $vg1 $dev1 
22
 
vgchange -an $vg1 
23
 
check pvlv_counts $vg1 2 1 0 
24
 
check pvlv_counts $vg2 2 0 0 
25
 
vgmerge $vg2 $vg1 
26
 
check pvlv_counts $vg2 4 1 0 
 
19
vgcreate -c n $vg1 "$dev1" "$dev2"
 
20
vgcreate -c n $vg2 "$dev3" "$dev4"
 
21
lvcreate -l 4 -n $lv1 $vg1 "$dev1"
 
22
vgchange -an $vg1
 
23
check pvlv_counts $vg1 2 1 0
 
24
check pvlv_counts $vg2 2 0 0
 
25
vgmerge $vg2 $vg1
 
26
check pvlv_counts $vg2 4 1 0
27
27
vgremove -f $vg2
28
28
 
29
29
# 'vgmerge succeeds with single linear LV in source and destination VG'
30
 
vgcreate -c n $vg1 $dev1 $dev2 
31
 
vgcreate -c n $vg2 $dev3 $dev4 
32
 
lvcreate -l 4 -n $lv1 $vg1 
33
 
lvcreate -l 4 -n $lv2 $vg2 
34
 
vgchange -an $vg1 
35
 
vgchange -an $vg2 
36
 
check pvlv_counts $vg1 2 1 0 
37
 
check pvlv_counts $vg2 2 1 0 
38
 
vgmerge $vg2 $vg1 
39
 
check pvlv_counts $vg2 4 2 0 
 
30
vgcreate -c n $vg1 "$dev1" "$dev2"
 
31
vgcreate -c n $vg2 "$dev3" "$dev4"
 
32
lvcreate -l 4 -n $lv1 $vg1
 
33
lvcreate -l 4 -n $lv2 $vg2
 
34
vgchange -an $vg1
 
35
vgchange -an $vg2
 
36
check pvlv_counts $vg1 2 1 0
 
37
check pvlv_counts $vg2 2 1 0
 
38
vgmerge $vg2 $vg1
 
39
check pvlv_counts $vg2 4 2 0
40
40
vgremove -f $vg2
41
41
 
42
42
# 'vgmerge succeeds with linear LV + snapshots in source VG'
43
 
vgcreate -c n $vg1 $dev1 $dev2 
44
 
vgcreate -c n $vg2 $dev3 $dev4 
45
 
lvcreate -l 16 -n $lv1 $vg1 
46
 
lvcreate -l 4 -s -n $lv2 $vg1/$lv1 
47
 
vgchange -an $vg1 
48
 
check pvlv_counts $vg1 2 2 1 
49
 
check pvlv_counts $vg2 2 0 0 
50
 
vgmerge $vg2 $vg1 
51
 
check pvlv_counts $vg2 4 2 1 
52
 
lvremove -f $vg2/$lv2 
 
43
vgcreate -c n $vg1 "$dev1" "$dev2"
 
44
vgcreate -c n $vg2 "$dev3" "$dev4"
 
45
lvcreate -l 16 -n $lv1 $vg1
 
46
lvcreate -l 4 -s -n $lv2 $vg1/$lv1
 
47
vgchange -an $vg1
 
48
check pvlv_counts $vg1 2 2 1
 
49
check pvlv_counts $vg2 2 0 0
 
50
vgmerge $vg2 $vg1
 
51
check pvlv_counts $vg2 4 2 1
 
52
lvremove -f $vg2/$lv2
53
53
vgremove -f $vg2
54
54
 
55
55
# 'vgmerge succeeds with mirrored LV in source VG'
56
 
vgcreate -c n $vg1 $dev1 $dev2 $dev3 
57
 
vgcreate -c n $vg2 $dev4 
58
 
lvcreate -l 4 -n $lv1 -m1 $vg1 
59
 
vgchange -an $vg1 
60
 
check pvlv_counts $vg1 3 1 0 
61
 
check pvlv_counts $vg2 1 0 0 
62
 
vgmerge $vg2 $vg1 
63
 
check pvlv_counts $vg2 4 1 0 
64
 
lvremove -f $vg2/$lv1 
 
56
vgcreate -c n $vg1 "$dev1" "$dev2" "$dev3"
 
57
vgcreate -c n $vg2 "$dev4"
 
58
lvcreate -l 4 -n $lv1 -m1 $vg1
 
59
vgchange -an $vg1
 
60
check pvlv_counts $vg1 3 1 0
 
61
check pvlv_counts $vg2 1 0 0
 
62
vgmerge $vg2 $vg1
 
63
check pvlv_counts $vg2 4 1 0
 
64
lvremove -f $vg2/$lv1
65
65
vgremove -f $vg2
66
66
 
67
67
# 'vgmerge rejects LV name collision'
68
 
vgcreate -c n $vg1 $dev1 $dev2
69
 
vgcreate -c n $vg2 $dev3 $dev4
 
68
vgcreate -c n $vg1 "$dev1" "$dev2"
 
69
vgcreate -c n $vg2 "$dev3" "$dev4"
70
70
lvcreate -l 4 -n $lv1 $vg1
71
71
lvcreate -l 4 -n $lv1 $vg2
72
72
vgchange -an $vg1
76
76
grep "Duplicate logical volume name \"$lv1\" in \"$vg2\" and \"$vg1" err
77
77
check pvlv_counts $vg1 2 1 0
78
78
check pvlv_counts $vg2 2 1 0
79
 
vgremove -f $vg1
80
 
vgremove -f $vg2
81
 
 
 
79
vgremove -f $vg1 $vg2