Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / test / t-pvchange-usage.sh
blob80023dcfbbcd5b4e16d5ec88b12acf3ae910dc32
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 pvchange option values'
14 . ./test-utils.sh
16 aux prepare_devs 4
18 for mda in 0 1 2
20 # "setup pv with metadatacopies = $mda"
21 pvcreate $dev4
22 pvcreate --metadatacopies $mda $dev1
23 vgcreate $vg1 $dev1 $dev4
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 " "
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-
37 # 'remove pv'
38 vgremove $vg1
39 pvremove $dev1 $dev4
40 done
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 vg_validate_pvlv_counts_ $vg1 2 0 0
50 # "pvchange rejects uuid change under an active lv"
51 lvcreate -l 16 -i 2 -n $lv --alloc anywhere $vg1
52 vg_validate_pvlv_counts_ $vg1 2 1 0
53 not pvchange -u $dev1
54 lvchange -an "$vg1"/"$lv"
55 pvchange -u $dev1
57 # "cleanup"
58 lvremove -f "$vg1"/"$lv"
59 vgremove $vg1
61 # "pvchange reject --addtag to lvm1 pv"
62 pvcreate -M1 $dev1
63 not pvchange $dev1 --addtag test