Tizen 2.1 base
[external/device-mapper.git] / test / t-nomda-missing.sh
1 #!/bin/bash
2
3 # Copyright (C) 2010 Red Hat, Inc. All rights reserved.
4 #
5 # This copyrighted material is made available to anyone wishing to use,
6 # modify, copy, or redistribute it subject to the terms and conditions
7 # of the GNU General Public License v.2.
8 #
9 # You should have received a copy of the GNU General Public License
10 # along with this program; if not, write to the Free Software Foundation,
11 # Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
12
13 . ./test-utils.sh
14
15 prepare_devs 4
16 pvcreate $dev1 $dev2
17 pvcreate --metadatacopies 0 $dev3 $dev4
18 vgcreate -c n $vg $dev1 $dev2 $dev3 $dev4
19
20 lvcreate -l1 -n linear1 $vg $dev1
21 lvcreate -l1 -n linear2 $vg $dev2
22 lvcreate -l2 -n linear12 $vg $dev1:4 $dev2:4
23
24 lvcreate -l1 -n origin1 $vg $dev1
25 lvcreate -s $vg/origin1 -l1 -n s_napshot2 $dev2
26
27 lvcreate -l1 -m1 -n mirror12 --mirrorlog core $vg $dev1 $dev2
28 lvcreate -l1 -m1 -n mirror123 $vg $dev1 $dev2 $dev3
29
30 vgchange -a n $vg
31 disable_dev $dev1
32 not vgchange -a y $vg
33 not vgck $vg
34
35 check inactive $vg linear1
36 check active $vg linear2
37 check inactive $vg origin1
38 check inactive $vg s_napshot2
39 check inactive $vg linear12
40 check inactive $vg mirror12
41 check inactive $vg mirror123
42
43 vgchange -a n $vg
44 enable_dev $dev1
45 disable_dev $dev2
46 not vgchange -a y $vg
47 not vgck $vg
48
49 check active $vg linear1
50 check inactive $vg linear2
51 check inactive $vg linear12
52 check inactive $vg origin1
53 check inactive $vg s_napshot2
54 check inactive $vg mirror12
55 check inactive $vg mirror123
56
57 vgchange -a n $vg
58 enable_dev $dev2
59 disable_dev $dev3
60 not vgchange -a y $vg
61 not vgck $vg
62
63 check active $vg origin1
64 check active $vg s_napshot2
65 check active $vg linear1
66 check active $vg linear2
67 check active $vg linear12
68 check inactive $vg mirror123
69 check active $vg mirror12
70
71 vgchange -a n $vg
72 enable_dev $dev3
73 disable_dev $dev4
74 vgchange -a y $vg
75 not vgck $vg
76
77 check active $vg origin1
78 check active $vg s_napshot2
79 check active $vg linear1
80 check active $vg linear2
81 check active $vg linear12
82 check active $vg mirror12
83 check active $vg mirror123