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