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

tests: add aux mdadm_assemble

Wrapper for slowed version of mdadm --assemble
This commit is contained in:
Zdenek Kabelac 2021-03-26 16:05:42 +01:00
parent 5ef8d84569
commit 4c59b2aa21

View File

@ -780,6 +780,22 @@ mdadm_create() {
done
}
mdadm_assemble() {
STRACE=
[ "$DM_DEV_DIR" = "/dev" ] && mdadm -V 2>&1 | grep " v3.2" && {
# use this 'trick' to slow down mdadm which otherwise
# is racing with udev rule since mdadm internally
# opens and closes raid leg devices in RW mode and then
# tries to get exlusive access to the leg device during
# insertion to kernel and fails during assembly
# There can be some other affected version of mdadm.
STRACE="strace -f -o /dev/null"
}
$STRACE mdadm --assemble "$@"
udev_wait
}
cleanup_md_dev() {
local IFS=$IFS_NL
local i