1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

tests: reduce memory footprint

This commit is contained in:
Zdenek Kabelac 2018-11-27 12:15:52 +01:00
parent 7da75f41ed
commit e940293c33

View File

@ -17,9 +17,7 @@ SKIP_WITH_LVMPOLLD=1
# Test reshaping under io load # Test reshaping under io load
# FIXME: This test requires 3GB in /dev/shm! which md5sum || skip
test $(aux total_mem) -gt $((4096*1024)) || skip
which mkfs.ext4 || skip which mkfs.ext4 || skip
aux have_raid 1 13 2 || skip aux have_raid 1 13 2 || skip
@ -31,6 +29,11 @@ cleanup_mounted_and_teardown()
aux teardown aux teardown
} }
checksum_()
{
md5sum "$1" | cut -f1 -d' '
}
aux prepare_pvs 16 32 aux prepare_pvs 16 32
get_devs get_devs
@ -40,23 +43,20 @@ vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT trap 'cleanup_mounted_and_teardown' EXIT
# Create 10-way striped raid5 (11 legs total) # Create 10-way striped raid5 (11 legs total)
lvcreate --yes --type raid5_ls --stripesize 64K --stripes 10 -L200M -n$lv1 $vg lvcreate --yes --type raid5_ls --stripesize 64K --stripes 10 -L64M -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls" check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
check lv_first_seg_field $vg/$lv1 stripesize "64.00k" check lv_first_seg_field $vg/$lv1 stripesize "64.00k"
check lv_first_seg_field $vg/$lv1 data_stripes 10 check lv_first_seg_field $vg/$lv1 data_stripes 10
check lv_first_seg_field $vg/$lv1 stripes 11 check lv_first_seg_field $vg/$lv1 stripes 11
echo y|mkfs -t ext4 /dev/$vg/$lv1 echo y|mkfs -t ext4 /dev/$vg/$lv1
mkdir -p $mount_dir mkdir -p "$mount_dir"
mount "$DM_DEV_DIR/$vg/$lv1" $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 echo 3 >/proc/sys/vm/drop_caches
# FIXME: This is filling up ram disk. Use sane amount of data please! Rate limit the data written! # FIXME: This is filling up ram disk. Use sane amount of data please! Rate limit the data written!
cp -r /usr/bin $mount_dir/1 >/dev/null 2>/dev/null & dd if=/dev/urandom of="$mount_dir/random" bs=1M count=50 conv=fdatasync
cp -r /usr/bin $mount_dir/2 >/dev/null 2>/dev/null & checksum_ "$mount_dir/random" >MD5
# FIXME: should this wait for above two processes and sync then?
sync &
# FIXME: wait_for_sync - is this really testing anything under load? # FIXME: wait_for_sync - is this really testing anything under load?
aux wait_for_sync $vg $lv1 aux wait_for_sync $vg $lv1
@ -80,11 +80,17 @@ done
aux delay_dev "$dev2" 0 aux delay_dev "$dev2" 0
kill -9 %% kill -9 %% || true
wait wait
checksum_ "$mount_dir/random" >MD5_new
umount $mount_dir umount $mount_dir
fsck -fn "$DM_DEV_DIR/$vg/$lv1" fsck -fn "$DM_DEV_DIR/$vg/$lv1"
# Compare checksum is matching
cat MD5 MD5_new
diff MD5 MD5_new
vgremove -ff $vg vgremove -ff $vg