1*86d7f5d3SJohn Marino#!/bin/sh
2*86d7f5d3SJohn Marino# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
3*86d7f5d3SJohn Marino#
4*86d7f5d3SJohn Marino# This copyrighted material is made available to anyone wishing to use,
5*86d7f5d3SJohn Marino# modify, copy, or redistribute it subject to the terms and conditions
6*86d7f5d3SJohn Marino# of the GNU General Public License v.2.
7*86d7f5d3SJohn Marino#
8*86d7f5d3SJohn Marino# You should have received a copy of the GNU General Public License
9*86d7f5d3SJohn Marino# along with this program; if not, write to the Free Software Foundation,
10*86d7f5d3SJohn Marino# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
11*86d7f5d3SJohn Marino
12*86d7f5d3SJohn Marino. ./test-utils.sh
13*86d7f5d3SJohn Marino
14*86d7f5d3SJohn Marinoaux prepare_vg 4
15*86d7f5d3SJohn Marino
16*86d7f5d3SJohn Marinolvcreate -l 1 -n $lv1 $vg
17*86d7f5d3SJohn Marinolvcreate -l 2 -m 1 -n $lv2 $vg
18*86d7f5d3SJohn Marino
19*86d7f5d3SJohn Marinovgcfgbackup -f bak0 $vg
20*86d7f5d3SJohn Marinosed -e 's,striped,unstriped,;s,mirror,unmirror,' -i.orig bak0
21*86d7f5d3SJohn Marinovgcfgrestore -f bak0 $vg
22*86d7f5d3SJohn Marino
23*86d7f5d3SJohn Marino# we have on-disk metadata with unknown segments now
24*86d7f5d3SJohn Marinonot lvchange -a y $vg/$lv1 # check that activation is refused
25*86d7f5d3SJohn Marino
26*86d7f5d3SJohn Marinovgcfgbackup -f bak1 $vg
27*86d7f5d3SJohn Marinocat bak1
28*86d7f5d3SJohn Marinosed -e 's,unstriped,striped,;s,unmirror,mirror,' -i.orig bak1
29*86d7f5d3SJohn Marinovgcfgrestore -f bak1 $vg
30*86d7f5d3SJohn Marinovgcfgbackup -f bak2 $vg
31*86d7f5d3SJohn Marino
32*86d7f5d3SJohn Marinoegrep -v 'description|seqno|creation_time|Generated' < bak0.orig > a
33*86d7f5d3SJohn Marinoegrep -v 'description|seqno|creation_time|Generated' < bak2 > b
34*86d7f5d3SJohn Marinodiff -u a b
35