* [PATCH selftests 0/2] Add checkbashisms meta-testcase
@ 2019-02-22 1:26 mhiramat
2019-02-22 1:26 ` Masami Hiramatsu
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: mhiramat @ 2019-02-22 1:26 UTC (permalink / raw)
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 at 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 at kernel.org>
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH selftests 0/2] Add checkbashisms meta-testcase
2019-02-22 1:26 [PATCH selftests 0/2] Add checkbashisms meta-testcase mhiramat
@ 2019-02-22 1:26 ` Masami Hiramatsu
2019-02-22 1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean mhiramat
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2019-02-22 1:26 UTC (permalink / raw)
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 at 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 at kernel.org>
^ permalink raw reply [flat|nested] 12+ 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 mhiramat
2019-02-22 1:26 ` Masami Hiramatsu
@ 2019-02-22 1:26 ` mhiramat
2019-02-22 1:26 ` Masami Hiramatsu
2019-02-22 1:27 ` [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase mhiramat
2019-03-23 10:27 ` [PATCH selftests 0/2] " mhiramat
3 siblings, 1 reply; 12+ messages in thread
From: mhiramat @ 2019-02-22 1:26 UTC (permalink / raw)
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 at 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 related [flat|nested] 12+ messages in thread
* [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean
2019-02-22 1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean mhiramat
@ 2019-02-22 1:26 ` Masami Hiramatsu
0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2019-02-22 1:26 UTC (permalink / raw)
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 at 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 related [flat|nested] 12+ 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 mhiramat
2019-02-22 1:26 ` Masami Hiramatsu
2019-02-22 1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean mhiramat
@ 2019-02-22 1:27 ` mhiramat
2019-02-22 1:27 ` Masami Hiramatsu
2019-03-23 10:27 ` [PATCH selftests 0/2] " mhiramat
3 siblings, 1 reply; 12+ messages in thread
From: mhiramat @ 2019-02-22 1:27 UTC (permalink / raw)
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 at 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 related [flat|nested] 12+ messages in thread* [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase
2019-02-22 1:27 ` [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase mhiramat
@ 2019-02-22 1:27 ` Masami Hiramatsu
0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2019-02-22 1:27 UTC (permalink / raw)
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 at 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 related [flat|nested] 12+ messages in thread
* [PATCH selftests 0/2] Add checkbashisms meta-testcase
2019-02-22 1:26 [PATCH selftests 0/2] Add checkbashisms meta-testcase mhiramat
` (2 preceding siblings ...)
2019-02-22 1:27 ` [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase mhiramat
@ 2019-03-23 10:27 ` mhiramat
2019-03-23 10:27 ` Masami Hiramatsu
2019-05-24 2:31 ` rostedt
3 siblings, 2 replies; 12+ messages in thread
From: mhiramat @ 2019-03-23 10:27 UTC (permalink / raw)
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 at 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 at 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 at kernel.org>
--
Masami Hiramatsu <mhiramat at kernel.org>
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH selftests 0/2] Add checkbashisms meta-testcase
2019-03-23 10:27 ` [PATCH selftests 0/2] " mhiramat
@ 2019-03-23 10:27 ` Masami Hiramatsu
2019-05-24 2:31 ` rostedt
1 sibling, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2019-03-23 10:27 UTC (permalink / raw)
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 at 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 at kernel.org>
--
Masami Hiramatsu <mhiramat at kernel.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH selftests 0/2] Add checkbashisms meta-testcase
2019-03-23 10:27 ` [PATCH selftests 0/2] " mhiramat
2019-03-23 10:27 ` Masami Hiramatsu
@ 2019-05-24 2:31 ` rostedt
2019-05-24 2:31 ` Steven Rostedt
2019-05-24 3:02 ` shuah
1 sibling, 2 replies; 12+ messages in thread
From: rostedt @ 2019-05-24 2:31 UTC (permalink / raw)
Shuah,
Want to take this or would you want me to?
-- Steve
On Sat, 23 Mar 2019 19:27:46 +0900
Masami Hiramatsu <mhiramat at 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 at 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 at 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 at kernel.org>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH selftests 0/2] Add checkbashisms meta-testcase
2019-05-24 2:31 ` rostedt
@ 2019-05-24 2:31 ` Steven Rostedt
2019-05-24 3:02 ` shuah
1 sibling, 0 replies; 12+ messages in thread
From: Steven Rostedt @ 2019-05-24 2:31 UTC (permalink / raw)
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 at 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 at kernel.org>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH selftests 0/2] Add checkbashisms meta-testcase
2019-05-24 2:31 ` rostedt
2019-05-24 2:31 ` Steven Rostedt
@ 2019-05-24 3:02 ` shuah
2019-05-24 3:02 ` shuah
1 sibling, 1 reply; 12+ messages in thread
From: shuah @ 2019-05-24 3:02 UTC (permalink / raw)
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] 12+ messages in thread
end of thread, other threads:[~2019-05-24 3:02 UTC | newest]
Thread overview: 12+ 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 mhiramat
2019-02-22 1:26 ` Masami Hiramatsu
2019-02-22 1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean mhiramat
2019-02-22 1:26 ` Masami Hiramatsu
2019-02-22 1:27 ` [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase mhiramat
2019-02-22 1:27 ` Masami Hiramatsu
2019-03-23 10:27 ` [PATCH selftests 0/2] " mhiramat
2019-03-23 10:27 ` Masami Hiramatsu
2019-05-24 2:31 ` rostedt
2019-05-24 2:31 ` Steven Rostedt
2019-05-24 3:02 ` shuah
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