summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/firmware/fw_lib.sh
diff options
context:
space:
mode:
authorScott Branden <scott.branden@broadcom.com>2019-08-22 21:40:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-04 14:31:28 +0300
commit1798045900b7fb24a2b9c37d8517bbcfc5d3eaa9 (patch)
tree59ea48a3d8605a1996bca81371fc2ba7871ab5ee /tools/testing/selftests/firmware/fw_lib.sh
parent7feebfa487b929b3e085f4f11ae7ac9e2e92e848 (diff)
downloadlinux-1798045900b7fb24a2b9c37d8517bbcfc5d3eaa9.tar.xz
selftests: firmware: Add request_firmware_into_buf tests
Add tests cases for checking request_firmware_into_buf api. API was introduced into kernel with no testing present previously. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Acked-by: Luis Chamberlain <mcgrof@kernel.org> Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lore.kernel.org/r/20190822184005.901-3-scott.branden@broadcom.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/firmware/fw_lib.sh')
-rwxr-xr-xtools/testing/selftests/firmware/fw_lib.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/selftests/firmware/fw_lib.sh b/tools/testing/selftests/firmware/fw_lib.sh
index f236cc295450..b879305a766d 100755
--- a/tools/testing/selftests/firmware/fw_lib.sh
+++ b/tools/testing/selftests/firmware/fw_lib.sh
@@ -9,6 +9,12 @@ DIR=/sys/devices/virtual/misc/test_firmware
PROC_CONFIG="/proc/config.gz"
TEST_DIR=$(dirname $0)
+# We need to load a different file to test request_firmware_into_buf
+# I believe the issue is firmware loaded cached vs. non-cached
+# with same filename is bungled.
+# To reproduce rename this to test-firmware.bin
+TEST_FIRMWARE_INTO_BUF_FILENAME=test-firmware-into-buf.bin
+
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
@@ -108,6 +114,8 @@ setup_tmp_file()
FWPATH=$(mktemp -d)
FW="$FWPATH/test-firmware.bin"
echo "ABCD0123" >"$FW"
+ FW_INTO_BUF="$FWPATH/$TEST_FIRMWARE_INTO_BUF_FILENAME"
+ echo "EFGH4567" >"$FW_INTO_BUF"
NAME=$(basename "$FW")
if [ "$TEST_REQS_FW_SET_CUSTOM_PATH" = "yes" ]; then
echo -n "$FWPATH" >/sys/module/firmware_class/parameters/path
@@ -175,6 +183,9 @@ test_finish()
if [ -f $FW ]; then
rm -f "$FW"
fi
+ if [ -f $FW_INTO_BUF ]; then
+ rm -f "$FW_INTO_BUF"
+ fi
if [ -d $FWPATH ]; then
rm -rf "$FWPATH"
fi