From 490e6e9ef1bbc30dff81873e9eeb99924688004e Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 13 Jul 2017 21:06:04 +0200 Subject: [PATCH] tests: add some delay after dmsetup When we want to squash as much device as possible, it's better to give it some delay, so devices have some time to release it's resouces for next removal. Also drop surrounding cookie processing and let each dmsetup call run on its own. --- test/lib/aux.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/lib/aux.sh b/test/lib/aux.sh index a8b6beacb..9e0ca2cf9 100644 --- a/test/lib/aux.sh +++ b/test/lib/aux.sh @@ -416,13 +416,12 @@ teardown_devs_prefixed() { #local listdevs=( $(dm_info name,open --sort open,name | grep "$prefix.*:0") ) #dmsetup remove --deferred ${listdevs[@]%%:0} || touch REMOVE_FAILED - init_udev_transaction for dm in $(dm_info name --sort open,name | grep "$prefix"); do dmsetup remove "$dm" &>/dev/null || touch REMOVE_FAILED & need_udev_wait=1 + sleep 1 # give 'dmsetup' some time to proceed with removal done wait - finish_udev_transaction test "$need_udev_wait" -eq 0 || udev_wait if test -f REMOVE_FAILED; then @@ -1214,7 +1213,7 @@ EOF local last_sec # read sequential list and put into associative array - while IFS=$IFS_NL read -r v; do + while IFS= read -r v; do CONF["${v%%[={ ]*}"]=${v#*/} done < "$config_values" -- 2.43.5