LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH selftests 0/2] Add checkbashisms meta-testcase
@ 2019-02-22  1:26 Masami Hiramatsu
  2019-02-22  1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean Masami Hiramatsu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2019-02-22  1:26 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Juerg Haefliger, Steven Rostedt, Ingo Molnar, linux-kselftest,
	linux-kernel

Hi,

Here are patches for making sure the ftracetest testcases
are checkbashisms clean.

This actually needs a patch from Juerg, "selftests/ftrace:
Make the coloring POSIX compliant" to complete the work.

http://lkml.kernel.org/r/20190220161333.28109-1-juergh@canonical.com
(Note that this is still under development)

So as Juerg pointed, recently ftracetest becomes not POSIX
compliant, and such kind of issues happened repeatedly.
To avoid those anymore, I decided to introduce a testcase
which runs checkbasisms on ftracetest and its testcases.
I think this can help us to find out whether it was
written in a way out of POSIX.

Thank you,

---

Masami Hiramatsu (2):
      selftests/ftrace: Make a script checkbashisms clean
      selftests/ftrace: Add checkbashisms meta-testcase


 tools/testing/selftests/ftrace/ftracetest          |    1 +
 .../ftrace/test.d/kprobe/kprobe_ftrace.tc          |    2 +-
 .../selftests/ftrace/test.d/selftest/bashisms.tc   |   21 ++++++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean
  2019-02-22  1:26 [PATCH selftests 0/2] Add checkbashisms meta-testcase Masami Hiramatsu
