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

tests: use mkfs.ext3

mkfs.ext4 is not really needed so use more widespread mkfs.ext3
so test runs on older system.
This commit is contained in:
Zdenek Kabelac 2016-04-07 22:07:41 +02:00
parent 8b2108e6b1
commit 9ab53dddf5

View File

@ -12,10 +12,13 @@
SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1 SKIP_WITH_LVMPOLLD=1
MKFS=mkfs.ext3
MOUNT_DIR=mnt MOUNT_DIR=mnt
. lib/inittest . lib/inittest
which "$MKFS" || skp
cleanup_mounted_and_teardown() cleanup_mounted_and_teardown()
{ {
umount "$MOUNT_DIR" || true umount "$MOUNT_DIR" || true
@ -33,7 +36,7 @@ aux prepare_vg 5
# with the default 512K - my C2D T61 reads just couple MB/s! # with the default 512K - my C2D T61 reads just couple MB/s!
# #
lvcreate -aey --type mirror -L10 --regionsize 1M -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3" lvcreate -aey --type mirror -L10 --regionsize 1M -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3"
mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" "$MKFS" "$DM_DEV_DIR/$vg/$lv1"
mkdir "$MOUNT_DIR" mkdir "$MOUNT_DIR"
aux delay_dev "$dev2" 0 500 $(get first_extent_sector "$dev2"): aux delay_dev "$dev2" 0 500 $(get first_extent_sector "$dev2"):
@ -42,7 +45,7 @@ aux delay_dev "$dev4" 0 500 $(get first_extent_sector "$dev4"):
# Enforce syncronization # Enforce syncronization
# ATM requires unmounted/unused LV?? # ATM requires unmounted/unused LV??
# #
lvchange --yes --resync --noudevsync $vg/$lv1 lvchange --yes --resync $vg/$lv1
trap 'cleanup_mounted_and_teardown' EXIT trap 'cleanup_mounted_and_teardown' EXIT
mount "$DM_DEV_DIR/$vg/$lv1" "$MOUNT_DIR" mount "$DM_DEV_DIR/$vg/$lv1" "$MOUNT_DIR"
@ -52,7 +55,8 @@ dd if=/dev/zero of=mnt/zero bs=4K count=100 conv=fdatasync 2>err &
PERCENT=$(get lv_field $vg/$lv1 copy_percent) PERCENT=$(get lv_field $vg/$lv1 copy_percent)
PERCENT=${PERCENT%%\.*} # cut decimal PERCENT=${PERCENT%%\.*} # cut decimal
test "$PERCENT" -lt 50 # and check less then 50% mirror is in sync # and check less then 50% mirror is in sync (could be unusable delay_dev ?)
test "$PERCENT" -lt 50 || skip
#lvs -a -o+devices $vg #lvs -a -o+devices $vg
#aux disable_dev "$dev3" #aux disable_dev "$dev3"