Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / lvm2 / dist / test / t-unknown-segment.sh
1 #!/bin/sh
2 # Copyright (C) 2009 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-utils.sh
13
14 aux prepare_vg 4
15
16 lvcreate -l 1 -n $lv1 $vg
17 lvcreate -l 2 -m 1 -n $lv2 $vg
18
19 vgcfgbackup -f bak0 $vg
20 sed -e 's,striped,unstriped,;s,mirror,unmirror,' -i.orig bak0
21 vgcfgrestore -f bak0 $vg
22
23 # we have on-disk metadata with unknown segments now
24 not lvchange -a y $vg/$lv1 # check that activation is refused
25
26 vgcfgbackup -f bak1 $vg
27 cat bak1
28 sed -e 's,unstriped,striped,;s,unmirror,mirror,' -i.orig bak1
29 vgcfgrestore -f bak1 $vg
30 vgcfgbackup -f bak2 $vg
31
32 egrep -v 'description|seqno|creation_time|Generated' < bak0.orig > a
33 egrep -v 'description|seqno|creation_time|Generated' < bak2 > b
34 diff -u a b