diff mbox

generic/071: require falloc -k

Message ID 07f34424-ed2c-4f5f-991b-91981367c1a5@sandeen.net (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Sandeen July 20, 2016, 5:34 a.m. UTC
On 7/19/16 9:52 PM, Eryu Guan wrote:
> On Tue, Jul 19, 2016 at 10:30:47AM +0200, Christoph Hellwig wrote:
>> On Mon, Jul 18, 2016 at 11:49:57PM -0700, Eric Sandeen wrote:
>>> Some tests actually do run xfs_io on a real file, but we probably
>>> don't want to go that way.
>>>
>>> The test for finding it in help output seems way too specific,
>>>
>>> _require_xfs_io_command "pwrite" "-Z"
>>>
>>> fails as well because it doesn't hit the specific format in
>>> the grep.
>>>
>>> What if we loosen up the test; is this too loose? (look for param
>>> preceded by whitespace or square bracket)
>>
>> Seems like it's not loose enough as it still tries to run the test
>> on NFS.
> 
> For this NFSv4.2 case, I think we have to actually run "falloc -k" to
> check whether the underlying fs supports (FALLOC_FL_KEEP_SIZE) or not.
> 
> Current check in _require_xfs_io_command only checks whether xfs_io
> knows the given option, not the underlying fs. And in this NFSv4.2 case,
> NFSv4.2 supports fallocate(2), and xfs_io falloc command knows "-k"
> option, so test runs on NFS.

Oh right, sorry.  So, this?


-Eric
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eryu Guan July 20, 2016, 12:40 p.m. UTC | #1
On Tue, Jul 19, 2016 at 10:34:43PM -0700, Eric Sandeen wrote:
> 
> 
> On 7/19/16 9:52 PM, Eryu Guan wrote:
> > On Tue, Jul 19, 2016 at 10:30:47AM +0200, Christoph Hellwig wrote:
> >> On Mon, Jul 18, 2016 at 11:49:57PM -0700, Eric Sandeen wrote:
> >>> Some tests actually do run xfs_io on a real file, but we probably
> >>> don't want to go that way.
> >>>
> >>> The test for finding it in help output seems way too specific,
> >>>
> >>> _require_xfs_io_command "pwrite" "-Z"
> >>>
> >>> fails as well because it doesn't hit the specific format in
> >>> the grep.
> >>>
> >>> What if we loosen up the test; is this too loose? (look for param
> >>> preceded by whitespace or square bracket)
> >>
> >> Seems like it's not loose enough as it still tries to run the test
> >> on NFS.
> > 
> > For this NFSv4.2 case, I think we have to actually run "falloc -k" to
> > check whether the underlying fs supports (FALLOC_FL_KEEP_SIZE) or not.
> > 
> > Current check in _require_xfs_io_command only checks whether xfs_io
> > knows the given option, not the underlying fs. And in this NFSv4.2 case,
> > NFSv4.2 supports fallocate(2), and xfs_io falloc command knows "-k"
> > option, so test runs on NFS.
> 
> Oh right, sorry.  So, this?
> 
> diff --git a/common/rc b/common/rc
> index 6add69e..f087813 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1880,7 +1880,7 @@ _require_xfs_io_command()
>  	testfile=$TEST_DIR/$$.xfs_io
>  	case $command in
>  	"falloc" )
> -		testio=`$XFS_IO_PROG -F -f -c "falloc 0 1m" $testfile 2>&1`
> +		testio=`$XFS_IO_PROG -F -f -c "falloc $param 0 1m" $testfile 2>&1`
>  		;;
>  	"fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" )
>  		testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \

Yes, this works, along with your first update. Or further more, we can
set param="" in the "falloc" case after actually running it? Since we've
already tested the option, no need to check the help message again.

Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common/rc b/common/rc
index 6add69e..f087813 100644
--- a/common/rc
+++ b/common/rc
@@ -1880,7 +1880,7 @@  _require_xfs_io_command()
 	testfile=$TEST_DIR/$$.xfs_io
 	case $command in
 	"falloc" )
-		testio=`$XFS_IO_PROG -F -f -c "falloc 0 1m" $testfile 2>&1`
+		testio=`$XFS_IO_PROG -F -f -c "falloc $param 0 1m" $testfile 2>&1`
 		;;
 	"fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" )
 		testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \