aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtools/testing/selftests/firmware/fw_filesystem.sh29
1 files changed, 28 insertions, 1 deletions
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
index c4366dc74e01..5c495ad7958a 100755
--- a/tools/testing/selftests/firmware/fw_filesystem.sh
+++ b/tools/testing/selftests/firmware/fw_filesystem.sh
@@ -48,8 +48,21 @@ echo "ABCD0123" >"$FW"
48 48
49NAME=$(basename "$FW") 49NAME=$(basename "$FW")
50 50
51if printf '\000' >"$DIR"/trigger_request; then
52 echo "$0: empty filename should not succeed" >&2
53 exit 1
54fi
55
56if printf '\000' >"$DIR"/trigger_async_request; then
57 echo "$0: empty filename should not succeed (async)" >&2
58 exit 1
59fi
60
51# Request a firmware that doesn't exist, it should fail. 61# Request a firmware that doesn't exist, it should fail.
52echo -n "nope-$NAME" >"$DIR"/trigger_request 62if echo -n "nope-$NAME" >"$DIR"/trigger_request; then
63 echo "$0: firmware shouldn't have loaded" >&2
64 exit 1
65fi
53if diff -q "$FW" /dev/test_firmware >/dev/null ; then 66if diff -q "$FW" /dev/test_firmware >/dev/null ; then
54 echo "$0: firmware was not expected to match" >&2 67 echo "$0: firmware was not expected to match" >&2
55 exit 1 68 exit 1
@@ -74,4 +87,18 @@ else
74 echo "$0: filesystem loading works" 87 echo "$0: filesystem loading works"
75fi 88fi
76 89
90# Try the asynchronous version too
91if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then
92 echo "$0: could not trigger async request" >&2
93 exit 1
94fi
95
96# Verify the contents are what we expect.
97if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
98 echo "$0: firmware was not loaded (async)" >&2
99 exit 1
100else
101 echo "$0: async filesystem loading works"
102fi
103
77exit 0 104exit 0