* [PATCH] selftests/ftrace: Fix bash specific "==" operator
@ 2023-01-21 23:32 Masami Hiramatsu (Google)
2023-01-25 0:16 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Masami Hiramatsu (Google) @ 2023-01-21 23:32 UTC (permalink / raw)
To: Shuah Khan, Steven Rostedt
Cc: Yipeng Zou, Masami Hiramatsu, linux-kernel, linux-trace-kernel,
linux-kselftest
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Since commit a1d6cd88c897 ("selftests/ftrace: event_triggers: wait
longer for test_event_enable") introduced bash specific "=="
comparation operator, that test will fail when we run it on a
posix-shell. `checkbashisms` warned it as below.
possible bashism in ftrace/func_event_triggers.tc line 45 (should be 'b = a'):
if [ "$e" == $val ]; then
This replaces it with "=".
Fixes: a1d6cd88c897 ("selftests/ftrace: event_triggers: wait longer for test_event_enable")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
.../ftrace/test.d/ftrace/func_event_triggers.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
index 3eea2abf68f9..2ad7d4b501cc 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
@@ -42,7 +42,7 @@ test_event_enabled() {
while [ $check_times -ne 0 ]; do
e=`cat $EVENT_ENABLE`
- if [ "$e" == $val ]; then
+ if [ "$e" = $val ]; then
return 0
fi
sleep $SLEEP_TIME
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/ftrace: Fix bash specific "==" operator
2023-01-21 23:32 [PATCH] selftests/ftrace: Fix bash specific "==" operator Masami Hiramatsu (Google)
@ 2023-01-25 0:16 ` Steven Rostedt
2023-02-03 16:56 ` Shuah Khan
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2023-01-25 0:16 UTC (permalink / raw)
To: Masami Hiramatsu (Google)
Cc: Shuah Khan, Yipeng Zou, linux-kernel, linux-trace-kernel,
linux-kselftest, Shuah Khan
On Sun, 22 Jan 2023 08:32:50 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> Since commit a1d6cd88c897 ("selftests/ftrace: event_triggers: wait
> longer for test_event_enable") introduced bash specific "=="
> comparation operator, that test will fail when we run it on a
> posix-shell. `checkbashisms` warned it as below.
>
> possible bashism in ftrace/func_event_triggers.tc line 45 (should be 'b = a'):
> if [ "$e" == $val ]; then
>
> This replaces it with "=".
>
> Fixes: a1d6cd88c897 ("selftests/ftrace: event_triggers: wait longer for test_event_enable")
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Shuah,
Care to pull this through your tree?
-- Steve
> ---
> .../ftrace/test.d/ftrace/func_event_triggers.tc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
> index 3eea2abf68f9..2ad7d4b501cc 100644
> --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
> +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
> @@ -42,7 +42,7 @@ test_event_enabled() {
>
> while [ $check_times -ne 0 ]; do
> e=`cat $EVENT_ENABLE`
> - if [ "$e" == $val ]; then
> + if [ "$e" = $val ]; then
> return 0
> fi
> sleep $SLEEP_TIME
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/ftrace: Fix bash specific "==" operator
2023-01-25 0:16 ` Steven Rostedt
@ 2023-02-03 16:56 ` Shuah Khan
0 siblings, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2023-02-03 16:56 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu (Google)
Cc: Shuah Khan, Yipeng Zou, linux-kernel, linux-trace-kernel,
linux-kselftest, Shuah Khan
On 1/24/23 17:16, Steven Rostedt wrote:
> On Sun, 22 Jan 2023 08:32:50 +0900
> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
>
>> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>>
>> Since commit a1d6cd88c897 ("selftests/ftrace: event_triggers: wait
>> longer for test_event_enable") introduced bash specific "=="
>> comparation operator, that test will fail when we run it on a
>> posix-shell. `checkbashisms` warned it as below.
>>
>> possible bashism in ftrace/func_event_triggers.tc line 45 (should be 'b = a'):
>> if [ "$e" == $val ]; then
>>
>> This replaces it with "=".
>>
>> Fixes: a1d6cd88c897 ("selftests/ftrace: event_triggers: wait longer for test_event_enable")
>> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
>
> Shuah,
>
> Care to pull this through your tree?
>
Yes. Will appear shortly in linux-kselftest next.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-03 16:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-21 23:32 [PATCH] selftests/ftrace: Fix bash specific "==" operator Masami Hiramatsu (Google)
2023-01-25 0:16 ` Steven Rostedt
2023-02-03 16:56 ` Shuah Khan
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).