diff options
| -rwxr-xr-x | tools/testing/selftests/firmware/fw_filesystem.sh | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh index 62f2d6f54929..b1f20fef36c7 100755 --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh | |||
| @@ -70,9 +70,13 @@ if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then | |||
| 70 | exit 1 | 70 | exit 1 |
| 71 | fi | 71 | fi |
| 72 | 72 | ||
| 73 | if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then | 73 | if [ ! -e "$DIR"/trigger_async_request ]; then |
| 74 | echo "$0: empty filename should not succeed (async)" >&2 | 74 | echo "$0: empty filename: async trigger not present, ignoring test" >&2 |
| 75 | exit 1 | 75 | else |
| 76 | if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then | ||
| 77 | echo "$0: empty filename should not succeed (async)" >&2 | ||
| 78 | exit 1 | ||
| 79 | fi | ||
| 76 | fi | 80 | fi |
| 77 | 81 | ||
| 78 | # Request a firmware that doesn't exist, it should fail. | 82 | # Request a firmware that doesn't exist, it should fail. |
| @@ -105,17 +109,21 @@ else | |||
| 105 | fi | 109 | fi |
| 106 | 110 | ||
| 107 | # Try the asynchronous version too | 111 | # Try the asynchronous version too |
| 108 | if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then | 112 | if [ ! -e "$DIR"/trigger_async_request ]; then |
| 109 | echo "$0: could not trigger async request" >&2 | 113 | echo "$0: firmware loading: async trigger not present, ignoring test" >&2 |
| 110 | exit 1 | ||
| 111 | fi | ||
| 112 | |||
| 113 | # Verify the contents are what we expect. | ||
| 114 | if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then | ||
| 115 | echo "$0: firmware was not loaded (async)" >&2 | ||
| 116 | exit 1 | ||
| 117 | else | 114 | else |
| 118 | echo "$0: async filesystem loading works" | 115 | if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then |
| 116 | echo "$0: could not trigger async request" >&2 | ||
| 117 | exit 1 | ||
| 118 | fi | ||
| 119 | |||
| 120 | # Verify the contents are what we expect. | ||
| 121 | if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then | ||
| 122 | echo "$0: firmware was not loaded (async)" >&2 | ||
| 123 | exit 1 | ||
| 124 | else | ||
| 125 | echo "$0: async filesystem loading works" | ||
| 126 | fi | ||
| 119 | fi | 127 | fi |
| 120 | 128 | ||
| 121 | ### Batched requests tests | 129 | ### Batched requests tests |
