]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: fix _require_xfs_io_command with digits in argument
authorEric Biggers <ebiggers@google.com>
Tue, 21 Nov 2023 22:39:07 +0000 (14:39 -0800)
committerZorro Lang <zlang@kernel.org>
Sun, 14 Jan 2024 12:39:09 +0000 (20:39 +0800)
'_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 <ebiggers@google.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc

index a9e0ba7e22f1d9f1f001048745e82124e79d9a44..524ffa02aa6a863e6f4683f2e542033885db84d9 100644 (file)
--- 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