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
14aux prepare_vg 4
15
16lvcreate -l 1 -n $lv1 $vg
17lvcreate -l 2 -m 1 -n $lv2 $vg
18
19vgcfgbackup -f bak0 $vg
20sed -e 's,striped,unstriped,;s,mirror,unmirror,' -i.orig bak0
21vgcfgrestore -f bak0 $vg
22
23# we have on-disk metadata with unknown segments now
24not lvchange -a y $vg/$lv1 # check that activation is refused
25
26vgcfgbackup -f bak1 $vg
27cat bak1
28sed -e 's,unstriped,striped,;s,unmirror,mirror,' -i.orig bak1
29vgcfgrestore -f bak1 $vg
30vgcfgbackup -f bak2 $vg
31
32egrep -v 'description|seqno|creation_time|Generated' < bak0.orig > a
33egrep -v 'description|seqno|creation_time|Generated' < bak2 > b
34diff -u a b
35