public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH xfstests v2] common/rc: Add path $here before src/t_dir_type
@ 2019-10-16  1:15 Zhihao Cheng
  2019-10-17  9:19 ` Eryu Guan
  0 siblings, 1 reply; 2+ messages in thread
From: Zhihao Cheng @ 2019-10-16  1:15 UTC (permalink / raw)
  To: guaneryu, darrick.wong, ebiggers, yi.zhang; +Cc: fstests

Running generic/192 with overlayfs(Let ubifs as base fs) yields the
following output:

  generic/192 - output mismatch
     QA output created by 192
     sleep for 5 seconds
     test
    +./common/rc: line 316: src/t_dir_type: No such file or directory
     delta1 is in range
     delta2 is in range
    ...

When the use case fails, the call stack in generic/192 is:

  local unknowns=$(src/t_dir_type $dir u | wc -l)	common/rc:316
  _supports_filetype					common/rc:299
  _overlay_mount					common/overlay:52
  _overlay_test_mount					common/overlay:93
  _test_mount						common/rc:407
  _test_cycle_mount					generic/192:50

Before _test_cycle_mount() being invoked, generic/192 executed 'cd /'
to change work dir from 'xfstests-dev' to '/', so src/t_dir_type was not
found.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index cfaabf10..28c27975 100644
--- a/common/rc
+++ b/common/rc
@@ -313,7 +313,7 @@ _supports_filetype()
 		local testfile=$dir/$$.ftype
 		touch $testfile
 		# look for DT_UNKNOWN files
-		local unknowns=$(src/t_dir_type $dir u | wc -l)
+		local unknowns=$($here/src/t_dir_type $dir u | wc -l)
 		rm $testfile
 		# 0 unknowns is success
 		return $unknowns
-- 
2.13.6


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

* Re: [PATCH xfstests v2] common/rc: Add path $here before src/t_dir_type
  2019-10-16  1:15 [PATCH xfstests v2] common/rc: Add path $here before src/t_dir_type Zhihao Cheng
@ 2019-10-17  9:19 ` Eryu Guan
  0 siblings, 0 replies; 2+ messages in thread
From: Eryu Guan @ 2019-10-17  9:19 UTC (permalink / raw)
  To: Zhihao Cheng; +Cc: darrick.wong, ebiggers, yi.zhang, fstests

On Wed, Oct 16, 2019 at 09:15:00AM +0800, Zhihao Cheng wrote:
> Running generic/192 with overlayfs(Let ubifs as base fs) yields the
> following output:
> 
>   generic/192 - output mismatch
>      QA output created by 192
>      sleep for 5 seconds
>      test
>     +./common/rc: line 316: src/t_dir_type: No such file or directory
>      delta1 is in range
>      delta2 is in range
>     ...
> 
> When the use case fails, the call stack in generic/192 is:
> 
>   local unknowns=$(src/t_dir_type $dir u | wc -l)	common/rc:316
>   _supports_filetype					common/rc:299
>   _overlay_mount					common/overlay:52
>   _overlay_test_mount					common/overlay:93
>   _test_mount						common/rc:407
>   _test_cycle_mount					generic/192:50
> 
> Before _test_cycle_mount() being invoked, generic/192 executed 'cd /'
> to change work dir from 'xfstests-dev' to '/', so src/t_dir_type was not
> found.
> 
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>

Thanks for the patch! But I think it's better to fix all similar issues
in the whole fstests tree, I can see there're a lot more tests use
src/<file> without the $here prefix.

Thanks!

Eryu

> ---
>  common/rc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index cfaabf10..28c27975 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -313,7 +313,7 @@ _supports_filetype()
>  		local testfile=$dir/$$.ftype
>  		touch $testfile
>  		# look for DT_UNKNOWN files
> -		local unknowns=$(src/t_dir_type $dir u | wc -l)
> +		local unknowns=$($here/src/t_dir_type $dir u | wc -l)
>  		rm $testfile
>  		# 0 unknowns is success
>  		return $unknowns
> -- 
> 2.13.6
> 

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

end of thread, other threads:[~2019-10-17  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-16  1:15 [PATCH xfstests v2] common/rc: Add path $here before src/t_dir_type Zhihao Cheng
2019-10-17  9:19 ` Eryu Guan

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