Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / test / t-inconsistent-metadata.sh
blobfbbea15853d4eebd86085f0dc82b5ca0719c2333
1 #!/bin/bash
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-utils.sh
14 aux prepare_vg 3
16 lvcreate -m 1 -l 1 -n mirror $vg
17 lvcreate -l 1 -n resized $vg
18 lvchange -a n $vg/mirror
20 backup_dev $devs
22 init() {
23 restore_dev $devs
24 lvs -o lv_name,lv_size --units k $vg | tee lvs.out
25 grep resized lvs.out | not grep 8192
26 lvresize -L 8192K $vg/resized
27 restore_dev $dev1
30 check() {
31 lvs -o lv_name,lv_size --units k $vg | tee lvs.out
32 grep resized lvs.out | grep 8192
35 # vgscan fixes up metadata
36 init
37 vgscan 2>&1 | tee cmd.out
38 grep "Inconsistent metadata found for VG $vg" cmd.out
39 vgscan 2>&1 | tee cmd.out
40 not grep "Inconsistent metadata found for VG $vg" cmd.out
41 check
43 # vgdisplay fixes
44 init
45 vgdisplay 2>&1 | tee cmd.out
46 grep "Inconsistent metadata found for VG $vg" cmd.out
47 vgdisplay 2>&1 | tee cmd.out
48 not grep "Inconsistent metadata found for VG $vg" cmd.out
49 check
51 # lvs fixes up
52 init
53 lvs 2>&1 | tee cmd.out
54 grep "Inconsistent metadata found for VG $vg" cmd.out
55 vgdisplay 2>&1 | tee cmd.out
56 not grep "Inconsistent metadata found for VG $vg" cmd.out
57 check
59 # vgs fixes up as well
60 init
61 vgs 2>&1 | tee cmd.out
62 grep "Inconsistent metadata found for VG $vg" cmd.out
63 vgs 2>&1 | tee cmd.out
64 not grep "Inconsistent metadata found for VG $vg" cmd.out
65 check