summaryrefslogtreecommitdiff
path: root/lib/efi_selftest/efi_selftest_variables.c
AgeCommit message (Collapse)AuthorFilesLines
2020-03-22efi_selftest: check length reported by GetNextVariableName()Heinrich Schuchardt1-2/+8
GetNextVariableName should report the length of the variable including the final 0x0000 in bytes. Check this in the unit test. Increase the buffer size for variable names. 40 bytes is too short. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-10-06efi_selftest: testing read-only variablesHeinrich Schuchardt1-11/+0
The UEFI spec has this sentence: "Variables that have runtime access but that are not nonvolatile are read-only data variables once ExitBootServices() is performed." At least EDK2 therefore treats variable PlatformLangCodes only as read-only at runtime. Nowhere do we make this variable read-only in U-Boot. Do not use variable PlatformLangCodes for testing if the read only attribute of variables is observed before ExitBootServices(). Fixes: 5a24239c951e ("efi_loader: selftest: enable APPEND_WRITE tests") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-10-06efi_selftest: correct SetVariable() testHeinrich Schuchardt1-14/+16
Errors should not only be announced as text but should also result in EFI_ST_FAILURE being returned. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-09-20efi_loader: selftest: enable APPEND_WRITE testsAKASHI Takahiro1-1/+19
Now that APPEND_WRITE is supported, the result check for the only existing test case should be changed to 'todo' to 'error', while two more test cases are added. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-05-24efi: selftest: APPEND_WRITE is not supportedAKASHI Takahiro1-14/+14
The error here should be marked *todo*. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-05-07efi_selftest: remove redundant function efi_st_memcmp()Heinrich Schuchardt1-5/+5
Function memcmp() is available in efi_freestanding.c. So we do not remove a further implementation. Replace all usages of efi_st_memcmp() by memcmp(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-13efi_selftest: fix variables test for GetNextVariableName()AKASHI Takahiro1-5/+8
There is a bug in efi variables test. Fix it with some cosmetic improvements. Please note that efi variables test still fails at QueryVariableInfo() and GetVariable(), but this is not due to a change in this patch. ==8<== Testing EFI API implementation Selected test: 'variables' Setting up 'variables' Setting up 'variables' succeeded Executing 'variables' .../u-boot/lib/efi_selftest/efi_selftest_variables.c(60): TODO: QueryVariableInfo failed .../u-boot/lib/efi_selftest/efi_selftest_variables.c(131): TODO: GetVariable returned wrong length 7 .../u-boot/lib/efi_selftest/efi_selftest_variables.c(133): TODO: GetVariable returned wrong value Executing 'variables' succeeded Boot services terminated Summary: 0 failures ==>8== Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: use const efi_guid_t * for variable servicesHeinrich Schuchardt1-2/+2
The runtime variable services never change GUIDs. So we should declare the GUID parameters as constant. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-12-02efi_selftest: fix typosHeinrich Schuchardt1-4/+2
fix typos correct the header comment of efi_selftest_variables.c Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-06-03efi_selftest: check for buffer overflow in efi_get_variableIvan Gorinov1-1/+17
Allocate a buffer on the stack instead of an array of uninitialized pointers; check if GetVariable writes past the end of the buffer. Signed-off-by: Ivan Gorinov <ivan.gorinov@intel.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-06-03efi_selftest: unit test for variable servicesHeinrich Schuchardt1-0/+180
Provide a unit test for variable services. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>