aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaohiro Aota <naohiro.aota@wdc.com>2023-09-27 15:11:00 +0900
committerZorro Lang <zlang@kernel.org>2023-10-05 22:44:29 +0800
commitffa82237277e4dd842025451911b5f3eee4a16e1 (patch)
treecf9ba3d2b59b34ff9589e1dc14fcdf671b4f8160
parentab81b565f360218e63d71d33d244edae608f9e7a (diff)
downloadxfstests-dev-ffa82237277e4dd842025451911b5f3eee4a16e1.tar.gz
common/rc: check error case and fail the test
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> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
-rw-r--r--common/rc4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/rc b/common/rc
index 84fad4b856..259a1ffb09 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 "$(basename $1).$suffix: could not setup output file"
}
_link_out_file()