@ 2019-02-22  1:26 ` Masami Hiramatsu
  2019-02-22  1:27 ` [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase Masami Hiramatsu
  2019-03-23 10:27 ` [PATCH selftests 0/2] " Masami Hiramatsu
  2 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2019-02-22  1:26 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Juerg Haefliger, Steven Rostedt, Ingo Molnar, linux-kselftest,
	linux-kernel

Make kprobe_ftrace.tc checkbashisms clean. Since
"grep function available_tracers" causes an error
on checkbashisms, fix it by explicitly escaping
with double-quotations.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../ftrace/test.d/kprobe/kprobe_ftrace.tc          |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
index 492426e95e09..7650a82db3f5 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
@@ -3,7 +3,7 @@
 # description: Kprobe dynamic event with function tracer
 
 [ -f kprobe_events ] || exit_unsupported # this is configurable
-grep function available_tracers || exit_unsupported # this is configurable
+grep "function" available_tracers || exit_unsupported # this is configurable
 
 # prepare
 echo nop > current_tracer


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase
  2019-02-22  1:26 [PATCH selftests 0/2] Add checkbashisms meta-testcase Masami Hiramatsu
  2019-02-22  1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean Masami Hiramatsu
@ 2019-02-22  1:27 ` Masami Hiramatsu
  2019-03-23 10:27 ` [PATCH selftests 0/2] " Masami Hiramatsu
  2 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2019-02-22  1:27 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Juerg Haefliger, Steven Rostedt, Ingo Molnar, linux-kselftest,
	linux-kernel

Add a meta-testcase which tests ftracetest itself with
checkbasisms. This helps us to keep our test script
bashisms clean.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 tools/testing/selftests/ftrace/ftracetest          |    1 +
 .../selftests/ftrace/test.d/selftest/bashisms.tc   |   21 ++++++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 75244db70331..72b6df37cdb9 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -313,6 +313,7 @@ run_test() { # testfile
     local testlog=/proc/self/fd/1
   fi
   export TMPDIR=`mktemp -d /tmp/ftracetest-dir.XXXXXX`
+  export FTRACETEST_ROOT=$TOP_DIR
   echo "execute$INSTANCE: "$1 > $testlog
   SIG_RESULT=0
   if [ $VERBOSE -eq -1 ]; then
diff --git a/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc b/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
new file mode 100644
index 000000000000..1b081e910e14
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
@@ -0,0 +1,21 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: Meta-selftest: Checkbashisms
+
+if [ ! -f $FTRACETEST_ROOT/ftracetest ]; then
+  echo "Hmm, we can not find ftracetest"
+  exit_unresolved
+fi
+
+if ! which checkbashisms > /dev/null 2>&1 ; then
+  echo "No checkbashisms found. skipped."
+  exit_unresolved
+fi
+
+checkbashisms $FTRACETEST_ROOT/ftracetest
+checkbashisms $FTRACETEST_ROOT/test.d/functions
+for t in $(find $FTRACETEST_ROOT/test.d -name \*.tc); do
+  checkbashisms $t
+done
+
+exit 0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH selftests 0/2] Add checkbashisms meta-testcase
  2019-02-22  1:26 [PATCH selftests 0/2] Add checkbashisms meta-testcase Masami Hiramatsu
  2019-02-22  1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean Masami Hiramatsu
  2019-02-22  1:27 ` [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase Masami Hiramatsu
@ 2019-03-23 10:27 ` Masami Hiramatsu
  2019-05-24  2:31   ` Steven Rostedt
  2 siblings, 1 reply; 6+ messages in thread
From: Masami Hiramatsu @ 2019-03-23 10:27 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Shuah Khan, Juerg Haefliger, Steven Rostedt, Ingo Molnar,
	linux-kselftest, linux-kernel

Hi Shuah,

Could you pick this to your tree? I think this can prevent further
simillar errors before release...

Thank you,

On Fri, 22 Feb 2019 10:26:27 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Hi,
> 
> Here are patches for making sure the ftracetest testcases
> are checkbashisms clean.
> 
> This actually needs a patch from Juerg, "selftests/ftrace:
> Make the coloring POSIX compliant" to complete the work.
> 
> http://lkml.kernel.org/r/20190220161333.28109-1-juergh@canonical.com
> (Note that this is still under development)
> 
> So as Juerg pointed, recently ftracetest becomes not POSIX
> compliant, and such kind of issues happened repeatedly.
> To avoid those anymore, I decided to introduce a testcase
> which runs checkbasisms on ftracetest and its testcases.
> I think this can help us to find out whether it was
> written in a way out of POSIX.
> 
> Thank you,
> 
> ---
> 
> Masami Hiramatsu (2):
>       selftests/ftrace: Make a script checkbashisms clean
>       selftests/ftrace: Add checkbashisms meta-testcase
> 
> 
>  tools/testing/selftests/ftrace/ftracetest          |    1 +
>  .../ftrace/test.d/kprobe/kprobe_ftrace.tc          |    2 +-
>  .../selftests/ftrace/test.d/selftest/bashisms.tc   |   21 ++++++++++++++++++++
>  3 files changed, 23 insertions(+), 1 deletion(-)
>  create mode 100644 tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
> 
> --
> Masami Hiramatsu (Linaro) <mhiramat@kernel.org>


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH selftests 0/2] Add checkbashisms meta-testcase
  2019-03-23 10:27 ` [PATCH selftests 0/2] " Masami Hiramatsu
@ 2019-05-24  2:31   ` Steven Rostedt
  2019-05-24  3:02     ` shuah
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2019-05-24  2:31 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Masami Hiramatsu, Juerg Haefliger, Ingo Molnar, linux-kselftest,
	linux-kernel


Shuah,

Want to take this or would you want me to?

-- Steve


On Sat, 23 Mar 2019 19:27:46 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Hi Shuah,
> 
> Could you pick this to your tree? I think this can prevent further
> simillar errors before release...
> 
> Thank you,
> 
> On Fri, 22 Feb 2019 10:26:27 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > Hi,
> > 
> > Here are patches for making sure the ftracetest testcases
> > are checkbashisms clean.
> > 
> > This actually needs a patch from Juerg, "selftests/ftrace:
> > Make the coloring POSIX compliant" to complete the work.
> > 
> > http://lkml.kernel.org/r/20190220161333.28109-1-juergh@canonical.com
> > (Note that this is still under development)
> > 
> > So as Juerg pointed, recently ftracetest becomes not POSIX
> > compliant, and such kind of issues happened repeatedly.
> > To avoid those anymore, I decided to introduce a testcase
> > which runs checkbasisms on ftracetest and its testcases.
> > I think this can help us to find out whether it was
> > written in a way out of POSIX.
> > 
> > Thank you,
> > 
> > ---
> > 
> > Masami Hiramatsu (2):
> >       selftests/ftrace: Make a script checkbashisms clean
> >       selftests/ftrace: Add checkbashisms meta-testcase
> > 
> > 
> >  tools/testing/selftests/ftrace/ftracetest          |    1 +
> >  .../ftrace/test.d/kprobe/kprobe_ftrace.tc          |    2 +-
> >  .../selftests/ftrace/test.d/selftest/bashisms.tc   |   21 ++++++++++++++++++++
> >  3 files changed, 23 insertions(+), 1 deletion(-)
> >  create mode 100644 tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
> > 
> > --
> > Masami Hiramatsu (Linaro) <mhiramat@kernel.org>  
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH selftests 0/2] Add checkbashisms meta-testcase
  2019-05-24  2:31   ` Steven Rostedt
@ 2019-05-24  3:02     ` shuah
  0 siblings, 0 replies; 6+ messages in thread
From: shuah @ 2019-05-24  3:02 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu, Juerg Haefliger, Ingo Molnar, linux-kselftest,
	linux-kernel, shuah

On 5/23/19 8:31 PM, Steven Rostedt wrote:
> 
> Shuah,
> 
> Want to take this or would you want me to?
> 
> -- Steve
> 
> 

I can take them through my tree.

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-24  3:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22  1:26 [PATCH selftests 0/2] Add checkbashisms meta-testcase Masami Hiramatsu
2019-02-22  1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean Masami Hiramatsu
2019-02-22  1:27 ` [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase Masami Hiramatsu
2019-03-23 10:27 ` [PATCH selftests 0/2] " Masami Hiramatsu
2019-05-24  2:31   ` Steven Rostedt
2019-05-24  3:02     ` shuah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).