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

tests: aus.sh fix md teardown

Commit 8a912d6dbc missed the wrong logic,
we use 2 vars 'dev' & 'mddev' and their usage can't be mixed.

So correctly separate them so mddev keeps name of MD device.
This commit is contained in:
Zdenek Kabelac 2017-07-20 12:15:06 +02:00
parent 48ce8c7a49
commit 7b048f6b43

View File

@ -778,10 +778,11 @@ cleanup_md_dev() {
local IFS=$IFS_NL
local dev
dev=$(< MD_DEV)
local mddev
mddev=$(< MD_DEV)
udev_wait
mdadm --stop "$dev" || true
test "$DM_DEV_DIR" != "/dev" && rm -f "$DM_DEV_DIR/$(basename "$dev")"
mdadm --stop "$mddev" || true
test "$DM_DEV_DIR" != "/dev" && rm -f "$DM_DEV_DIR/$(basename "$mddev")"
notify_lvmetad "$(< MD_DEV_PV)"
udev_wait # wait till events are process, not zeroing to early
for dev in $(< MD_DEVICES); do
@ -789,12 +790,12 @@ cleanup_md_dev() {
notify_lvmetad "$dev"
done
udev_wait
if [ -b "$dev" ]; then
if [ -b "$mddev" ]; then
# mdadm doesn't always cleanup the device node
# sleeps offer hack to defeat: 'md: md127 still in use'
# see: https://bugzilla.redhat.com/show_bug.cgi?id=509908#c25
sleep 2
rm -f "$dev"
rm -f "$mddev"
fi
rm -f MD_DEV MD_DEVICES MD_DEV_PV
}