Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / lvm2 / dist / test / t-metadata.sh
1 # Copyright (C) 2008 Red Hat, Inc. All rights reserved.
2 #
3 # This copyrighted material is made available to anyone wishing to use,
4 # modify, copy, or redistribute it subject to the terms and conditions
5 # of the GNU General Public License v.2.
6 #
7 # You should have received a copy of the GNU General Public License
8 # along with this program; if not, write to the Free Software Foundation,
9 # Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
10
11 . ./test-utils.sh
12
13 aux prepare_devs 5
14
15 pvcreate $dev1
16 pvcreate --metadatacopies 0 $dev2
17 pvcreate --metadatacopies 0 $dev3
18 pvcreate $dev4
19 pvcreate --metadatacopies 0 $dev5
20
21 vgcreate -c n "$vg" $devs
22 lvcreate -n $lv -l 1 -i5 -I256 $vg
23
24 pvchange -x n $dev1
25 pvchange -x y $dev1
26 vgchange -a n $vg
27 pvchange --uuid $dev1
28 pvchange --uuid $dev2
29 vgremove -f $vg
30
31 # check that PVs without metadata don't cause too many full device rescans (bz452606)
32 for mdacp in 1 0; do
33         pvcreate --metadatacopies $mdacp $devs
34         pvcreate $dev1
35         vgcreate $vg $devs
36         lvcreate -n $lv1 -l 2 -i5 -I256 $vg
37         lvcreate -n $lv2 -m2 -l 2  $vg
38         #lvchange -an $vg
39         lvchange -an $vg/$lv1 >out$mdacp 2>&1 
40         lvchange -an $vg/$lv2 >>out$mdacp 2>&1 
41         test ! -s out$mdacp
42         vgchange -ay $vg
43         lvchange -vvvv -an $vg/$lv1 >out$mdacp 2>&1 
44         lvchange -vvvv -an $vg/$lv2 >>out$mdacp 2>&1 
45         eval run$mdacp=$(wc -l <out$mdacp)
46         vgremove -f $vg
47 done
48 not grep "Cached VG .* incorrect PV list" out0
49
50 # some M1 metadata tests
51 pvcreate -M1 $dev1
52 pvcreate -M1 $dev2
53 pvcreate -M1 $dev3
54 vgcreate -M1 $vg $dev1 $dev2 $dev3
55 pvchange --uuid $dev1