Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH 1/3] tests: udevadm settle before losetup -d
@ 2016-11-05 15:08 Ruediger Meier
  2016-11-05 15:08 ` [PATCH 2/3] tests: replace sleep by udevadm Ruediger Meier
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ruediger Meier @ 2016-11-05 15:08 UTC (permalink / raw)
  To: util-linux; +Cc: Stanislav Brabec

From: Ruediger Meier <ruediger.meier@ga-group.nl>

Fails on Debian 7 (wheezy), Kernel 3.2.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
CC: Stanislav Brabec <sbrabec@suse.cz>
---
 tests/ts/losetup/losetup-loop | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/ts/losetup/losetup-loop b/tests/ts/losetup/losetup-loop
index 839f100..310e76e 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"
-- 
1.8.5.6


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-11-07 13:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-05 15:08 [PATCH 1/3] tests: udevadm settle before losetup -d Ruediger Meier
2016-11-05 15:08 ` [PATCH 2/3] tests: replace sleep by udevadm Ruediger Meier
2016-11-07 13:13   ` Stanislav Brabec
2016-11-05 15:08 ` [PATCH 3/3] tests: always quote $LODEV Ruediger Meier
2016-11-06 20:57   ` Bernhard Voelker
2016-11-07  8:58     ` Ruediger Meier
2016-11-07  9:41       ` Karel Zak
2016-11-07 10:21         ` Ruediger Meier
2016-11-07 11:37           ` Karel Zak
2016-11-07 12:48             ` Ruediger Meier
2016-11-07 13:38               ` Karel Zak
2016-11-07 13:52                 ` Karel Zak
2016-11-07  9:53 ` [PATCH 1/3] tests: udevadm settle before losetup -d Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox