public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] common/rc: modify _require_xfs_io_command function
@ 2016-05-17 16:36 Zorro Lang
  2016-05-17 16:36 ` [PATCH 2/2] generic/352: new case test mmaped data when blocksize less than pagesize Zorro Lang
  2016-05-18 23:55 ` [PATCH 1/2] common/rc: modify _require_xfs_io_command function Dave Chinner
  0 siblings, 2 replies; 6+ messages in thread
From: Zorro Lang @ 2016-05-17 16:36 UTC (permalink / raw)
  To: fstests; +Cc: Zorro Lang

1. This function try to run $XFS_IO_PROG -c "$command help", that's
wrong. It should be "help $command".

2. The $param can't be used for all command's options, for example
"help pwrite" include:

 -Z N -- zeed the random number generator (used when writing randomly)
         (heh, zorry, the -s/-S arguments were already in use in pwrite)

We should make param="-Z N", not only "-Z". After this patch, we can
run this function as:

  _require_xfs_io_command pwrite -Z N

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 common/rc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/rc b/common/rc
index 51092a0..3b87d7e 100644
--- a/common/rc
+++ b/common/rc
@@ -1874,7 +1874,8 @@ _require_xfs_io_command()
 		exit 1
 	fi
 	command=$1
-	param=$2
+	shift
+	param="$*"
 
 	testfile=$TEST_DIR/$$.xfs_io
 	case $command in
@@ -1896,7 +1897,7 @@ _require_xfs_io_command()
 			_notrun "xfs_io $command support is missing"
 		;;
 	*)
-		testio=`$XFS_IO_PROG -c "$command help" 2>&1`
+		testio=`$XFS_IO_PROG -c "help $command" 2>&1`
 	esac
 
 	rm -f $testfile 2>&1 > /dev/null
-- 
2.5.5


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

end of thread, other threads:[~2016-05-23  9:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-17 16:36 [PATCH 1/2] common/rc: modify _require_xfs_io_command function Zorro Lang
2016-05-17 16:36 ` [PATCH 2/2] generic/352: new case test mmaped data when blocksize less than pagesize Zorro Lang
2016-05-23  9:07   ` Eryu Guan
2016-05-23  9:19     ` Zirong Lang
2016-05-18 23:55 ` [PATCH 1/2] common/rc: modify _require_xfs_io_command function Dave Chinner
2016-05-19  3:36   ` Zirong Lang

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