blob: 39caf5e03a6bd81dbf16a15e42ad4ad7b2d45f51 (
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
|
#!/usr/bin/env bash
# Copyright (C) 2014 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
# Exercise usage of stacked cache volume used in thin pool volumes
SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
percent_() {
get lv_field $vg/vpool data_percent | cut -d. -f1
}
aux have_vdo 6 2 0 || skip
aux have_cache 1 3 0 || skip
aux prepare_vg 1 9000
lvcreate -L10 -n cpool $vg
lvcreate -L4G -n vpool $vg
# Cache volume
lvconvert --yes --cache --cachepool cpool $vg/vpool
# Stack cached LV as VDODataLV for VDOPoolLV
lvconvert --yes --type vdo-pool -V50M --name $lv1 $vg/vpool
aux mkdev_md5sum $vg $lv1
lvconvert --splitcache $vg/vpool
check dev_md5sum $vg $lv1
lvchange -an $vg
lvchange -ay $vg
check dev_md5sum $vg $lv1
lvconvert --yes --cache --cachepool cpool $vg/vpool
VDODATA="$(percent_)"
# Check resize of cached VDO pool
lvextend -L+1G $vg/vpool
lvs -a $vg
# Check after resize usage is reduced
test "$(percent_)" -lt $VDODATA
lvconvert --splitcache $vg/vpool
lvconvert --yes --cache --cachepool cpool $vg/$lv1
check dev_md5sum $vg $lv1
lvchange -an $vg
lvchange -ay $vg
check dev_md5sum $vg $lv1
lvs -a $vg
not lvconvert --splitcache $vg/vpool
lvconvert --splitcache $vg/$lv1
lvs -a $vg
# Also check, removal of cached VDO LV works
lvconvert --yes --cache --cachepool cpool $vg/$lv1
vgremove -f $vg
|