diff options
author | Ruediger Meier <ruediger.meier@ga-group.nl> | 2016-11-05 16:08:07 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2016-11-07 10:51:43 +0100 |
commit | e8a7dc4beefaf294c13dc0bfcc8ffdbd940a44b8 (patch) | |
tree | d7de8a2727f5f87ef358a7f64818f633e48df770 | |
parent | 52ac70657674448129aa2385f22feb50c80d71f2 (diff) | |
download | util-linux-e8a7dc4beefaf294c13dc0bfcc8ffdbd940a44b8.tar.gz |
tests: udevadm settle before losetup -d
Fails on Debian 7 (wheezy), Kernel 3.2.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
CC: Stanislav Brabec <sbrabec@suse.cz>
-rwxr-xr-x | tests/ts/losetup/losetup-loop | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ts/losetup/losetup-loop b/tests/ts/losetup/losetup-loop index 839f100da0..310e76eb45 100755 --- a/tests/ts/losetup/losetup-loop +++ b/tests/ts/losetup/losetup-loop @@ -43,12 +43,14 @@ BACKFILE="$TS_DEVICE" ts_init_subtest "find-race-condition" LODEV=$( $TS_CMD_LOSETUP --find --nooverlap --show $BACKFILE ) $TS_CMD_LOSETUP -d $LODEV +# The loop device may or may not exist here because no "udevadm settle". LODEV=$( $TS_CMD_LOSETUP --find --nooverlap --show $BACKFILE ) sleep 3 dd if=/dev/zero of=$LODEV count=1 bs=1 >/dev/null 2>&1 sleep 3 $TS_CMD_LOSETUP --list | grep -q $LODEV ts_log $? +udevadm settle $TS_CMD_LOSETUP -d $LODEV >/dev/null 2>&1 ts_log "Success" ts_finalize_subtest @@ -64,6 +66,7 @@ LODEVR=$( $TS_CMD_LOSETUP --find --nooverlap --show $BACKFILE ) if [ -z "$LODEVR" ]; then ts_log "Failed to create loop device" fi +udevadm settle if test "$LODEV" = "$LODEVR" ; then echo "equal" >>$TS_OUTPUT else @@ -87,6 +90,7 @@ LODEVR=$( $TS_CMD_LOSETUP --find --nooverlap --show --offset=1MiB --sizelimit=1M if [ -z "$LODEVR" ]; then ts_log "Failed to create loop device" fi +udevadm settle if test "$LODEV" = "$LODEVR" ; then echo "equal" >>$TS_OUTPUT else @@ -110,6 +114,7 @@ LODEVR=$( $TS_CMD_LOSETUP --find --nooverlap --show --offset=2MiB --sizelimit=2M if [ -z "$LODEVR" ]; then ts_log "Failed to create loop device" fi +udevadm settle if test "$LODEV" = "$LODEVR" ; then echo "equal" >>$TS_OUTPUT else @@ -133,6 +138,7 @@ LODEVR=$( $TS_CMD_LOSETUP --find --nooverlap --show --offset=2MiB --sizelimit=2M if [ -z "$LODEVR" ]; then ts_log "Failed to create loop device" fi +udevadm settle if test "$LODEV" = "$LODEVR" ; then echo "equal" >>$TS_OUTPUT else @@ -156,6 +162,7 @@ LODEVR=$( $TS_CMD_LOSETUP --find --nooverlap --show --offset=2MiB --sizelimit=2M if [ -z "$LODEVR" ]; then ts_log "Failed to create loop device" fi +udevadm settle if test "$LODEV" = "$LODEVR" ; then echo "equal" >>$TS_OUTPUT else @@ -180,6 +187,7 @@ LODEVR=$( $TS_CMD_LOSETUP --find --nooverlap --show --offset=2MiB $BACKFILE ) if [ -z "$LODEVR" ]; then ts_log "Failed to create loop device" fi +udevadm settle if test "$LODEV" = "$LODEVR" ; then echo "equal" >>$TS_OUTPUT else @@ -202,6 +210,7 @@ fi LODEVR=$( $TS_CMD_LOSETUP --find ) $TS_CMD_LOSETUP --nooverlap $LODEVR $BACKFILE >/dev/null 2>&1 ts_log $? +udevadm settle $TS_CMD_LOSETUP -d $LODEV $TS_CMD_LOSETUP -d $LODEVR >/dev/null 2>&1 ts_log "Success" @@ -217,6 +226,7 @@ fi LODEVR=$( $TS_CMD_LOSETUP --find ) $TS_CMD_LOSETUP --nooverlap $LODEVR $BACKFILE >/dev/null 2>&1 ts_log $? +udevadm settle $TS_CMD_LOSETUP -d $LODEV $TS_CMD_LOSETUP -d $LODEVR >/dev/null 2>&1 ts_log "Success" |