]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic: Fix _is_block_dev quoting
authorAndreas Gruenbacher <andreas.gruenbacher@gmail.com>
Thu, 14 May 2015 10:27:54 +0000 (20:27 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 14 May 2015 10:27:54 +0000 (20:27 +1000)
Add more quoting so that test cases that don't require a SCRATCH_DEV
won't fail.

Signed-off-by: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc

index 242dedb04e14a1d0863b6be3ee79e13ea5d5f7b3..c3f609025dba67690bbd6af6de8b2035147889e5 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -970,11 +970,11 @@ _is_block_dev()
 
     _dev=$1
     if [ -L "${_dev}" ]; then
-        _dev=`readlink -f ${_dev}`
+        _dev=`readlink -f "${_dev}"`
     fi
 
     if [ -b "${_dev}" ]; then
-        src/lstat64 ${_dev} | $AWK_PROG '/Device type:/ { print $9 }'
+        src/lstat64 "${_dev}" | $AWK_PROG '/Device type:/ { print $9 }'
     fi
 }
 
@@ -1108,11 +1108,11 @@ _require_scratch_nocheck()
                fi
                ;;
        *)
-                if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
+                if [ -z "$SCRATCH_DEV" -o "`_is_block_dev "$SCRATCH_DEV"`" = "" ]
                 then
                     _notrun "this test requires a valid \$SCRATCH_DEV"
                 fi
-                if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ]
+                if [ "`_is_block_dev "$SCRATCH_DEV"`" = "`_is_block_dev "$TEST_DEV"`" ]
                 then
                     _notrun "this test requires a valid \$SCRATCH_DEV"
                 fi
@@ -1182,11 +1182,11 @@ _require_test()
                fi
                ;;
        *)
-                if [ -z "$TEST_DEV" -o "`_is_block_dev $TEST_DEV`" = "" ]
+                if [ -z "$TEST_DEV" ] || [ "`_is_block_dev "$TEST_DEV"`" = "" ]
                 then
                     _notrun "this test requires a valid \$TEST_DEV"
                 fi
-                if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ]
+                if [ "`_is_block_dev "$SCRATCH_DEV"`" = "`_is_block_dev "$TEST_DEV"`" ]
                 then
                     _notrun "this test requires a valid \$TEST_DEV"
                 fi
@@ -2285,10 +2285,10 @@ _require_scratch_dev_pool()
        esac
 
        for i in $SCRATCH_DEV_POOL; do
-               if [ "`_is_block_dev $i`" = "" ]; then
+               if [ "`_is_block_dev "$i"`" = "" ]; then
                        _notrun "this test requires valid block disk $i"
                fi
-               if [ "`_is_block_dev $i`" = "`_is_block_dev $TEST_DEV`" ]; then
+               if [ "`_is_block_dev "$i"`" = "`_is_block_dev "$TEST_DEV"`" ]; then
                        _notrun "$i is part of TEST_DEV, this test requires unique disks"
                fi
                if _mount | grep -q $i; then