FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: fstests@vger.kernel.org, zlang@kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v3 2/4] common: link .out file to the output directory
Date: Fri, 25 Sep 2026 13:04:10 -0700	[thread overview]
Message-ID: <20260925200410.GN6253@frogsfrogsfrogs> (raw)
In-Reply-To: <20260925104514.664260-3-aalbersh@kernel.org>

On Fri, Sep 25, 2026 at 12:45:10PM +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.
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>

Looks good, thanks for fixing the diff instructions.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  check     | 14 +++++++++-----
>  common/rc |  4 ++--
>  2 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/check b/check
> index bca302151955..534c2cdf7a06 100755
> --- a/check
> +++ b/check
> @@ -1050,7 +1050,7 @@ function run_section()
>  		mkdir -p $RESULT_DIR
>  		rm -f ${RESULT_DIR}/require_scratch*
>  		rm -f ${RESULT_DIR}/require_test*
> -		rm -f $seqres.out.bad $seqres.hints
> +		rm -f $seqres.out.bad $seqres.hints $seqres.out.good
>  
>  		# check if we really should run it
>  		if _expunge_test $seqnum; then
> @@ -1181,7 +1181,11 @@ function run_section()
>  		$timestamp && _timestamp
>  		stop=`_wallclock`
>  
> -		if [ ! -f $seq.out ]; then
> +		local out=$here/$seq.out
> +		if [ -f $seqres.out.good ]; then
> +			out=$seqres.out.good
> +		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 $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-25 20:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 10:45 [PATCH v3 0/4] xfstests: random fixes Andrey Albershteyn
2026-09-25 10:45 ` [PATCH v3 1/4] xfs/071: use _link_out_link instead of opencoding file picking Andrey Albershteyn
2026-09-25 20:03   ` Darrick J. Wong
2026-09-25 10:45 ` [PATCH v3 2/4] common: link .out file to the output directory Andrey Albershteyn
2026-09-25 20:04   ` Darrick J. Wong [this message]
2026-09-25 10:45 ` [PATCH v3 3/4] generic/452: make coping work with multi-call binary Andrey Albershteyn
2026-09-25 20:02   ` Darrick J. Wong
2026-09-25 10:45 ` [PATCH v3 4/4] xfstests: fix permissions on system file installed by libtoolize Andrey Albershteyn
2026-09-25 20:04   ` Darrick J. Wong
2026-09-27 11:50 ` [PATCH v3 0/4] xfstests: random fixes Zorro Lang

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=20260925200410.GN6253@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=zlang@kernel.org \
    /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