summaryrefslogtreecommitdiffstats
path: root/tests/ts/losetup
diff options
context:
space:
mode:
authorKarel Zak2017-12-07 14:41:49 +0100
committerKarel Zak2017-12-07 14:41:49 +0100
commit9212134d538cb691c3146236d025d8d5499dcfa4 (patch)
treedad0f2a3e32eb70c8fed9cafb7f6c6a74be2cab3 /tests/ts/losetup
parenttests: support multiple locks (diff)
downloadkernel-qcow2-util-linux-9212134d538cb691c3146236d025d8d5499dcfa4.tar.gz
kernel-qcow2-util-linux-9212134d538cb691c3146236d025d8d5499dcfa4.tar.xz
kernel-qcow2-util-linux-9212134d538cb691c3146236d025d8d5499dcfa4.zip
tests: don't call tests with races in --parallel
Some of the tests have a race by design (=wanted). Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/losetup')
-rwxr-xr-xtests/ts/losetup/losetup-loop54
1 files changed, 32 insertions, 22 deletions
diff --git a/tests/ts/losetup/losetup-loop b/tests/ts/losetup/losetup-loop
index 6ec521e3a..6d1ef21bc 100755
--- a/tests/ts/losetup/losetup-loop
+++ b/tests/ts/losetup/losetup-loop
@@ -202,34 +202,44 @@ ts_finalize_subtest
udevadm settle
ts_init_subtest "plain-conflict"
-LODEV=$( $TS_CMD_LOSETUP --find --nooverlap --show $BACKFILE )
-if [ -z "$LODEV" ]; then
- ts_log "Failed to create loop device"
+if [ "$TS_PARALLEL" = "yes" ]; then
+ # There is a race in $LODEV is usage
+ ts_skip_subtest "no-reentrant"
+else
+ LODEV=$( $TS_CMD_LOSETUP --find --nooverlap --show $BACKFILE )
+ if [ -z "$LODEV" ]; then
+ ts_log "Failed to create loop device"
+ 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"
+ ts_finalize_subtest
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"
-ts_finalize_subtest
udevadm settle
ts_init_subtest "plain-readonly"
-LODEV=$( $TS_CMD_LOSETUP --find --nooverlap --show --read-only $BACKFILE )
-if [ -z "$LODEV" ]; then
- ts_log "Failed to create loop device"
+if [ "$TS_PARALLEL" = "yes" ]; then
+ # There is a race in $LODEV is usage
+ ts_skip_subtest "no-reentrant"
+else
+ LODEV=$( $TS_CMD_LOSETUP --find --nooverlap --show --read-only $BACKFILE )
+ if [ -z "$LODEV" ]; then
+ ts_log "Failed to create loop device"
+ 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"
+ ts_finalize_subtest
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"
-ts_finalize_subtest
udevadm settle