ACK: [PATCH 4/4] uefirtauthvar: check variable runtime services supported before testing (LP: #1913351)

Alex Hung alex.hung at canonical.com
Thu May 13 19:24:22 UTC 2021


On 2021-05-13 4:01 a.m., Ivan Hu wrote:
> The uefirtauthvar tests use the getvariable and setvariable runtime services.
> Add checking the get and set variable services supported status before runing
> the related tests.
> 
> Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
> ---
>  src/uefi/uefirtauthvar/uefirtauthvar.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
> index 644d99c9..e6ab9d45 100644
> --- a/src/uefi/uefirtauthvar/uefirtauthvar.c
> +++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
> @@ -54,6 +54,8 @@ static const uint32_t attributes =
>  
>  static uint16_t variablenametest[] = {'A', 'u', 't', 'h', 'V', 'a', 'r', 'T', 'e', 's', 't', '\0'};
>  
> +static uint32_t runtimeservicessupported;
> +
>  static long setvar(
>  	EFI_GUID *guid,
>  	uint32_t var_attributes,
> @@ -118,6 +120,18 @@ static int uefirtauthvar_init(fwts_framework *fw)
>  	if (fwts_lib_efi_runtime_module_init(fw, &fd) == FWTS_ABORTED)
>  		return FWTS_ABORTED;
>  
> +	fwts_uefi_rt_support_status_get(fd, &runtimeservicessupported);
> +
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE)) {
> +		fwts_skipped(fw, "Skipping test, SetVariable runtime service "
> +			"is not supported on this platform.");
> +		return FWTS_SKIP;
> +	} else if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE)) {
> +		fwts_skipped(fw, "Skipping test, GetVariable runtime service "
> +			"is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	uefirtvariable_env_cleanup();
>  
>  	return FWTS_OK;
> 


Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list