summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-07-22 15:45:23 -0400
committerPeter Jones <pjones@redhat.com>2021-09-07 17:05:04 -0400
commit2c9eebcf6ddd198c5ba49d784c4536d05023c28b (patch)
tree2d719e8b49b3d5d0d2ac0e73cae6fa4eafb60dbb /test.c
parent5ed27307d4854e67cf999fd7785b48f5cf488a51 (diff)
downloadefi-boot-shim-2c9eebcf6ddd198c5ba49d784c4536d05023c28b.tar.gz
efi-boot-shim-2c9eebcf6ddd198c5ba49d784c4536d05023c28b.zip
tests: add a mock implementation of {Get,Set}Variable and tests for it
Some tests will need variables, and so we need a mock implementation of the various calls relating to them. This patch adds implementations for the EFI Runtime Services calls GetVariable(), SetVariable(), GetNextVariableName(), and QueryVariableInfo(). Additionally, it enforces tunable limits on storage for variables, and (with only a little work) the limits can be different for SetVariable() vs what is returned by QueryVariableInfo(). That is, it can lie to you like real systems do. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'test.c')
-rw-r--r--test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test.c b/test.c
index 8a4a72ff..46cab533 100644
--- a/test.c
+++ b/test.c
@@ -259,4 +259,12 @@ console_print(const CHAR16 *fmt, ...)
return 0;
}
+#ifndef HAVE_START_IMAGE
+EFI_STATUS
+start_image(EFI_HANDLE image_handle, CHAR16 *ImagePath)
+{
+ return EFI_UNSUPPORTED;
+}
+#endif
+
// vim:fenc=utf-8:tw=75:noet