All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Albershteyn <aalbersh@kernel.org>
To: fstests@vger.kernel.org, zlang@kernel.org
Cc: Andrey Albershteyn <aalbersh@kernel.org>
Subject: [PATCH 2/4] common: link .out file to the output directory
Date: Fri, 18 Sep 2026 19:32:07 +0200	[thread overview]
Message-ID: <20260918173218.1254465-3-aalbersh@kernel.org> (raw)
In-Reply-To: <20260918173218.1254465-1-aalbersh@kernel.org>

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.

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
+		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 cb6db6799c97..570a9511c9be 100644
--- a/common/rc
+++ b/common/rc
@@ -3893,8 +3893,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


  parent reply	other threads:[~2026-09-18 17:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 17:32 [PATCH 0/4] xfstests: random fixes Andrey Albershteyn
2026-09-18 17:32 ` [PATCH 1/4] xfs/071: use _link_out_link instead of opencoding file picking Andrey Albershteyn
2026-09-22 12:37   ` Christoph Hellwig
2026-09-18 17:32 ` Andrey Albershteyn [this message]
2026-09-22 12:38   ` [PATCH 2/4] common: link .out file to the output directory Christoph Hellwig
2026-09-22 13:12     ` Andrey Albershteyn
2026-09-18 17:32 ` [PATCH 3/4] generic/452: make coping work with multi-call binary Andrey Albershteyn
2026-09-22 12:40   ` Christoph Hellwig
2026-09-18 17:32 ` [PATCH 4/4] xfstests: fix permissions on system file installed by libtoolize Andrey Albershteyn
2026-09-22 12:40   ` Christoph Hellwig

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=20260918173218.1254465-3-aalbersh@kernel.org \
    --to=aalbersh@kernel.org \
    --cc=fstests@vger.kernel.org \
    --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 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.