[PATCH blktests 2/2] nvme/{041,042,043,044,045}: require kernel config NVME_HOST_AUTH

Hannes Reinecke hare at suse.de
Tue Nov 14 21:59:38 PST 2023


On 11/15/23 06:52, Shin'ichiro Kawasaki wrote:
> The kernel commit d68006348288 ("nvme: rework NVME_AUTH Kconfig
> selection") in v6.7-rc1 introduced a new kernel config option
> NVME_HOST_AUTH. The nvme test cases from 041 to 045 fail when the option
> is disabled. Check the requirement of the test cases.
> 
> Reported-by: Yi Zhang <yi.zhang at redhat.com>
> Link: https://lore.kernel.org/linux-nvme/CAHj4cs_Lprbh1zWsJ2yT6+qhNoqjrGDrBgx+XOYvU9SLpmLTtw@mail.gmail.com/
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
> ---
>   tests/nvme/041 | 1 +
>   tests/nvme/042 | 1 +
>   tests/nvme/043 | 1 +
>   tests/nvme/044 | 1 +
>   tests/nvme/045 | 1 +
>   5 files changed, 5 insertions(+)
> 
> diff --git a/tests/nvme/041 b/tests/nvme/041
> index d23f10a..a7a5b38 100755
> --- a/tests/nvme/041
> +++ b/tests/nvme/041
> @@ -14,6 +14,7 @@ requires() {
>   	_have_loop
>   	_have_kernel_option NVME_AUTH
>   	_have_kernel_option NVME_TARGET_AUTH
> +	_kver_gt_or_eq 6 7 && _have_kernel_option NVME_HOST_AUTH
>   	_require_nvme_trtype_is_fabrics
>   	_require_nvme_cli_auth
>   }
> diff --git a/tests/nvme/042 b/tests/nvme/042
> index 9fda681..50d56d6 100755
> --- a/tests/nvme/042
> +++ b/tests/nvme/042
> @@ -14,6 +14,7 @@ requires() {
>   	_have_loop
>   	_have_kernel_option NVME_AUTH
>   	_have_kernel_option NVME_TARGET_AUTH
> +	_kver_gt_or_eq 6 7 && _have_kernel_option NVME_HOST_AUTH
>   	_require_nvme_trtype_is_fabrics
>   	_require_nvme_cli_auth
>   }
> diff --git a/tests/nvme/043 b/tests/nvme/043
> index c6a0aa0..b5f10bc 100755
> --- a/tests/nvme/043
> +++ b/tests/nvme/043
> @@ -14,6 +14,7 @@ requires() {
>   	_have_loop
>   	_have_kernel_option NVME_AUTH
>   	_have_kernel_option NVME_TARGET_AUTH
> +	_kver_gt_or_eq 6 7 && _have_kernel_option NVME_HOST_AUTH
>   	_require_nvme_trtype_is_fabrics
>   	_require_nvme_cli_auth
>   	_have_driver dh_generic
> diff --git a/tests/nvme/044 b/tests/nvme/044
> index 7bd43f3..06e17d1 100755
> --- a/tests/nvme/044
> +++ b/tests/nvme/044
> @@ -14,6 +14,7 @@ requires() {
>   	_have_loop
>   	_have_kernel_option NVME_AUTH
>   	_have_kernel_option NVME_TARGET_AUTH
> +	_kver_gt_or_eq 6 7 && _have_kernel_option NVME_HOST_AUTH
>   	_require_nvme_trtype_is_fabrics
>   	_require_nvme_cli_auth
>   	_have_driver dh_generic
> diff --git a/tests/nvme/045 b/tests/nvme/045
> index 1eb1032..126060c 100755
> --- a/tests/nvme/045
> +++ b/tests/nvme/045
> @@ -15,6 +15,7 @@ requires() {
>   	_have_loop
>   	_have_kernel_option NVME_AUTH
>   	_have_kernel_option NVME_TARGET_AUTH
> +	_kver_gt_or_eq 6 7 && _have_kernel_option NVME_HOST_AUTH
>   	_require_nvme_trtype_is_fabrics
>   	_require_nvme_cli_auth
>   	_have_driver dh_generic

Why do we need to check for the kernel version?
Any kernel not having the NVME_HOST_AUTH config symbol clearly will
have it unset, no?
I'd rather update _have_kernel_option to handle the case where
a config symbol is not present, treating it as unset.
That way we can drop the dependency on the kernel version (which, btw, 
is kinda pointless for the development branches anyway).

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman




More information about the Linux-nvme mailing list