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

test: fix trap adding proper teardown to previous, new raid tests

Also remove superfluous variable.
This commit is contained in:
Heinz Mauelshagen 2017-12-13 14:39:06 +01:00
parent 86fa0333ff
commit 584ff361df
4 changed files with 57 additions and 45 deletions

View File

@ -13,8 +13,6 @@
SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
LVM_SKIP_LARGE_TESTS=1
. lib/inittest
# Test reshaping under io load
@ -22,9 +20,13 @@ LVM_SKIP_LARGE_TESTS=1
which mkfs.ext4 || skip
aux have_raid 1 13 1 || skip
mpoint=/tmp/mpoint.$$
mount_dir="mnt"
trap "[ -d $mpoint ] && rmdir $mpoint" 1 2 3 15
cleanup_mounted_and_teardown()
{
umount "$mount_dir" || true
aux teardown
}
aux prepare_pvs 16 32
@ -32,6 +34,8 @@ get_devs
vgcreate -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
# Create 13-way striped raid5 (14 legs total)
lvcreate --yes --type raid5_ls --stripes 13 -L190M -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
@ -40,15 +44,15 @@ check lv_first_seg_field $vg/$lv1 stripes 14
echo y|mkfs -t ext4 /dev/$vg/$lv1
aux wait_for_sync $vg $lv1
mkdir -p $mpoint
mount "$DM_DEV_DIR/$vg/$lv1" $mpoint
mkdir -p $mpoint/1 $mpoint/2
mkdir -p $mount_dir
mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
mkdir -p $mount_dir/1 $mount_dir/2
aux delay_dev "$dev2" 0 100
echo 3 >/proc/sys/vm/drop_caches
cp -r /usr/bin $mpoint/1 >/dev/null 2>/dev/null &
cp -r /usr/bin $mpoint/2 >/dev/null 2>/dev/null &
cp -r /usr/bin $mount_dir/1 >/dev/null 2>/dev/null &
cp -r /usr/bin $mount_dir/2 >/dev/null 2>/dev/null &
sync &
# Reshape it to 256K stripe size
@ -59,8 +63,7 @@ check lv_first_seg_field $vg/$lv1 stripesize "256.00k"
kill -9 %%
wait
umount $mpoint
[ -d $mpoint ] && rmdir $mpoint
umount $mount_dir
fsck -fn "$DM_DEV_DIR/$vg/$lv1"

View File

@ -13,8 +13,6 @@
SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
LVM_SKIP_LARGE_TESTS=1
. lib/inittest
# Test reshaping under io load
@ -22,9 +20,13 @@ LVM_SKIP_LARGE_TESTS=1
which mkfs.ext4 || skip
aux have_raid 1 13 1 || skip
mpoint=/tmp/mpoint.$$
mount_dir="mnt"
trap "[ -d $mpoint ] && rmdir $mpoint" 1 2 3 15
cleanup_mounted_and_teardown()
{
umount "$mount_dir" || true
aux teardown
}
aux prepare_pvs 16 32
@ -32,6 +34,8 @@ get_devs
vgcreate -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
# Create 13-way striped raid5 (14 legs total)
lvcreate --yes --type raid5_ls --stripesize 64K --stripes 10 -L200M -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
@ -40,14 +44,14 @@ check lv_first_seg_field $vg/$lv1 data_stripes 10
check lv_first_seg_field $vg/$lv1 stripes 11
echo y|mkfs -t ext4 /dev/$vg/$lv1
mkdir -p $mpoint
mount "$DM_DEV_DIR/$vg/$lv1" $mpoint
mkdir -p $mpoint/1 $mpoint/2
mkdir -p $mount_dir
mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
mkdir -p $mount_dir/1 $mount_dir/2
echo 3 >/proc/sys/vm/drop_caches
cp -r /usr/bin $mpoint/1 >/dev/null 2>/dev/null &
cp -r /usr/bin $mpoint/2 >/dev/null 2>/dev/null &
cp -r /usr/bin $mount_dir/1 >/dev/null 2>/dev/null &
cp -r /usr/bin $mount_dir/2 >/dev/null 2>/dev/null &
sync &
aux wait_for_sync $vg $lv1
@ -62,13 +66,12 @@ check lv_first_seg_field $vg/$lv1 stripesize "64.00k"
check lv_first_seg_field $vg/$lv1 data_stripes 15
check lv_first_seg_field $vg/$lv1 stripes 16
rm -fr $mpoint/2
rm -fr $mount_dir/2
sync
kill -9 %%
wait
umount $mpoint
[ -d $mpoint ] && rmdir $mpoint
umount $mount_dir
fsck -fn "$DM_DEV_DIR/$vg/$lv1"

