test: forcefully clean up old loop devices.

sometimes these can get left around, and udev can be looking
at them at awkward times so they don't disappear.
So be forceful.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2015-05-20 13:16:00 +10:00
parent 3ee556f8b6
commit dd0468af57
1 changed files with 8 additions and 0 deletions

8
test
View File

@ -94,6 +94,14 @@ do_setup() {
trap cleanup 0 1 3 15
trap ctrl_c 2
# make sure there are no loop devices remaining.
# udev started things can sometimes prevent them being stopped
# immediately
while grep loop /proc/partitions > /dev/null 2>&1
do
losetup -d /dev/loop[0-9]* 2> /dev/null
sleep 1
done
devlist=
for d in 0 1 2 3 4 5 6 7 8 9 10 11 12 13
do