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

« back to all changes in this revision

Viewing changes to test/t-pvchange-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 pvchange option values'
13
 
 
14
 
. lib/test
15
 
 
16
 
aux prepare_devs 4
17
 
 
18
 
for mda in 0 1 2 
19
 
do
20
 
# "setup pv with metadatacopies = $mda" 
21
 
        pvcreate $dev4 
22
 
        pvcreate --metadatacopies $mda $dev1 
23
 
        vgcreate $vg1 $dev1 $dev4 
24
 
 
25
 
# "pvchange adds/dels tag to pvs with metadatacopies = $mda " 
26
 
        pvchange $dev1 --addtag test$mda 
27
 
        check pv_field $dev1 pv_tags test$mda 
28
 
        pvchange $dev1 --deltag test$mda 
29
 
        check pv_field $dev1 pv_tags ""
30
 
 
31
 
# "vgchange disable/enable allocation for pvs with metadatacopies = $mda (bz452982)"
32
 
        pvchange $dev1 -x n 
33
 
        check pv_field $dev1 pv_attr  ---
34
 
        pvchange $dev1 -x y 
35
 
        check pv_field $dev1 pv_attr  a--
36
 
 
37
 
# 'remove pv'
38
 
        vgremove $vg1 
39
 
        pvremove $dev1 $dev4
40
 
done
41
 
 
42
 
# "pvchange uuid"
43
 
pvcreate --metadatacopies 0 $dev1 
44
 
pvcreate --metadatacopies 2 $dev2 
45
 
vgcreate $vg1 $dev1 $dev2 
46
 
pvchange -u $dev1 
47
 
pvchange -u $dev2 
48
 
check pvlv_counts $vg1 2 0 0
49
 
pvchange -u --all
50
 
check pvlv_counts $vg1 2 0 0
51
 
 
52
 
# "pvchange rejects uuid change under an active lv" 
53
 
lvcreate -l 16 -i 2 -n $lv --alloc anywhere $vg1 
54
 
check pvlv_counts $vg1 2 1 0 
55
 
not pvchange -u $dev1
56
 
lvchange -an "$vg1"/"$lv" 
57
 
pvchange -u $dev1
58
 
 
59
 
# "cleanup" 
60
 
lvremove -f "$vg1"/"$lv"
61
 
vgremove $vg1
62
 
 
63
 
# "pvchange reject --addtag to lvm1 pv"
64
 
pvcreate -M1 $dev1 
65
 
not pvchange $dev1 --addtag test
66