2022-10-28 08:02:12

by Naveen N. Rao

[permalink] [raw]
Subject: [RESEND PATCH v2 2/2] selftests/ftrace: Convert tracer tests to use 'requires' to specify program dependency

Now that we have a good way to specify dependency of tests on programs,
convert some of the tracer tests to use this method for specifying
dependency on 'chrt'.

Reviewed-by: Steven Rostedt (Google) <[email protected]>
Signed-off-by: Naveen N. Rao <[email protected]>
---
tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc | 7 +------
tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc | 7 +------
2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc b/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc
index 11be10e1bf966a..e8f0fac9a110cc 100644
--- a/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc
+++ b/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc
@@ -1,12 +1,7 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Test wakeup tracer
-# requires: wakeup:tracer
-
-if ! which chrt ; then
- echo "chrt is not found. This test requires nice command."
- exit_unresolved
-fi
+# requires: wakeup:tracer chrt:program

echo wakeup > current_tracer
echo 1 > tracing_on
diff --git a/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc b/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc
index 3a77198b3c6902..79807656785b0f 100644
--- a/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc
+++ b/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc
@@ -1,12 +1,7 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Test wakeup RT tracer
-# requires: wakeup_rt:tracer
-
-if ! which chrt ; then
- echo "chrt is not found. This test requires chrt command."
- exit_unresolved
-fi
+# requires: wakeup_rt:tracer chrt:program

echo wakeup_rt > current_tracer
echo 1 > tracing_on
--
2.38.0



2022-11-04 01:30:08

by Masami Hiramatsu

[permalink] [raw]
Subject: Re: [RESEND PATCH v2 2/2] selftests/ftrace: Convert tracer tests to use 'requires' to specify program dependency

On Fri, 28 Oct 2022 12:46:10 +0530
"Naveen N. Rao" <[email protected]> wrote:

> Now that we have a good way to specify dependency of tests on programs,
> convert some of the tracer tests to use this method for specifying
> dependency on 'chrt'.
>

Looks good to me.

Acked-by: Masami Hiramatsu (Google) <[email protected]>

Thanks!

> Reviewed-by: Steven Rostedt (Google) <[email protected]>
> Signed-off-by: Naveen N. Rao <[email protected]>
> ---
> tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc | 7 +------
> tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc | 7 +------
> 2 files changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc b/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc
> index 11be10e1bf966a..e8f0fac9a110cc 100644
> --- a/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc
> +++ b/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc
> @@ -1,12 +1,7 @@
> #!/bin/sh
> # SPDX-License-Identifier: GPL-2.0
> # description: Test wakeup tracer
> -# requires: wakeup:tracer
> -
> -if ! which chrt ; then
> - echo "chrt is not found. This test requires nice command."
> - exit_unresolved
> -fi
> +# requires: wakeup:tracer chrt:program
>
> echo wakeup > current_tracer
> echo 1 > tracing_on
> diff --git a/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc b/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc
> index 3a77198b3c6902..79807656785b0f 100644
> --- a/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc
> +++ b/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc
> @@ -1,12 +1,7 @@
> #!/bin/sh
> # SPDX-License-Identifier: GPL-2.0
> # description: Test wakeup RT tracer
> -# requires: wakeup_rt:tracer
> -
> -if ! which chrt ; then
> - echo "chrt is not found. This test requires chrt command."
> - exit_unresolved
> -fi
> +# requires: wakeup_rt:tracer chrt:program
>
> echo wakeup_rt > current_tracer
> echo 1 > tracing_on
> --
> 2.38.0
>


--
Masami Hiramatsu (Google) <[email protected]>