Re: [PATCH 08/12] btrfs: test case prerequisite _require_btrfs_mkfs_uuid_option

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Thu, Feb 15, 2024 at 6:35 AM Anand Jain <anand.jain@xxxxxxxxxx> wrote:
>
> For easier and more effective testing of btrfs tempfsid, newer versions
> of mkfs.btrfs contain options such as --device-uuid. Check if the
> currently running mkfs.btrfs contains this option.
>
> Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
> ---
>  common/btrfs | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/common/btrfs b/common/btrfs
> index 61d5812d49d9..9a7fa2c71ec5 100644
> --- a/common/btrfs
> +++ b/common/btrfs
> @@ -88,6 +88,22 @@ _require_btrfs_mkfs_feature()
>                 _notrun "Feature $feat not supported in the available version of mkfs.btrfs"
>  }
>
> +_require_btrfs_mkfs_uuid_option()
> +{
> +       local cnt
> +       local feature
> +
> +       if [ -z $1 ]; then
> +               echo "Missing option name argument for _require_btrfs_mkfs_option"
> +               exit 1
> +       fi
> +       feature=$1
> +       cnt=$($MKFS_BTRFS_PROG --help 2>&1 |grep -E --count "\-\-uuid|\-\-device-uuid")

A space between | and grep would make things more readable and match
the general coding style.

> +       if [ $cnt != 2 ]; then
> +               _notrun "Require $MKFS_BTRFS_PROG with --uuid and --device-uuid option"

option -> options.

Otherwise it looks fine, thanks.

> +       fi
> +}
> +
>  _require_btrfs_fs_feature()
>  {
>         if [ -z $1 ]; then
> --
> 2.39.3
>
>





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux