From 6bd4a36dde9df1334d8860647911df81b913a60b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 28 Jan 2011 16:10:21 +0000 Subject: [PATCH] Add command to wait for udevadm settle --- test/lib/aux.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/lib/aux.sh b/test/lib/aux.sh index 04367eaf1..d4d2f261d 100644 --- a/test/lib/aux.sh +++ b/test/lib/aux.sh @@ -1,3 +1,4 @@ +#!/bin/bash # Copyright (C) 2011 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, @@ -71,6 +72,7 @@ teardown_devs() { } + udev_wait # NOTE: SCSI_DEBUG_DEV test must come before the LOOP test because # prepare_scsi_debug_dev() also sets LOOP to short-circuit prepare_loop() if test -f SCSI_DEBUG_DEV; then @@ -367,6 +369,15 @@ api() { $abs_top_builddir/test/api/wrapper "$@" } +udev_wait() { + pgrep udev >/dev/null || return + if test -n "$1" ; then + udevadm settle --exit-if-exists=$1 + else + udevadm settle --timeout=5 + fi +} + test -f DEVICES && devs=$(cat DEVICES) test -f LOOP && LOOP=$(cat LOOP) -- 2.43.5