From: Eric Biggers Date: Tue, 21 Nov 2023 22:39:07 +0000 (-0800) Subject: common/rc: fix _require_xfs_io_command with digits in argument X-Git-Tag: v2024.01.14~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8716ac9a3eeadab0dc2a888bc75979213b35c392;p=xfstests-dev.git common/rc: fix _require_xfs_io_command with digits in argument '_require_xfs_io_command set_encpolicy -s' does not work as expected because the following in the output of 'xfs_io -c "help set_encpolicy"': -s LOG2_DUSIZE -- log2 of data unit size ... does not match the regex: "^ -s ([a-zA-Z_]+ )?--" ... because the 2 in the argument name LOG2_DUSIZE is not matched. Fix the regex to support digits in the argument name. Signed-off-by: Eric Biggers Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/common/rc b/common/rc index a9e0ba7e..524ffa02 100644 --- a/common/rc +++ b/common/rc @@ -2726,7 +2726,7 @@ _require_xfs_io_command() [ -n "$param" ] || return if [ -z "$param_checked" ]; then - $XFS_IO_PROG -c "help $command" | grep -E -q "^ $param ([a-zA-Z_]+ )?--" || \ + $XFS_IO_PROG -c "help $command" | grep -E -q "^ $param ([a-zA-Z0-9_]+ )?--" || \ _notrun "xfs_io $command doesn't support $param" else # xfs_io could result in "command %c not supported" if it was