1
0
Fork 0

test_firmware: wrap custom sysfs load tests into helper

These can run on certain kernel configs. This will allow
us later to enable these tests under the right kernel
configurations.

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Luis R. Rodriguez 2017-11-20 10:24:01 -08:00 committed by Greg Kroah-Hartman
parent 59106c8158
commit 82bdf49516
1 changed files with 31 additions and 18 deletions

View File

@ -256,24 +256,37 @@ run_sysfs_main_tests()
set -e
}
run_sysfs_custom_load_tests()
{
if load_fw_custom "$NAME" "$FW" ; then
if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was not loaded" >&2
exit 1
else
echo "$0: custom fallback loading mechanism works"
fi
fi
if load_fw_custom "$NAME" "$FW" ; then
if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was not loaded" >&2
exit 1
else
echo "$0: custom fallback loading mechanism works"
fi
fi
if load_fw_custom_cancel "nope-$NAME" "$FW" ; then
if diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was expected to be cancelled" >&2
exit 1
else
echo "$0: cancelling custom fallback mechanism works"
fi
fi
}
run_sysfs_main_tests
if load_fw_custom "$NAME" "$FW" ; then
if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was not loaded" >&2
exit 1
else
echo "$0: custom fallback loading mechanism works"
fi
fi
if load_fw_custom_cancel "nope-$NAME" "$FW" ; then
if diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was expected to be cancelled" >&2
exit 1
else
echo "$0: cancelling custom fallback mechanism works"
fi
fi
run_sysfs_custom_load_tests
exit 0