diff options
author | Karel Zak | 2017-12-07 14:41:49 +0100 |
---|---|---|
committer | Karel Zak | 2017-12-07 14:41:49 +0100 |
commit | 9212134d538cb691c3146236d025d8d5499dcfa4 (patch) | |
tree | dad0f2a3e32eb70c8fed9cafb7f6c6a74be2cab3 /tests/ts | |
parent | tests: support multiple locks (diff) | |
download | kernel-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')
-rwxr-xr-x | tests/ts/libmount/loop | 71 | ||||
-rwxr-xr-x | tests/ts/losetup/losetup-loop | 54 |
2 files changed, 75 insertions, 50 deletions
diff --git a/tests/ts/libmount/loop b/tests/ts/libmount/loop index ec22c9a2c..09e894761 100755 --- a/tests/ts/libmount/loop +++ b/tests/ts/libmount/loop @@ -81,14 +81,19 @@ ts_log "Success" ts_finalize_subtest ts_init_subtest "o-loop-val" -[ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT -LODEV=$( $TS_CMD_LOSETUP --find 2>> $TS_OUTPUT ) -$TS_CMD_MOUNT -oloop=$LODEV "$BACKFILE" "$TS_MOUNTPOINT" >> $TS_OUTPUT 2>&1 -verify_mount_dev "$LODEV" "$TS_MOUNTPOINT" >> $TS_OUTPUT 2>&1 -$TS_CMD_UMOUNT "$TS_MOUNTPOINT" >> $TS_OUTPUT 2>&1 -udevadm settle -ts_log "Success" -ts_finalize_subtest +if [ "$TS_PARALLEL" = "yes" ]; then + # There is a race in $LODEV is usage + ts_skip_subtest "no-reentrant" +else + [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT + LODEV=$( $TS_CMD_LOSETUP --find 2>> $TS_OUTPUT ) + $TS_CMD_MOUNT -oloop=$LODEV "$BACKFILE" "$TS_MOUNTPOINT" >> $TS_OUTPUT 2>&1 + verify_mount_dev "$LODEV" "$TS_MOUNTPOINT" >> $TS_OUTPUT 2>&1 + $TS_CMD_UMOUNT "$TS_MOUNTPOINT" >> $TS_OUTPUT 2>&1 + udevadm settle + ts_log "Success" + ts_finalize_subtest +fi ts_init_subtest "reuse" [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT @@ -112,28 +117,38 @@ ts_log "Success" ts_finalize_subtest ts_init_subtest "o-loop-val-initialized" -[ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT -LODEV=$( $TS_CMD_LOSETUP --find 2>> $TS_OUTPUT ) -$TS_CMD_LOSETUP $LODEV "$BACKFILE" >> $TS_OUTPUT 2>&1 -$TS_CMD_MOUNT -oloop=$LODEV "$BACKFILE" "$TS_MOUNTPOINT" 2>&1 \ - | sed 's/:.*:/: <target>/; s/for .*/for <source>/' > $TS_OUTPUT -$TS_CMD_LOSETUP --detach $LODEV >> $TS_OUTPUT 2>&1 -udevadm settle -ts_log "Success" -ts_finalize_subtest +if [ "$TS_PARALLEL" = "yes" ]; then + # There is a race in $LODEV is usage + ts_skip_subtest "no-reentrant" +else + [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT + LODEV=$( $TS_CMD_LOSETUP --find 2>> $TS_OUTPUT ) + $TS_CMD_LOSETUP $LODEV "$BACKFILE" >> $TS_OUTPUT 2>&1 + $TS_CMD_MOUNT -oloop=$LODEV "$BACKFILE" "$TS_MOUNTPOINT" 2>&1 \ + | sed 's/:.*:/: <target>/; s/for .*/for <source>/' > $TS_OUTPUT + $TS_CMD_LOSETUP --detach $LODEV >> $TS_OUTPUT 2>&1 + udevadm settle + ts_log "Success" + ts_finalize_subtest +fi ts_init_subtest "o-loop-val-conflict" -[ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT -cp "$BACKFILE" "$BACKFILE"-2 -LODEV=$( $TS_CMD_LOSETUP --find 2>> $TS_OUTPUT ) -$TS_CMD_LOSETUP $LODEV "$BACKFILE"-2 >> $TS_OUTPUT 2>&1 -$TS_CMD_MOUNT -oloop=$LODEV "$BACKFILE" "$TS_MOUNTPOINT" 2>&1 \ - | sed 's/:.*:/: <target>/; s/for .*/for <source>/' > $TS_OUTPUT -$TS_CMD_LOSETUP --detach $LODEV >> $TS_OUTPUT 2>&1 -rm "$BACKFILE"-2 -udevadm settle -ts_log "Success" -ts_finalize_subtest +if [ "$TS_PARALLEL" = "yes" ]; then + # There is a race in $LODEV is usage + ts_skip_subtest "no-reentrant" +else + [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT + cp "$BACKFILE" "$BACKFILE"-2 + LODEV=$( $TS_CMD_LOSETUP --find 2>> $TS_OUTPUT ) + $TS_CMD_LOSETUP $LODEV "$BACKFILE"-2 >> $TS_OUTPUT 2>&1 + $TS_CMD_MOUNT -oloop=$LODEV "$BACKFILE" "$TS_MOUNTPOINT" 2>&1 \ + | sed 's/:.*:/: <target>/; s/for .*/for <source>/' > $TS_OUTPUT + $TS_CMD_LOSETUP --detach $LODEV >> $TS_OUTPUT 2>&1 + rm "$BACKFILE"-2 + udevadm settle + ts_log "Success" + ts_finalize_subtest +fi ts_log "Success" ts_finalize 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 |