Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 157339a1 authored by Amit Pundir's avatar Amit Pundir Committed by Shuah Khan
Browse files

selftests: firmware: skip unsupported async loading tests



Ignore async firmware loading tests on older kernel releases,
which do not support this feature.

Fixes: 1b1fe542:
       ("selftests: firmware: add empty string and async tests")
Reviewed-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
Acked-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent 7d33d2b5
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -70,10 +70,14 @@ if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then
	exit 1
fi

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.
if echo -n "nope-$NAME" >"$DIR"/trigger_request 2> /dev/null; then
@@ -105,6 +109,9 @@ else
fi

# Try the asynchronous version too
if [ ! -e "$DIR"/trigger_async_request ]; then
	echo "$0: firmware loading: async trigger not present, ignoring test" >&2
else
	if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then
		echo "$0: could not trigger async request" >&2
		exit 1
@@ -117,6 +124,7 @@ if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
	else
		echo "$0: async filesystem loading works"
	fi
fi

### Batched requests tests
test_config_present()