summaryrefslogtreecommitdiff
path: root/test/shell/lvconvert-vdo.sh
blob: c42d8f25a08ec211e80acf5e00325e72ed5c272e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash

# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1

. lib/inittest

#
# Main
#
aux have_vdo 6 2 0 || skip

aux prepare_vg 2 6400

# Conversion to vdo-pool
lvcreate -L5G -n $lv1 $vg
# Check there is big prompting warning
not lvconvert --type vdo-pool $vg/$lv1 |& tee out
grep "WARNING" out

# Check --vdosettings is also applied to converted vdo-pool
lvconvert -y --type vdo-pool --vdosettings 'ack_threads=5' $vg/$lv1
check lv_field $vg/$lv1 vdo_ack_threads "5"
lvremove -f $vg

#
lvcreate -L5G -n $lv1 $vg
lvconvert -y --vdopool $vg/$lv1
lvremove -f $vg


lvcreate -L5G -n $lv1 $vg
lvconvert -y --vdopool $vg/$lv1 -n $lv2
check lv_field $vg/$lv1 segtype vdo-pool
check lv_field $vg/${lv1}_vdata segtype linear -a
check lv_field $vg/$lv2 segtype vdo
lvremove -f $vg


lvcreate -L5G -n $lv1 $vg
lvconvert -y --type vdo-pool $vg/$lv1 -n $lv2 -V10G
lvremove -f $vg


lvcreate -L5G -n $lv1 $vg
lvconvert -y --vdopool $vg/$lv1 -n $lv2 -V10G --compression n --deduplication n
check lv_field $vg/$lv1 size "5.00g"
check lv_field $vg/${lv1}_vdata size "5.00g" -a
check lv_field $vg/$lv2 size "10.00g"
lvremove -f $vg


# Simple stacking works...
# Just be sure test do not try to synchronize 5G of mirror!!
lvcreate -L5G --type mirror --nosync -n $lv1 $vg
lvconvert -y --vdopool $vg/$lv1 -n $lv2
lvs -a $vg
check lv_field $vg/${lv1}_vdata segtype mirror -a
lvremove -f $vg


vgremove -ff $vg