aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_selftest/efi_selftest_variables.c
Commit message (Collapse)AuthorAgeFilesLines
* efi_selftest: conformance test for GetNextVariableNameHeinrich Schuchardt2022-12-201-0/+35
| | | | | | | Test that GetNextVariableName() checks the parameters. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* efi: Use 16-bit unicode stringsSimon Glass2022-02-031-11/+11
| | | | | | | | | | At present we use wide characters for unicode but this is not necessary. Change the code to use the 'u' literal instead. This helps to fix build warnings for sandbox on rpi. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: check length reported by GetNextVariableName()Heinrich Schuchardt2020-03-221-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>
* efi_selftest: testing read-only variablesHeinrich Schuchardt2019-10-061-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>
* efi_selftest: correct SetVariable() testHeinrich Schuchardt2019-10-061-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>
* efi_loader: selftest: enable APPEND_WRITE testsAKASHI Takahiro2019-09-201-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>
* efi: selftest: APPEND_WRITE is not supportedAKASHI Takahiro2019-05-241-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>
* efi_selftest: remove redundant function efi_st_memcmp()Heinrich Schuchardt2019-05-071-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>
* efi_selftest: fix variables test for GetNextVariableName()AKASHI Takahiro2019-02-131-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>
* efi_loader: use const efi_guid_t * for variable servicesHeinrich Schuchardt2019-02-131-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>
* efi_selftest: fix typosHeinrich Schuchardt2018-12-021-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>
* efi_selftest: check for buffer overflow in efi_get_variableIvan Gorinov2018-06-031-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>
* efi_selftest: unit test for variable servicesHeinrich Schuchardt2018-06-031-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>