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

selftests: firmware: send expected errors to /dev/null

Error that we expect should not be spilled to stdout.

Without this we get:

./fw_filesystem.sh: line 58: printf: write error: Invalid argument
./fw_filesystem.sh: line 63: printf: write error: No such device
./fw_filesystem.sh: line 69: echo: write error: No such file or directory
./fw_filesystem.sh: filesystem loading works
./fw_filesystem.sh: async filesystem loading works

With it:

./fw_filesystem.sh: filesystem loading works
./fw_filesystem.sh: async filesystem loading works

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Luis R. Rodriguez and committed by
Greg Kroah-Hartman
880444e2 f5786313

+3 -3
+3 -3
tools/testing/selftests/firmware/fw_filesystem.sh
··· 63 63 64 64 NAME=$(basename "$FW") 65 65 66 - if printf '\000' >"$DIR"/trigger_request; then 66 + if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then 67 67 echo "$0: empty filename should not succeed" >&2 68 68 exit 1 69 69 fi 70 70 71 - if printf '\000' >"$DIR"/trigger_async_request; then 71 + if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then 72 72 echo "$0: empty filename should not succeed (async)" >&2 73 73 exit 1 74 74 fi 75 75 76 76 # Request a firmware that doesn't exist, it should fail. 77 - if echo -n "nope-$NAME" >"$DIR"/trigger_request; then 77 + if echo -n "nope-$NAME" >"$DIR"/trigger_request 2> /dev/null; then 78 78 echo "$0: firmware shouldn't have loaded" >&2 79 79 exit 1 80 80 fi