Skip to content

Commit 4a3134b

Browse files
rostedtshuahkh
authored andcommitted
selftests/tracing: Test only toplevel README file not the instances
For the tests that have both a README attribute as well as the instance flag to run the tests as an instance, the instance version will always exit with UNSUPPORTED. That's because the instance directory does not contain a README file. Currently, the tests check for a README file in the directory that the test runs in and if there's a requirement for something to be present in the README file, it will not find it, as the instance directory doesn't have it. Have the tests check if the current directory is an instance directory, and if it is, check two directories above the current directory for the README file: /sys/kernel/tracing/README /sys/kernel/tracing/instances/foo/../../README Link: https://lore.kernel.org/r/20250220185846.130216270@goodmis.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent a64dcfb commit 4a3134b

File tree

1 file changed

+7
-1
lines changed
  • tools/testing/selftests/ftrace/test.d

1 file changed

+7
-1
lines changed

tools/testing/selftests/ftrace/test.d/functions

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,13 @@ check_requires() { # Check required files and tracers
156156
exit_unsupported
157157
fi
158158
elif [ "$r" != "$i" ]; then
159-
if ! grep -Fq "$r" README ; then
159+
# If this is an instance, check the top directory
160+
if echo $TRACING_DIR | grep -q "/instances/"; then
161+
test="$TRACING_DIR/../.."
162+
else
163+
test=$TRACING_DIR
164+
fi
165+
if ! grep -Fq "$r" $test/README ; then
160166
echo "Required feature pattern \"$r\" is not in README."
161167
exit_unsupported
162168
fi

0 commit comments

Comments
 (0)