Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/ftrace: Fix eventfs ownership testcase to find mount point

Fix eventfs ownership testcase to find mount point if stat -c "%m" failed.
This can happen on the system based on busybox. In this case, this will
try to use the current working directory, which should be a tracefs top
directory (and eventfs is mounted as a part of tracefs.)
If it does not work, the test is skipped as UNRESOLVED because of
the environmental problem.

Fixes: ee9793be08b1 ("tracing/selftests: Add ownership modification tests for eventfs")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Masami Hiramatsu (Google) and committed by
Shuah Khan
f0a6eceb b4bcdff7

+12
+12
tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
··· 6 6 original_owner=`stat -c "%u" .` 7 7 8 8 mount_point=`stat -c '%m' .` 9 + 10 + # If stat -c '%m' does not work (e.g. busybox) or failed, try to use the 11 + # current working directory (which should be a tracefs) as the mount point. 12 + if [ ! -d "$mount_point" ]; then 13 + if mount | grep -qw $PWD ; then 14 + mount_point=$PWD 15 + else 16 + # If PWD doesn't work, that is an environmental problem. 17 + exit_unresolved 18 + fi 19 + fi 20 + 9 21 mount_options=`mount | grep "$mount_point" | sed -e 's/.*(\(.*\)).*/\1/'` 10 22 11 23 # find another owner and group that is not the original