linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/powerpc: make the test check in eeh-basic.sh posix compliant
@ 2020-12-28  4:34 Po-Hsu Lin
  2021-01-04  9:46 ` Frederic Barrat
  2021-02-03 11:40 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Po-Hsu Lin @ 2020-12-28  4:34 UTC (permalink / raw)
  To: linux-kernel, linux-kselftest, linuxppc-dev
  Cc: oohall, po-hsu.lin, shuah, paulus

The == operand is a bash extension, thus this will fail on Ubuntu with

As the /bin/sh on Ubuntu is pointed to DASH.

Use -eq to fix this posix compatibility issue.

Fixes: 996f9e0f93f162 ("selftests/powerpc: Fix eeh-basic.sh exit codes")
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/powerpc/eeh/eeh-basic.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/powerpc/eeh/eeh-basic.sh b/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
index 0d783e1..64779f0 100755
--- a/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
+++ b/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
@@ -86,5 +86,5 @@ echo "$failed devices failed to recover ($dev_count tested)"
 lspci | diff -u $pre_lspci -
 rm -f $pre_lspci
 
-test "$failed" == 0
+test "$failed" -eq 0
 exit $?
-- 
2.7.4


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

* Re: [PATCH] selftests/powerpc: make the test check in eeh-basic.sh posix compliant
  2020-12-28  4:34 [PATCH] selftests/powerpc: make the test check in eeh-basic.sh posix compliant Po-Hsu Lin
@ 2021-01-04  9:46 ` Frederic Barrat
  2021-02-03 11:40 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Frederic Barrat @ 2021-01-04  9:46 UTC (permalink / raw)
  To: linuxppc-dev



On 28/12/2020 05:34, Po-Hsu Lin wrote:
> The == operand is a bash extension, thus this will fail on Ubuntu with
> 

Error message is somehow missing. It should read:
"./eeh-basic.sh: 89: test: 2: unexpected operator"

> As the /bin/sh on Ubuntu is pointed to DASH.
> 
> Use -eq to fix this posix compatibility issue.
> 
> Fixes: 996f9e0f93f162 ("selftests/powerpc: Fix eeh-basic.sh exit codes")
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> ---


With the above,
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>

Thanks!

>   tools/testing/selftests/powerpc/eeh/eeh-basic.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/powerpc/eeh/eeh-basic.sh b/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
> index 0d783e1..64779f0 100755
> --- a/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
> +++ b/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
> @@ -86,5 +86,5 @@ echo "$failed devices failed to recover ($dev_count tested)"
>   lspci | diff -u $pre_lspci -
>   rm -f $pre_lspci
>   
> -test "$failed" == 0
> +test "$failed" -eq 0
>   exit $?
> 

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

* Re: [PATCH] selftests/powerpc: make the test check in eeh-basic.sh posix compliant
  2020-12-28  4:34 [PATCH] selftests/powerpc: make the test check in eeh-basic.sh posix compliant Po-Hsu Lin
  2021-01-04  9:46 ` Frederic Barrat
@ 2021-02-03 11:40 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel, linux-kselftest, Po-Hsu Lin
  Cc: shuah, oohall, paulus

On Mon, 28 Dec 2020 12:34:59 +0800, Po-Hsu Lin wrote:
> The == operand is a bash extension, thus this will fail on Ubuntu with
> 
> As the /bin/sh on Ubuntu is pointed to DASH.
> 
> Use -eq to fix this posix compatibility issue.

Applied to powerpc/next.

[1/1] selftests/powerpc: Make the test check in eeh-basic.sh posix compliant
      https://git.kernel.org/powerpc/c/3db380570af7052620ace20c29e244938610ca71

cheers

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

end of thread, other threads:[~2021-02-03 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28  4:34 [PATCH] selftests/powerpc: make the test check in eeh-basic.sh posix compliant Po-Hsu Lin
2021-01-04  9:46 ` Frederic Barrat
2021-02-03 11:40 ` Michael Ellerman

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).