Skip to contentSkip to conversation

Patch "selftests: firmware: add empty string and async tests" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Nov 10, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

selftests: firmware: add empty string and async tests

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
selftests-firmware-add-empty-string-and-async-tests.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 1b1fe542b6f010cf6bc7e1c92805e1c0e133e007 Mon Sep 17 00:00:00 2001

From: Brian Norris <[email protected]>
Date: Wed, 9 Dec 2015 14:50:29 -0800
Subject: selftests: firmware: add empty string and async tests

From: Brian Norris <[email protected]>

commit 1b1fe542b6f010cf6bc7e1c92805e1c0e133e007 upstream.

Now that we've added a 'trigger_async_request' knob to test the request_firmware_nowait() API, let's use it. Also add tests for the empty ("") string, since there have been a couple errors in that handling already.

Since we now have real ways that the sysfs write might fail, let's add the appropriate check on the 'echo' lines too.

[AmitP: Dropped the async trigger testing parts from original commit]
---
 tools/testing/selftests/firmware/fw_filesystem.sh |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tools/testing/selftests/firmware/fw_filesystem.sh +9 -1
@@ -48,8 +48,16 @@ echo "ABCD0123" >"$FW"
 
 NAME=$(basename "$FW")
 
+if printf '\000' >"$DIR"/trigger_request; then
+	echo "$0: empty filename should not succeed" >&2
+	exit 1
+fi
+
 # Request a firmware that doesn't exist, it should fail.
-echo -n "nope-$NAME" >"$DIR"/trigger_request
+if echo -n "nope-$NAME" >"$DIR"/trigger_request; then
+	echo "$0: firmware shouldn't have loaded" >&2
+	exit 1
+fi
 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
 	echo "$0: firmware was not expected to match" >&2
 	exit 1

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/selftests-firmware-add-empty-string-and-async-tests.patch queue-4.4/test-firmware_class-report-errors-properly-on-failure.patch