FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH] Fix warning of "Usage: _is_block_dev dev"
@ 2015-02-12 12:48 Zhaolei
  2015-02-15 23:04 ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: Zhaolei @ 2015-02-12 12:48 UTC (permalink / raw)
  To: fstests; +Cc: Zhao Lei

From: Zhao Lei <zhaolei@cn.fujitsu.com>

_is_block_dev() will show above warning when "$dev" is not exist.
It happened when user hadn't set $SCRATCH_DEV(optional) and check
$TEST_DEV.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 common/rc | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/common/rc b/common/rc
index 5377ba0..d9815c7 100644
--- a/common/rc
+++ b/common/rc
@@ -1167,19 +1167,22 @@ _require_test()
 		fi
 		;;
 	*)
-		 if [ -z "$TEST_DEV" -o "`_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`" ]
-		 then
-		     _notrun "this test requires a valid \$TEST_DEV"
-		 fi
+		if [ -z "$TEST_DEV" -o "`_is_block_dev $TEST_DEV`" = "" ]
+		then
+		    _notrun "this test requires a valid \$TEST_DEV"
+		fi
+		if [ -n "$SCRATCH_DEV" ]
+		then
+		    if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ]
+		    then
+			_notrun "this test requires a valid \$TEST_DEV"
+		    fi
+		fi
 		if [ ! -d "$TEST_DIR" ]
 		then
-		     _notrun "this test requires a valid \$TEST_DIR"
+		    _notrun "this test requires a valid \$TEST_DIR"
 		fi
-		 ;;
+		;;
     esac
 
     # mounted?
-- 
1.8.5.1


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

end of thread, other threads:[~2015-02-16  5:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-12 12:48 [PATCH] Fix warning of "Usage: _is_block_dev dev" Zhaolei
2015-02-15 23:04 ` Dave Chinner
2015-02-16  2:27   ` Zhao Lei
2015-02-16  5:23     ` Dave Chinner

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