diff mbox series

[v2,10/32] selftests/ftrace: Fix checkbashisms errors

Message ID 153443723502.23257.14228272091408974348.stgit@devbox (mailing list archive)
State Superseded
Headers show
Series selftests/ftrace: Improve ftracetest with coverage check | expand

Commit Message

Masami Hiramatsu (Google) Aug. 16, 2018, 4:33 p.m. UTC
Fix a test case to make checkbashisms clean.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../trigger/trigger-trace-marker-snapshot.tc       |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Steven Rostedt Aug. 24, 2018, 9:50 p.m. UTC | #1
On Fri, 17 Aug 2018 01:33:55 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Fix a test case to make checkbashisms clean.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>  .../trigger/trigger-trace-marker-snapshot.tc       |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
> index 79ce7d51350b..df246e505af7 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
> @@ -39,10 +39,10 @@ test_trace() {
>  	fi
>  	echo "testing $line for >$x<"
>  	match=`echo $line | sed -e "s/>$x<//"`
> -	if [ "$line" == "$match" ]; then
> +	if [ "$line" = "$match" ]; then
>  	    fail "$line does not have >$x< in it"
>  	fi
> -	let x=$x+2
> +	x=$((x+2))

I didn't realize "let" was a bashism. I've been using that on other
shells I believe. But whatever.

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

>      done
>  }
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
index 79ce7d51350b..df246e505af7 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
@@ -39,10 +39,10 @@  test_trace() {
 	fi
 	echo "testing $line for >$x<"
 	match=`echo $line | sed -e "s/>$x<//"`
-	if [ "$line" == "$match" ]; then
+	if [ "$line" = "$match" ]; then
 	    fail "$line does not have >$x< in it"
 	fi
-	let x=$x+2
+	x=$((x+2))
     done
 }