aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ftrace/test.d/functions
diff options
context:
space:
mode:
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>2022-10-28 12:46:09 +0530
committerShuah Khan <skhan@linuxfoundation.org>2022-10-28 02:01:11 -0600
commit4aa4d4def2993ea1a0481e080de11b26bc1ac6c7 (patch)
treed7accb4c3a8f1ab971ac63d8e8826608dab497df /tools/testing/selftests/ftrace/test.d/functions
parentselftests/watchdog: Fix spelling mistake "Temeprature" -> "Temperature" (diff)
downloadlinux-4aa4d4def2993ea1a0481e080de11b26bc1ac6c7.tar.gz
linux-4aa4d4def2993ea1a0481e080de11b26bc1ac6c7.zip
selftests/ftrace: Add check for ping command for trigger tests
All these tests depend on the ping command and will fail if it is not found. Allow tests to specify dependencies on programs through the 'requires' field. Add dependency on 'ping' for some of the trigger tests. Link: https://lore.kernel.org/all/20221017104312.16af5467@gandalf.local.home/ Reported-by: Akanksha J N <akanksha@linux.vnet.ibm.com> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Suggested-by: Steven Rostedt (Google) <rostedt@goodmis.org> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/ftrace/test.d/functions')
-rw-r--r--tools/testing/selftests/ftrace/test.d/functions8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index 5f6cbec847fc..779f3e62ec90 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -142,9 +142,15 @@ finish_ftrace() {
check_requires() { # Check required files and tracers
for i in "$@" ; do
+ p=${i%:program}
r=${i%:README}
t=${i%:tracer}
- if [ $t != $i ]; then
+ if [ $p != $i ]; then
+ if ! which $p ; then
+ echo "Required program $p is not found."
+ exit_unresolved
+ fi
+ elif [ $t != $i ]; then
if ! grep -wq $t available_tracers ; then
echo "Required tracer $t is not configured."
exit_unsupported