summaryrefslogtreecommitdiff
path: root/lib/variables.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-07-22 16:23:49 -0400
committerPeter Jones <pjones@redhat.com>2021-09-07 17:05:04 -0400
commit3386d4f5b7cf63fba4b1ba9b1c2878617b141b23 (patch)
tree55f3fbf529003c0241c04826457390d4cfa90247 /lib/variables.c
parent54bc72cf0abd306d96782cdfa6db7c71ff72e056 (diff)
downloadefi-boot-shim-3386d4f5b7cf63fba4b1ba9b1c2878617b141b23.tar.gz
efi-boot-shim-3386d4f5b7cf63fba4b1ba9b1c2878617b141b23.zip
tests: add pre and post hooks to the mock variable store
For testing of the mok mirroring behavior, we have to be able to account for what variable calls happened and in what order. In order to support that, this patch adds 8 callbacks: mock_set_variable_pre_hook() mock_set_variable_post_hook() mock_get_variable_pre_hook() mock_get_variable_post_hook() mock_get_next_variable_name_pre_hook() mock_get_next_variable_name_post_hook() mock_query_variable_info_pre_hook() mock_query_variable_info_post_hook() The pre hooks each take the same arguments as their mocked namesake, and they fire before any input validation. The post hooks take an additional EFI_STATUS argument. The post hook fires immediately before any return from the mocked namesake function. For SetVariable(), the arguments when the post hook fires are the current contents of the variable if status is EFI_SUCCESS, and whatever arguments were passed in if status is any other value. For everything else, the arguments are the correct results on EFI_SUCCESS, and whatever was passed in if status is any other value. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'lib/variables.c')
0 files changed, 0 insertions, 0 deletions