public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <guaneryu@gmail.com>
To: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: darrick.wong@oracle.com, ebiggers@google.com,
	yi.zhang@huawei.com, fstests@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH xfstests] generic/192: Move 'cd /' to the place where the program exits
Date: Sun, 13 Oct 2019 20:46:07 +0800	[thread overview]
Message-ID: <20191013124607.GH2622@desktop> (raw)
In-Reply-To: <1570609677-49586-1-git-send-email-chengzhihao1@huawei.com>

On Wed, Oct 09, 2019 at 04:27:57PM +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 debug! But I think the right fix is to call t_dir_type
via "$here", i.e.

	local unknowns=$($here/src/t_dir_type $dir u | wc -l)

'here', which points to the top level dir of xfstests source code, is
defined in every test in test setup, and is guaranteed not to be empty.

Thanks,
Eryu

> ---
>  tests/generic/192 | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/generic/192 b/tests/generic/192
> index 50b3d6fd..5550f39e 100755
> --- a/tests/generic/192
> +++ b/tests/generic/192
> @@ -15,7 +15,12 @@ echo "QA output created by $seq"
>  here=`pwd`
>  tmp=/tmp/$$
>  status=1	# failure is the default!
> -trap "exit \$status" 0 1 2 3 15
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +}
>  
>  _access_time()
>  {
> @@ -46,7 +51,6 @@ sleep $delay # sleep to allow time to move on for access
>  cat $testfile
>  time2=`_access_time $testfile | tee -a $seqres.full`
>  
> -cd /
>  _test_cycle_mount
>  time3=`_access_time $testfile | tee -a $seqres.full`
>  
> -- 
> 2.13.6
> 

  reply	other threads:[~2019-10-13 12:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09  8:27 [PATCH xfstests] generic/192: Move 'cd /' to the place where the program exits Zhihao Cheng
2019-10-13 12:46 ` Eryu Guan [this message]
2019-10-14  2:26   ` Zhihao Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191013124607.GH2622@desktop \
    --to=guaneryu@gmail.com \
    --cc=chengzhihao1@huawei.com \
    --cc=darrick.wong@oracle.com \
    --cc=ebiggers@google.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yi.zhang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox