Skip to content

Commit 27d05ed

Browse files
jwrdegoedegregkh
authored andcommitted
selftests: firmware: Add firmware_request_platform tests
Add tests cases for checking the new firmware_request_platform api. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Luis Chamberlain <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 548193c commit 27d05ed

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tools/testing/selftests/firmware/fw_filesystem.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,29 @@ else
8686
fi
8787
fi
8888

89+
# Try platform (EFI embedded fw) loading too
90+
if [ ! -e "$DIR"/trigger_request_platform ]; then
91+
echo "$0: firmware loading: platform trigger not present, ignoring test" >&2
92+
else
93+
if printf '\000' >"$DIR"/trigger_request_platform 2> /dev/null; then
94+
echo "$0: empty filename should not succeed (platform)" >&2
95+
exit 1
96+
fi
97+
98+
# Note we echo a non-existing name, since files on the file-system
99+
# are preferred over firmware embedded inside the platform's firmware
100+
# The test adds a fake entry with the requested name to the platform's
101+
# fw list, so the name does not matter as long as it does not exist
102+
if ! echo -n "nope-$NAME" >"$DIR"/trigger_request_platform ; then
103+
echo "$0: could not trigger request platform" >&2
104+
exit 1
105+
fi
106+
107+
# The test verifies itself that the loaded firmware contents matches
108+
# the contents for the fake platform fw entry it added.
109+
echo "$0: platform loading works"
110+
fi
111+
89112
### Batched requests tests
90113
test_config_present()
91114
{

0 commit comments

Comments
 (0)