Tizen 2.1 base
[external/device-mapper.git] / test / t-lvresize-mirror.sh
1 #!/bin/sh
2 # Copyright (C) 2010 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 aux prepare_vg 5 80
14
15 # extend 2-way mirror
16 lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1
17 lvchange -an $vg/$lv1
18 lvextend -l+2 $vg/$lv1
19 check mirror $vg $lv1 $dev3
20 check mirror_images_contiguous $vg $lv1
21 lvremove -ff $vg
22
23 # reduce 2-way mirror
24 lvcreate -l4 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1
25 lvchange -an $vg/$lv1
26 lvreduce -l-2 $vg/$lv1
27 check mirror $vg $lv1 $dev3
28 lvremove -ff $vg
29
30 # extend 2-way mirror (cling if not contiguous)
31 lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1
32 lvcreate -l1 -n $lv2 $vg $dev1
33 lvcreate -l1 -n $lv3 $vg $dev2
34 lvchange -an $vg/$lv1
35 lvextend -l+2 $vg/$lv1
36 check mirror $vg $lv1 $dev3
37 check mirror_images_clung $vg $lv1
38 lvremove -ff $vg