Skip to content

Commit

Permalink
selftests: firmware: skip unsupported async loading tests
Browse files Browse the repository at this point in the history
Ignore async firmware loading tests on older kernel releases,
which do not support this feature.

Fixes: 1b1fe54:
       ("selftests: firmware: add empty string and async tests")
Reviewed-by: Sumit Semwal <[email protected]>
Acked-by: Luis R. Rodriguez <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Amit Pundir <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
  • Loading branch information
pundiramit authored and Shuah Khan committed Nov 15, 2017
1 parent 7d33d2b commit 157339a
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions tools/testing/selftests/firmware/fw_filesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then
exit 1
fi

if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then
echo "$0: empty filename should not succeed (async)" >&2
exit 1
if [ ! -e "$DIR"/trigger_async_request ]; then
echo "$0: empty filename: async trigger not present, ignoring test" >&2
else
if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then
echo "$0: empty filename should not succeed (async)" >&2
exit 1
fi
fi

# Request a firmware that doesn't exist, it should fail.
Expand Down Expand Up @@ -105,17 +109,21 @@ else
fi

# Try the asynchronous version too
if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then
echo "$0: could not trigger async request" >&2
exit 1
fi

# Verify the contents are what we expect.
if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was not loaded (async)" >&2
exit 1
if [ ! -e "$DIR"/trigger_async_request ]; then
echo "$0: firmware loading: async trigger not present, ignoring test" >&2
else
echo "$0: async filesystem loading works"
if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then
echo "$0: could not trigger async request" >&2
exit 1
fi

# Verify the contents are what we expect.
if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was not loaded (async)" >&2
exit 1
else
echo "$0: async filesystem loading works"
fi
fi

### Batched requests tests
Expand Down

0 comments on commit 157339a

Please sign in to comment.