From: Darrick J. Wong Date: Mon, 11 Apr 2022 22:55:02 +0000 (-0700) Subject: common/rc: let xfs_scrub tell us about its unicode checker X-Git-Tag: v2022.05.01~22 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=86e537edb41d9fbda0d6a18a8a30fc5c3f49d886;p=xfstests-dev.git common/rc: let xfs_scrub tell us about its unicode checker Now that xfs_scrub can report whether or not it was built with the Unicode name checker, rewrite _check_xfs_scrub_does_unicode to take advantage of that. This supersedes the old method of trying to observe dynamic library linkages and grepping the binary, neither of which worked very well. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Eryu Guan --- diff --git a/common/rc b/common/rc index 83e932cf..553ae350 100644 --- a/common/rc +++ b/common/rc @@ -4816,6 +4816,18 @@ _check_xfs_scrub_does_unicode() { _supports_xfs_scrub "${mount}" "${dev}" || return 1 + # Newer versions of xfs_scrub advertise whether or not it supports + # Unicode name checks. + local xfs_scrub_ver="$("${XFS_SCRUB_PROG}" -VV)" + + if echo "${xfs_scrub_ver}" | grep -q -- '-Unicode'; then + return 1 + fi + + if echo "${xfs_scrub_ver}" | grep -q -- '+Unicode'; then + return 0 + fi + # If the xfs_scrub binary contains the string "Unicode name.*%s", then # we know that it has the ability to complain about improper Unicode # names.