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: Quote check_requires comparisons

check_requires() compares requirement strings that can contain shell
pattern characters such as '[' and ']'. Under /bin/sh, the unquoted
test expressions can emit 'unexpected operator' warnings while parsing
README-backed requirements.

Quote the relevant comparisons and path checks so the helper handles
those patterns without spurious shell warnings.

Validated by rerunning fprobe_syntax_errors.tc and confirming the
previous '/bin/sh: unexpected operator' lines disappear from the
detailed ftracetest log.

Signed-off-by: Cao Ruichuang <create0818@163.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20260408043212.8063-1-create0818@163.com
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Cao Ruichuang and committed by
Shuah Khan
f8e0a5a1 7e473891

+6 -6
+6 -6
tools/testing/selftests/ftrace/test.d/functions
··· 145 145 p=${i%:program} 146 146 r=${i%:README} 147 147 t=${i%:tracer} 148 - if [ $p != $i ]; then 149 - if ! which $p ; then 148 + if [ "$p" != "$i" ]; then 149 + if ! which "$p" ; then 150 150 echo "Required program $p is not found." 151 151 exit_unresolved 152 152 fi 153 - elif [ $t != $i ]; then 154 - if ! grep -wq $t available_tracers ; then 153 + elif [ "$t" != "$i" ]; then 154 + if ! grep -wq "$t" available_tracers ; then 155 155 echo "Required tracer $t is not configured." 156 156 exit_unsupported 157 157 fi ··· 162 162 else 163 163 test=$TRACING_DIR 164 164 fi 165 - if ! grep -Fq "$r" $test/README ; then 165 + if ! grep -Fq "$r" "$test"/README ; then 166 166 echo "Required feature pattern \"$r\" is not in README." 167 167 exit_unsupported 168 168 fi 169 - elif [ ! -e $i ]; then 169 + elif [ ! -e "$i" ]; then 170 170 echo "Required feature interface $i doesn't exist." 171 171 exit_unsupported 172 172 fi