History log of /linux-master/tools/testing/selftests/user_events/user_events_selftests.h
Revision Date Author Comments
# 8ed99af4 15-Sep-2023 Beau Belgrave <beaub@linux.microsoft.com>

selftests/user_events: Fix to unmount tracefs when test created mount

Fix to unmount tracefs if the self-test mounted it to allow testing.
If tracefs was already mounted, this does nothing.

Suggested-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/all/29fce076-746c-4650-8358-b4e0fa215cf7@sirena.org.uk/
Fixes: a06023a8f78d ("selftests/user_events: Fix failures when user_events is not installed")

Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>


# a06023a8 08-Sep-2023 Beau Belgrave <beaub@linux.microsoft.com>

selftests/user_events: Fix failures when user_events is not installed

When user_events is not installed the self tests currently fail. Now
that these self tests run by default we need to ensure they don't fail
when user_events was not enabled for the kernel being tested.

Add common methods to detect if tracefs and user_events is enabled. If
either is not enabled skip the test. If tracefs is enabled, but is not
mounted, mount tracefs and fail if there were any errors. Fail if not
run as root.

Fixes: 68b4d2d58389 ("selftests/user_events: Reenable build")
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Link: https://lore.kernel.org/all/CA+G9fYuugZ0OMeS6HvpSS4nuf_A3s455ecipGBvER0LJHojKZg@mail.gmail.com/

Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>