View File

@ -13,8 +13,6 @@
SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
LVM_SKIP_LARGE_TESTS=1
. lib/inittest
# Test reshaping under io load
@ -22,9 +20,13 @@ LVM_SKIP_LARGE_TESTS=1
which mkfs.ext4 || skip
aux have_raid 1 13 2 || skip
mpoint=/tmp/mpoint.$$
mount_dir="mnt"
trap "[ -d $mpoint ] && rmdir $mpoint" 1 2 3 15
cleanup_mounted_and_teardown()
{
umount "$mount_dir" || true
aux teardown
}
aux prepare_pvs 16 32
@ -32,6 +34,8 @@ get_devs
vgcreate -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
# Create 13-way striped raid5 (14 legs total)
lvcreate --yes --type raid5_ls --stripesize 64K --stripes 10 -L200M -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
@ -40,13 +44,13 @@ check lv_first_seg_field $vg/$lv1 data_stripes 10
check lv_first_seg_field $vg/$lv1 stripes 11
echo y|mkfs -t ext4 /dev/$vg/$lv1
mkdir -p $mpoint
mount "$DM_DEV_DIR/$vg/$lv1" $mpoint
mkdir -p $mpoint/1 $mpoint/2
mkdir -p $mount_dir
mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
mkdir -p $mount_dir/1 $mount_dir/2
echo 3 >/proc/sys/vm/drop_caches
cp -r /usr/bin $mpoint/1 >/dev/null 2>/dev/null &
cp -r /usr/bin $mpoint/2 >/dev/null 2>/dev/null &
cp -r /usr/bin $mount_dir/1 >/dev/null 2>/dev/null &
cp -r /usr/bin $mount_dir/2 >/dev/null 2>/dev/null &
sync &
aux wait_for_sync $vg $lv1
@ -73,8 +77,7 @@ aux delay_dev "$dev2" 0
kill -9 %%
wait
umount $mpoint
[ -d $mpoint ] && rmdir $mpoint
umount $mount_dir
fsck -fn "$DM_DEV_DIR/$vg/$lv1"

View File

@ -13,8 +13,6 @@
SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
LVM_SKIP_LARGE_TESTS=1
. lib/inittest
# Test reshaping under io load
@ -22,9 +20,13 @@ LVM_SKIP_LARGE_TESTS=1
which mkfs.ext4 || skip
aux have_raid 1 13 1 || skip
mpoint=/tmp/mpoint.$$
mount_dir="mnt"
trap "[ -d $mpoint ] && rmdir $mpoint" 1 2 3 15
cleanup_mounted_and_teardown()
{
umount "$mount_dir" || true
aux teardown
}
aux prepare_pvs 16 32
@ -32,6 +34,8 @@ get_devs
vgcreate -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
# Create 13-way striped raid5 (14 legs total)
lvcreate --yes --type raid5_ls --stripesize 64K --stripes 10 -L200M -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
@ -40,14 +44,14 @@ check lv_first_seg_field $vg/$lv1 data_stripes 10
check lv_first_seg_field $vg/$lv1 stripes 11
echo y|mkfs -t ext4 /dev/$vg/$lv1
mkdir -p $mpoint
mount "$DM_DEV_DIR/$vg/$lv1" $mpoint
mkdir -p $mpoint/1 $mpoint/2
mkdir -p $mount_dir
mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
mkdir -p $mount_dir/1 $mount_dir/2
echo 3 >/proc/sys/vm/drop_caches
cp -r /usr/bin $mpoint/1 >/dev/null 2>/dev/null &
cp -r /usr/bin $mpoint/2 >/dev/null 2>/dev/null &
cp -r /usr/bin $mount_dir/1 >/dev/null 2>/dev/null &
cp -r /usr/bin $mount_dir/2 >/dev/null 2>/dev/null &
sync &
aux wait_for_sync $vg $lv1
@ -64,8 +68,7 @@ check lv_first_seg_field $vg/$lv1 stripes 16
kill -9 %%
wait
umount $mpoint
[ -d $mpoint ] && rmdir $mpoint
umount $mount_dir
fsck -fn "$DM_DEV_DIR/$vg/$lv1"