diff options
-rwxr-xr-x | tools/testing/selftests/firmware/fw_filesystem.sh | 29 |
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 | ||
49 | NAME=$(basename "$FW") | 49 | NAME=$(basename "$FW") |
50 | 50 | ||
51 | if printf '\000' >"$DIR"/trigger_request; then | ||
52 | echo "$0: empty filename should not succeed" >&2 | ||
53 | exit 1 | ||
54 | fi | ||
55 | |||
56 | if printf '\000' >"$DIR"/trigger_async_request; then | ||
57 | echo "$0: empty filename should not succeed (async)" >&2 | ||
58 | exit 1 | ||
59 | fi | ||
60 | |||
51 | # Request a firmware that doesn't exist, it should fail. | 61 | # Request a firmware that doesn't exist, it should fail. |
52 | echo -n "nope-$NAME" >"$DIR"/trigger_request | 62 | if echo -n "nope-$NAME" >"$DIR"/trigger_request; then |
63 | echo "$0: firmware shouldn't have loaded" >&2 | ||
64 | exit 1 | ||
65 | fi | ||
53 | if diff -q "$FW" /dev/test_firmware >/dev/null ; then | 66 | if 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" |
75 | fi | 88 | fi |
76 | 89 | ||
90 | # Try the asynchronous version too | ||
91 | if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then | ||
92 | echo "$0: could not trigger async request" >&2 | ||
93 | exit 1 | ||
94 | fi | ||
95 | |||
96 | # Verify the contents are what we expect. | ||
97 | if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then | ||
98 | echo "$0: firmware was not loaded (async)" >&2 | ||
99 | exit 1 | ||
100 | else | ||
101 | echo "$0: async filesystem loading works" | ||
102 | fi | ||
103 | |||
77 | exit 0 | 104 | exit 0 |