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

tests: add some extra udev waits

To get less random results on older systems with systemd (i.e. fc23)
put few extra udev wait operations to avoid any udev event collision.
This commit is contained in:
Zdenek Kabelac 2017-05-31 13:23:34 +02:00
parent 091c55a13f
commit 42b87c23e2

View File

@ -64,8 +64,19 @@ esac
echo "$i" echo "$i"
"$i" $MKFS_ARGS "$dev_vg_lv" "$i" $MKFS_ARGS "$dev_vg_lv"
# Adding couple udev wait ops as some older systemd
# might get confused and was 'randomly/racy' umounting
# devices just mounted.
#
# See for explanation:
# https://github.com/systemd/systemd/commit/628c89cc68ab96fce2de7ebba5933725d147aecc
# https://github.com/systemd/systemd/pull/2017
aux udev_wait
mount "$dev_vg_lv" "$mount_dir" mount "$dev_vg_lv" "$mount_dir"
aux udev_wait
lvrename $vg_lv $vg_lv_ren lvrename $vg_lv $vg_lv_ren
mount | tee out mount | tee out
@ -80,9 +91,12 @@ not umount "$dev_vg_lv"
lvcreate -L20 -n $lv1 $vg lvcreate -L20 -n $lv1 $vg
"$i" $MKFS_ARGS "$dev_vg_lv" "$i" $MKFS_ARGS "$dev_vg_lv"
aux udev_wait
mount "$dev_vg_lv" "$mount_dolar_dir" mount "$dev_vg_lv" "$mount_dolar_dir"
mount | grep $vg mount | tee out
grep $vg out
not lvresize -L+10M -r $vg_lv_ren not lvresize -L+10M -r $vg_lv_ren
@ -91,6 +105,8 @@ umount "$mount_dir"
# FIXME: lvresize CANNOT handle/propagage '--yes' to fsadm # FIXME: lvresize CANNOT handle/propagage '--yes' to fsadm
echo y | lvresize -L+10M -r $vg_lv echo y | lvresize -L+10M -r $vg_lv
aux udev_wait
umount "$mount_dolar_dir" umount "$mount_dolar_dir"
lvremove -ff $vg lvremove -ff $vg