Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: firmware: Add firmware_request_platform tests

Add tests cases for checking the new firmware_request_platform api.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20200115163554.101315-7-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Hans de Goede and committed by
Greg Kroah-Hartman
27d05ed3 548193cb

+23
+23
tools/testing/selftests/firmware/fw_filesystem.sh
··· 86 86 fi 87 87 fi 88 88 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 + 89 112 ### Batched requests tests 90 113 test_config_present() 91 114 {