diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-09-11 21:00:10 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-09-11 21:52:27 +0200 |
commit | cd2e4310b320782ec58b712d3c2f24a56c7d10c5 (patch) | |
tree | 61edd648785f3fbd89a67fe040e806ce9465db28 | |
parent | fd3d795b9301dd1defd33e4340fd453e5aee4e8d (diff) | |
download | lvm2-cd2e4310b320782ec58b712d3c2f24a56c7d10c5.tar.gz |
tests: new thin tests
-rw-r--r-- | test/shell/lvconvert-repair-thin-raid.sh | 58 | ||||
-rw-r--r-- | test/shell/lvextend-thin.sh | 2 |
2 files changed, 60 insertions, 0 deletions
diff --git a/test/shell/lvconvert-repair-thin-raid.sh b/test/shell/lvconvert-repair-thin-raid.sh new file mode 100644 index 000000000..04bc5c7b9 --- /dev/null +++ b/test/shell/lvconvert-repair-thin-raid.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +# Copyright (C) 2015 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Test repairing of broken thin pool on raid + +. lib/inittest + +test -e LOCAL_LVMPOLLD && skip +aux have_thin 1 0 0 || skip +aux have_raid 1 4 0 || skip + +# +# Main +# + +aux prepare_vg 4 + +lvcreate --type raid1 -L1 -n pool $vg +lvcreate --type raid1 -L2 -n meta $vg +# raid _tdata & _tmeta +lvconvert -y --thinpool $vg/pool --poolmetadata $vg/meta + +lvcreate -V1G $vg/pool + +# Pool has to be inactive (ATM) for repair +fail lvconvert -y --repair $vg/pool "$dev3" + +lvchange -an $vg + +check lv_field $vg/pool_tmeta lv_role "private,thin,pool,metadata" + +lvconvert -y --repair $vg/pool "$dev3" + +lvs -a -o+devices,seg_pe_ranges,role,layout $vg +check lv_field $vg/pool_meta0 lv_role "public" +check lv_field $vg/pool_meta0 lv_layout "raid,raid1" +check lv_field $vg/pool_tmeta lv_layout "linear" +check lv_on $vg pool_tmeta "$dev1" + +# Hmm name is generated in order +SPARE=$(lvs --noheadings -a --select "name=~_pmspare" -o name $vg) +SPARE=${SPARE##*[} +SPARE=${SPARE%%]*} + +check lv_on $vg $SPARE "$dev3" + +lvchange -ay $vg + +vgremove -ff $vg diff --git a/test/shell/lvextend-thin.sh b/test/shell/lvextend-thin.sh index 1e64e42b4..a97e93b23 100644 --- a/test/shell/lvextend-thin.sh +++ b/test/shell/lvextend-thin.sh @@ -21,3 +21,5 @@ aux prepare_vg 3 lvcreate -i2 -l2 -T $vg/pool2 lvextend -l+2 $vg/pool2 "$dev2" "$dev3" should lvextend -l+100%FREE $vg/pool2 + +vgremove -ff $vg |