1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: add pvmove --abort test

test for bug described in c282a66132
This commit is contained in:
Ondrej Kozina 2015-03-30 16:59:06 +02:00
parent c282a66132
commit 5f7428e4d5

View File

@ -0,0 +1,59 @@
#!/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
# Check pvmove --abort behaviour when specific device is requested
. lib/inittest
aux prepare_pvs 3 60
vgcreate -s 128k $vg "$dev1" "$dev2"
pvcreate --metadatacopies 0 "$dev3"
vgextend $vg "$dev3"
for mode in "--atomic" "" ;
do
for backgroundarg in "-b" "" ;
do
# Create multisegment LV
lvcreate -an -Zn -l30 -n $lv1 $vg "$dev1"
lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2"
# Slowdown writes
aux delay_dev "$dev3" 0 200
pvmove -i1 $backgroundarg "$dev1" "$dev3" $mode &
aux wait_pvmove_lv_ready "$vg-pvmove0" 300
pvmove -i1 $backgroundarg "$dev2" "$dev3" $mode &
aux wait_pvmove_lv_ready "$vg-pvmove1" 300
# remove specific device
pvmove --abort "$dev1"
# check if proper pvmove was canceled
get lv_field $vg name -a | tee out
not grep "^\[pvmove0\]" out
grep "^\[pvmove1\]" out
# Restore delayed device back
aux enable_dev "$dev3"
# remove any remaining pvmoves in progress
pvmove --abort
lvremove -ff $vg
wait
done
done
vgremove -ff $vg