]> sourceware.org Git - lvm2.git/commitdiff
Add command to wait for udevadm settle
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 28 Jan 2011 16:10:21 +0000 (16:10 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 28 Jan 2011 16:10:21 +0000 (16:10 +0000)
test/lib/aux.sh

index 04367eaf1969fbb7a5b5edf3b43d090986eb40ac..d4d2f261d45e118671ce6636a2ce4bccb659f1c8 100644 (file)
@@ -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)
 
This page took 0.040838 seconds and 5 git commands to generate.