All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: fstests@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2 2/4] common: link .out file to the output directory
Date: Wed, 23 Sep 2026 18:42:55 +0800	[thread overview]
Message-ID: <arOjWJbkDT5Y-MNy@zlang-mailbox> (raw)
In-Reply-To: <20260923093259.16199-3-aalbersh@kernel.org>

On Wed, Sep 23, 2026 at 11:32:53AM +0200, Andrey Albershteyn wrote:
> On immutable systems with read-only system packages 'ln' will fail to
> link .out files into system xfstests root directory. Fix this by linking
> golden output file to the results output directory as a .out.good.

I was wondering, did you install xfstests into a read-only directory/fs and
then redirect results to a writable directory by setting
RESULT_BASE=/path/to/rw_dir?

>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
> ---
>  check     | 12 ++++++++----
>  common/rc |  4 ++--
>  2 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/check b/check
> index bca302151955..aaed9f4af2ac 100755
> --- a/check
> +++ b/check
> @@ -1181,7 +1181,11 @@ function run_section()
>  		$timestamp && _timestamp
>  		stop=`_wallclock`
>  
> -		if [ ! -f $seq.out ]; then
> +		local out=$seq.out
> +		if [ -f $seqres.out.good ]; then
> +			out=$seqres.out.good

Since we are introducing this new .out.good file, although it works fine in
most cases, I think we should probably clean it up before each test starts,
just like we already do for .out.bad and .hints in ./check .

Thanks,
Zorro

> +		fi
> +		if [ ! -f $out ]; then
>  			_dump_err "no qualified output"
>  			tc_status="fail"
>  			rm -f "$seqres.mountfail?"
> @@ -1193,7 +1197,7 @@ function run_section()
>  		# from `foo' to 'foo'. Filter old versions to match the new
>  		# version.
>  		sed -i "s/\`/\'/g" $tmp.out
> -		if diff $seq.out $tmp.out >/dev/null 2>&1 ; then
> +		if diff $out $tmp.out >/dev/null 2>&1 ; then
>  			if [ "$tc_status" != "fail" ]; then
>  				echo "$seqnum `expr $stop - $start`" >>$tmp.time
>  				echo -n " `expr $stop - $start`s"
> @@ -1202,13 +1206,13 @@ function run_section()
>  		else
>  			_dump_err "- output mismatch (see $seqres.out.bad)"
>  			mv $tmp.out $seqres.out.bad
> -			$diff $seq.out $seqres.out.bad | {
> +			$diff $out $seqres.out.bad | {
>  			if test "$DIFF_LENGTH" -le 0; then
>  				cat
>  			else
>  				head -n "$DIFF_LENGTH"
>  				echo "..."
> -				echo "(Run '$diff $here/$seq.out $seqres.out.bad'" \
> +				echo "(Run '$diff $here/$out $seqres.out.bad'" \
>  					" to see the entire diff)"
>  			fi; } | sed -e 's/^\(.\)/    \1/'
>  			tc_status="fail"
> diff --git a/common/rc b/common/rc
> index 3958ac934980..1eccd60c0bc0 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3907,8 +3907,8 @@ _link_out_file_named()
>  		print $result
>  		' <$seqfull.cfg)
>  	rm -f $1 || _fail "_link_out_file_named: failed to remove existing output file"
> -	ln -fs $(basename $1).$suffix $1 || _fail "$(basename $1).$suffix: could not setup output file"
> -	test -r $1 || _fail "$(basename $1).$suffix: output file for feature set \"$2\" not found"
> +	ln -fs $(realpath $1).$suffix $seqres.out.good || _fail "$(basename $1).$suffix: could not setup output file"
> +	test -r $seqres.out.good || _fail "$(basename $1).$suffix: output file for feature set \"$2\" not found"
>  }
>  
>  _link_out_file()
> -- 
> 2.54.0
> 

  reply	other threads:[~2026-09-23 10:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  9:32 [PATCH v2 0/4] xfstests: random fixes Andrey Albershteyn
2026-09-23  9:32 ` [PATCH v2 1/4] xfs/071: use _link_out_link instead of opencoding file picking Andrey Albershteyn
2026-09-23  9:32 ` [PATCH v2 2/4] common: link .out file to the output directory Andrey Albershteyn
2026-09-23 10:42   ` Zorro Lang [this message]
2026-09-23 12:28     ` Andrey Albershteyn
2026-09-23 15:18   ` Darrick J. Wong
2026-09-24 13:25     ` Zorro Lang
2026-09-23  9:32 ` [PATCH v2 3/4] generic/452: make coping work with multi-call binary Andrey Albershteyn
2026-09-23  9:32 ` [PATCH v2 4/4] xfstests: fix permissions on system file installed by libtoolize Andrey Albershteyn

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=arOjWJbkDT5Y-MNy@zlang-mailbox \
    --to=zlang@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@lst.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.