diff options
author | Ruediger Meier <ruediger.meier@ga-group.nl> | 2016-11-05 16:08:09 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2016-11-07 10:51:43 +0100 |
commit | d289685caca838eb3b8063d13d072b5eefab1b35 (patch) | |
tree | 759bdccd12709d2bbad79a3e1c702b1056a2434a | |
parent | 2be1b27228c26a73094e045dbe86706f19a78d3a (diff) | |
download | util-linux-d289685caca838eb3b8063d13d072b5eefab1b35.tar.gz |
tests: always quote $LODEV
Since there is no error handling in this test $LODEV
may be empty.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
-rwxr-xr-x | tests/ts/losetup/losetup-loop | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/ts/losetup/losetup-loop b/tests/ts/losetup/losetup-loop index cff12c9f82..13ccc65080 100755 --- a/tests/ts/losetup/losetup-loop +++ b/tests/ts/losetup/losetup-loop @@ -42,15 +42,15 @@ BACKFILE="$TS_DEVICE" ts_init_subtest "find-race-condition" LODEV=$( $TS_CMD_LOSETUP --find --nooverlap --show $BACKFILE ) -$TS_CMD_LOSETUP -d $LODEV +$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 ) udevadm settle -dd if=/dev/zero of=$LODEV count=1 bs=1 >/dev/null 2>&1 -$TS_CMD_LOSETUP --list | grep -q $LODEV +dd if=/dev/zero of="$LODEV" count=1 bs=1 >/dev/null 2>&1 +$TS_CMD_LOSETUP --list | grep -q "$LODEV" ts_log $? udevadm settle -$TS_CMD_LOSETUP -d $LODEV >/dev/null 2>&1 +$TS_CMD_LOSETUP -d "$LODEV" >/dev/null 2>&1 ts_log "Success" ts_finalize_subtest @@ -71,10 +71,10 @@ if test "$LODEV" = "$LODEVR" ; then else echo "different" >>$TS_OUTPUT if test -n "$LODEVR" ; then - $TS_CMD_LOSETUP -d $LODEVR + $TS_CMD_LOSETUP -d "$LODEVR" fi fi -$TS_CMD_LOSETUP -d $LODEV +$TS_CMD_LOSETUP -d "$LODEV" ts_log "Success" ts_finalize_subtest @@ -95,10 +95,10 @@ if test "$LODEV" = "$LODEVR" ; then else echo "different" >>$TS_OUTPUT if test -n "$LODEVR" ; then - $TS_CMD_LOSETUP -d $LODEVR + $TS_CMD_LOSETUP -d "$LODEVR" fi fi -$TS_CMD_LOSETUP -d $LODEV +$TS_CMD_LOSETUP -d "$LODEV" ts_log "Success" ts_finalize_subtest @@ -119,10 +119,10 @@ if test "$LODEV" = "$LODEVR" ; then else echo "different" >>$TS_OUTPUT if test -n "$LODEVR" ; then - $TS_CMD_LOSETUP -d $LODEVR + $TS_CMD_LOSETUP -d "$LODEVR" fi fi -$TS_CMD_LOSETUP -d $LODEV +$TS_CMD_LOSETUP -d "$LODEV" ts_log "Success" ts_finalize_subtest @@ -143,10 +143,10 @@ if test "$LODEV" = "$LODEVR" ; then else echo "different" >>$TS_OUTPUT if test -n "$LODEVR" ; then - $TS_CMD_LOSETUP -d $LODEVR + $TS_CMD_LOSETUP -d "$LODEVR" fi fi -$TS_CMD_LOSETUP -d $LODEV +$TS_CMD_LOSETUP -d "$LODEV" ts_log "Success" ts_finalize_subtest @@ -167,11 +167,11 @@ if test "$LODEV" = "$LODEVR" ; then else echo "different" >>$TS_OUTPUT if test -n "$LODEVR" ; then - $TS_CMD_LOSETUP -d $LODEVR + $TS_CMD_LOSETUP -d "$LODEVR" fi fi -$TS_CMD_LOSETUP -d $LODEV -$TS_CMD_LOSETUP -d $LODEVR >/dev/null 2>&1 +$TS_CMD_LOSETUP -d "$LODEV" +$TS_CMD_LOSETUP -d "$LODEVR" >/dev/null 2>&1 ts_log "Success" ts_finalize_subtest @@ -192,10 +192,10 @@ if test "$LODEV" = "$LODEVR" ; then else echo "different" >>$TS_OUTPUT if test -n "$LODEVR" ; then - $TS_CMD_LOSETUP -d $LODEVR + $TS_CMD_LOSETUP -d "$LODEVR" fi fi -$TS_CMD_LOSETUP -d $LODEV +$TS_CMD_LOSETUP -d "$LODEV" ts_log "Success" ts_finalize_subtest @@ -207,11 +207,11 @@ 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_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_CMD_LOSETUP -d "$LODEV" +$TS_CMD_LOSETUP -d "$LODEVR" >/dev/null 2>&1 ts_log "Success" ts_finalize_subtest @@ -223,11 +223,11 @@ 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_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_CMD_LOSETUP -d "$LODEV" +$TS_CMD_LOSETUP -d "$LODEVR" >/dev/null 2>&1 ts_log "Success" ts_finalize_subtest |