selftests/ftrace: Fix requirement check of README file

The selftest for ftrace checks some features by checking if the README has
text that states the feature is supported by that kernel. Unfortunately,
this check gives false positives because it many not be checked if there's
spaces in the string to check. This is due to the compare between the
required variable with the ":README" string stripped, because neither has
quotes around them.

Link: https://lkml.kernel.org/r/20210820204742.087177341@goodmis.org

Cc: "Tzvetomir Stoyanov" <tz.stoyanov@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-kselftest@vger.kernel.org
Cc: stable@vger.kernel.org
Fixes: 1b8eec51 ("selftests/ftrace: Support ":README" suffix for requires")
Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent aaac2820
...@@ -137,7 +137,7 @@ check_requires() { # Check required files and tracers ...@@ -137,7 +137,7 @@ check_requires() { # Check required files and tracers
echo "Required tracer $t is not configured." echo "Required tracer $t is not configured."
exit_unsupported exit_unsupported
fi fi
elif [ $r != $i ]; then elif [ "$r" != "$i" ]; then
if ! grep -Fq "$r" README ; then if ! grep -Fq "$r" README ; then
echo "Required feature pattern \"$r\" is not in README." echo "Required feature pattern \"$r\" is not in README."
exit_unsupported exit_unsupported
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment