diff mbox series

selftests/powerpc: make the test check in eeh-basic.sh posix compliant

Message ID 20201228043459.14281-1-po-hsu.lin@canonical.com
State Accepted
Commit 3db380570af7052620ace20c29e244938610ca71
Headers show
Series selftests/powerpc: make the test check in eeh-basic.sh posix compliant | expand

Commit Message

Po-Hsu Lin Dec. 28, 2020, 4:34 a.m. UTC
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(-)

Comments

Michael Ellerman Feb. 3, 2021, 11:40 a.m. UTC | #1
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
diff mbox series

Patch

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 $?