diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-12-18 06:08:58 +0000 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-12-20 16:06:48 +0100 |
commit | 9ba35e64fad0fe205b403da7e30656015979a235 (patch) | |
tree | c7a25d603896636f873f95a33393dc3ba25ed300 | |
parent | 70a4ac693d3f1e5ce8cc1bc919c9bd080e1bda77 (diff) | |
download | u-boot-9ba35e64fad0fe205b403da7e30656015979a235.zip u-boot-9ba35e64fad0fe205b403da7e30656015979a235.tar.gz u-boot-9ba35e64fad0fe205b403da7e30656015979a235.tar.bz2 |
efi_selftest: conformance test for GetNextVariableName
Test that GetNextVariableName() checks the parameters.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r-- | lib/efi_selftest/efi_selftest_variables.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/efi_selftest/efi_selftest_variables.c b/lib/efi_selftest/efi_selftest_variables.c index dc1d5c8..c7a3fdb 100644 --- a/lib/efi_selftest/efi_selftest_variables.c +++ b/lib/efi_selftest/efi_selftest_variables.c @@ -141,6 +141,41 @@ static int execute(void) return EFI_ST_FAILURE; } /* Enumerate variables */ + + ret = runtime->get_next_variable_name(NULL, u"efi_st_var1", &guid); + if (ret != EFI_INVALID_PARAMETER) { + efi_st_error("GetNextVariableName missing parameter check\n"); + return EFI_ST_FAILURE; + } + + len = 24; + ret = runtime->get_next_variable_name(&len, NULL, &guid); + if (ret != EFI_INVALID_PARAMETER) { + efi_st_error("GetNextVariableName missing parameter check\n"); + return EFI_ST_FAILURE; + } + + len = 24; + ret = runtime->get_next_variable_name(&len, u"efi_st_var1", NULL); + if (ret != EFI_INVALID_PARAMETER) { + efi_st_error("GetNextVariableName missing parameter check\n"); + return EFI_ST_FAILURE; + } + + len = 1; + ret = runtime->get_next_variable_name(&len, u"", &guid); + if (ret != EFI_INVALID_PARAMETER) { + efi_st_error("GetNextVariableName missing parameter check\n"); + return EFI_ST_FAILURE; + } + + len = 16; + ret = runtime->get_next_variable_name(&len, u"efi_st_var1", &guid); + if (ret != EFI_INVALID_PARAMETER) { + efi_st_error("GetNextVariableName missing parameter check\n"); + return EFI_ST_FAILURE; + } + boottime->set_mem(&guid, 16, 0); *varname = 0; flag = 0; |