Message ID | 20230330091143.193392-2-po-hsu.lin@canonical.com |
---|---|
State | New |
Headers | show |
Series | selftests/ftrace: Fix bash specific "==" operator | expand |
On 30/03/2023 11:11, Po-Hsu Lin wrote: > From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org> > > BugLink: https://bugs.launchpad.net/bugs/2006453 > > 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> > Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> > (cherry picked from commit 1e6b485c922fbedf41d5a9f4e6449c5aeb923a32) > Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> > --- > tools/testing/selftests/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 27a68bb..d9b8127 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 Acked-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On Thu, Mar 30 2023, Po-Hsu Lin wrote: > From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org> > > BugLink: https://bugs.launchpad.net/bugs/2006453 > > 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> > Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> > (cherry picked from commit 1e6b485c922fbedf41d5a9f4e6449c5aeb923a32) > Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> > --- > tools/testing/selftests/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 27a68bb..d9b8127 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 > -- > 2.7.4 Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> - -- Regards, Marcelo -----BEGIN PGP SIGNATURE----- iQHQBAEBCgA6FiEExJjLjAfVL0XbfEr56e82LoessAkFAmQldSocHG1hcmNlbG8u Y2VycmlAY2Fub25pY2FsLmNvbQAKCRDp7zYuh6ywCS06DAC+eJlToH9aP8SmS1uN Q6qhrONxzcOtC5Iz4b7bQ0QvvI3pbp87Nu7b2jzlDu0BNuR1FoKQPOLvDWtsMsLs C4tMISZ+VD2970M7EgIqmc3l72NUUCz5o++OjO9Vmdh/0GPUFJbkO2ViASM3pZPA jJruGHrrPIHkPVWT6EBEKqqt2D/dY7QXhNHbXuNi+ny4XnsWEb9FszuQCsDISnRA 1O0LQI8HeIKCm8Aefj1hBR6qbSMpQ8HRmanNch2/1pB9uk5OuJS/JySXrVwZpz61 RbyQqZ1x/jDzNNYizd4QjLuSAuhfj5ugWKF4uTJkxlAEUUa7ShYenouRHzpSlc7U shRWXx0besqK5RZu5+IVFwARNW6OfN+G+Lp8aLyIeKu64R9TZA22XBxYn0G/iPyc eVx+lTkKkwvn9wvZtyghWWT5FL9ut6MvKtkBM+BXd02Hnb/dnqI/gsILR1/QOrrh VkSoKpb0AFNuYd2M9tA2ciUbhh+vNCrowhHKv1suK7II+i8= =stkJ -----END PGP SIGNATURE-----
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 27a68bb..d9b8127 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