FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH] common/rc: check error case and fail the test
@ 2023-09-27  6:11 Naohiro Aota
  2023-09-27 14:33 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Naohiro Aota @ 2023-09-27  6:11 UTC (permalink / raw)
  To: fstests; +Cc: Naohiro Aota

If we place /var/lib/xfstests on a read-only filesystem, commands in
_link_out_file_named() fail to modify the files. However, they won't fail
the test. As a result, the test case fails mysteriously with only "no
qualified output" printed.

Fix it by checking the error case.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 common/rc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/rc b/common/rc
index 76a7e7740318..4e9bd34f7772 100644
--- a/common/rc
+++ b/common/rc
@@ -3431,8 +3431,8 @@ _link_out_file_named()
 		}
 		print $result
 		' <$seqfull.cfg)
-	rm -f $1
-	ln -fs $(basename $1).$suffix $1
+	rm -f $1 || _fail "_link_out_file_named: failed to remove existing output file"
+	ln -fs $(basename $1).$suffix $1 || _fail "_link_out_file_named: failed to setup output file"
 }
 
 _link_out_file()
-- 
2.42.0


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

end of thread, other threads:[~2023-09-27 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27  6:11 [PATCH] common/rc: check error case and fail the test Naohiro Aota
2023-09-27 14:33 ` Darrick J. Wong

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